itoa'd you so?

Levi Pearson levi at cold.org
Fri Sep 21 14:48:56 MDT 2007


Steve <smorrey at gmail.com> writes:
> Since the sprintf function is slowing down on the log10 due to
> floating point arithmetic, I wonder if a further optimization could be
> made by rewriting the log10 function in assembler to take advantage of
> the floating point registers?
> My ASM is way to rusty to attempt this right now but I think I'll go
> through the IA-32 docs and check out the feasibility of doing this.
>
> While it would be pointless for itoa (we would still need to convert
> float to int), it might work nicely for an ftoa function :)

sprintf() wasn't slowing down on fp math, his previous code was.  And,
before dropping down to asm for optimization, it would probably be
worthwhile to tell gcc to output the asm it's generating to see if
it's already using whatever optimization you were thinking of.

                --Levi



More information about the PLUG mailing list