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]
Other format: [Raw text]

[SH4] DFmode splits after reload


Hi All,

  The instruction
        a[i] += a[j];       /* a is a double array */
 when compiled for SH4 (-O2 -ml -m4) generates the following assembly.

fmov.s @r2+,fr5
fmov.s @r1,fr2
add #-4,r1              <-- Here
fmov.s @r2,fr4
add #4,r1               <-- Here
fadd dr4,dr2
fmov.s fr2,@r1
fmov.s fr3,@-r1

 Clearly, the marked instructions are useless and should be omitted.
SH4 doesn't allow for 64-bit load/stores and hence a DF mode load/store
insn is split into 3 insns (after reload) -> 2 32-bit load/stores and 
one address arithmetic insn. These address arithmetic insns clutter the
code.
Also, ISP2 freedom is restricted due to unnecessary insns. The extreme case
is present in stress-1.17/layer3.i benchmark.

  Is there any possibility of recombination of splitted instructions
with other insns? There is a lot of operators in scope - ADD, SUB,
OR, AND, Post/Pre Inc/Dec, etc. IMHO, it should clean the code on other
processors also.

Regards,
Rakesh Kumar


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