Uros Bizjak - [PATCH, i386]: Commited: Reorder expm1 RTL sequence for better generated (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]
Other format: [Raw text]

Hello!

Currently, we generate following asm for expm1() (-O2 -ffast-math -fomit-frame-pointer):

   fldl2e
   fld1
   fxch    %st(1)
   fmull   4(%esp)
   fld     %st(0)
   frndint
   fsubr   %st, %st(1)
   fxch    %st(1)
   f2xm1
   fscale
   fld     %st(2)
   fxch    %st(1)
   fxch    %st(2)
   fxch    %st(1)
   fscale
   fstp    %st(1)
   fsubp   %st, %st(2)
   faddp   %st, %st(1)
   ret

Attached patch reorders the sequence in expm1 expander to prevent CSEing of fld1. Generated code is now shorter for a few fxchs:

   fldl2e
   fmull   4(%esp)
   fld     %st(0)
   frndint
   fsubr   %st, %st(1)
   fld1
   fxch    %st(2)
   f2xm1
   fscale
   fxch    %st(2)
   fscale
   fstp    %st(1)
   fsubs   .LC0
   faddp   %st, %st(1)
   ret

2007-02-20 Uros Bizjak ubizjak@gmail.com

* config/i386/i386.md (expm1xf2): Reorder insn sequence for
better code generation.

Patch was regression tested on i686-pc-linux-gnu for all default languages. Patch is committed to SVN.

Uros.

Attachment:i386-expm1.diff
Description: Binary data


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