[PATCH][ARM] PR target/79145 Fix xordi3 expander for immediate operands in iWMMXt

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Wed Jan 25 11:00:00 GMT 2017


Hi all,

We're hitting an ICE when expanding a DImode xor with an immediate on TARGET_IWMMXT:
(insn 6 5 7 2 (set (reg:DI 111 [ t1.1_3 ])
         (xor:DI (reg:DI 110 [ t1.0_2 ])
             (const_int 85 [0x55]))) ./z32.c:13 -1
      (nil))

The problem is that the general xordi3 expander accepts some immediates in operand 2 but the iwmmxt_xordi3
define_insn only accepts register operands, and nothing forces the operand into a register in between.
This doesn't affect the iordi3 or anddi3 expanders because their predicates are designed to accept immediates
valid for the VORR and VBIC NEON instructions and thus check for TARGET_NEON as well, so they don't accept any
immediates during expand time for TARGET_IWMMXT.

A fix could be to modify arm_xordi_operand to allow only register operands for TARGET_IWMMXT.
Another approach, used in this patch, is to force the constants into registers in the expander itself.

Bootstrapped and tested on arm-none-linux-gnueabihf (I don't have access to iWMMXt hardware).

Ok for trunk and the branches after some time?
This patch should only affect TARGET_IWMMXT and therefore is pretty safe at any stage.

Thanks,
Kyrill

2016-01-25  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/79145
     * config/arm/arm.md (xordi3): Force constant operand into a register
     for TARGET_IWMMXT.

2016-01-25  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/79145
     * gcc.target/arm/pr79145.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iwmmxt-xor.patch
Type: text/x-patch
Size: 1749 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170125/ec6bf752/attachment.bin>


More information about the Gcc-patches mailing list