This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

float copy


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]