float copy

Alexander V. Lukyanov lav@long.yar.ru
Thu Sep 24 16:30:00 GMT 1998


Hi!

I noticed that gcc and egcs use fpu to copy floats on intel.
I think it is not the fastest way. I tried to use the following
macro in several places of mesa library and got frame rate
improvement 17.0 -> 17.3 :) (on pentum mmx 166)

#define COPY( DST, SRC )                        \
   if (sizeof(GLuint)==sizeof(DST)) {           \
      __typeof__(DST) tmp=(SRC);                \
      *((GLuint*)&(DST)) = *((const GLuint*)&tmp); \
   }                                            \
   else {                                       \
      (DST) = (SRC);                            \
   }

I verified asm output and integer load/store were really used.

   Alexander.



More information about the Gcc mailing list