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]

ARM patch: New cbranchqi, cbranchhi patterns for Thumb-1


On Thumb-1, comparisons of integer values smaller than a word can be
done by shifting the value to the left.  This patch adds a new macroized
pattern, cbranch<mode>4_insn, which is used for QImode and HImode, and
does exactly that.  Effects:

-       lsl     r2, r1, #24
-       lsr     r2, r2, #24
-       cmp     r2, #0
+       lsl     r1, #24
        bne     .L195

This uses the neat trick of putting a matching constraint on a
match_scratch.

An earlier version (with slightly more stupid code) was regression
tested on qemu/arm-linux with my usual set of three flags.  This version
generates identical code as the tested one for all my testcases.  Ok if
retest passes?


Bernd

Attachment: cbranchmode.diff
Description: Text document


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