[Vorbis-dev] [PATCH] smallft.c

Segher Boessenkool segher at kernel.crashing.org
Wed Jan 9 14:17:04 PST 2013


Hi Michael,

> I have a small diff for Vorbis
> which replaces some loops with memcpy.
> This allows us to take advantage of
> memcpy's optimisations when copying
> the floating point data.
>
> Does this look OK?

> -  for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
> +  memcpy(c2, ch2, idl1 * sizeof(float));

Most compilers can do this for you, e.g. GCC does this transformation
at -O3.  It usually does not help, and it can hurt.

The original code is clearer and much less error-prone, in my opinion.

For future patches, please keep the same coding style; the lack of
whitespace is hard to read, but a mix of styles is even worse.


Segher



More information about the Vorbis-dev mailing list