This is the mail archive of the gcc-patches@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]

More ARM pattern merging


This deals with the various arith_shift patterns which are needlessly
duplicated in thumb2.md.  Merging them requires that we define attribute
enabled, so we can conditionally enable the correct alternatives.

There was a problem with reload_cse_regs.  Since arith_shiftsi can take
the same form as mulsi3_addsi, when reload_cse_regs tries to replace a
constant operand with a register, arith_shiftsi no longer matches, but
the mla does, so the replacement is validated.  Effect of this patch:

        mov     r2, #4
-       mla     r1, r5, r2, r0
+       add     r1, r0, r5, asl #2

Just guessing, but probably mla is a more expensive operation?

Notes:
- I left thumb2_cmpsi_neg_shiftsi alone for now, as it differs from the
  corresponding arm.md pattern
- Some ARM patterns used rI for the shift amount, corrected to the M,r
  form now used elsewhere.

Regression tested (a slightly earlier version with some different
pattern names) with the usual set of flags on arm-linux.


Bernd

Attachment: arm-enabled2.diff
Description: Text document


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