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]

[PATCH, ARM] Allow TImode values in ARM core registers


Hi,

When support for the ARM Neon extension was committed, we accidentally
prevented TImode values from residing in ARM core registers. This patch
reverts that change.

This has no effect on a mainline testsuite run (with cross to
arm-none-eabi), but allows gcc.c-torture/compile/20000804-1.c to
compile when the -O0 -mfpu=neon -mfloat-abi=softfp options are given.
Previously that test failed in reload.

(We ended up with a CDImode reload attempting to use the *neon_movti
pattern: CDImode isn't explicitly allowed in Neon registers (i.e.
VFP_REGS), so we got:

20000804-1.c:20: error: unable to find a register to spill in class
'VFP_REGS' 20000804-1.c:20: error: this is the insn:
(insn 53 25 26 2 20000804-1.c:16 (set (subreg:TI (reg:CDI 3 r3 [145]) 0)
        (subreg:TI (reg:CDI 148) 0)) 713 {*neon_movti}
(expr_list:REG_DEAD (reg:CDI 148) (nil)))

There may still be issues with that pattern, but I think the attached
fix is desirable anyway).

OK to apply?

Julian

ChangeLog

    gcc/
    * config/arm/arm.c (arm_hard_regno_mode_ok): Permit TImode in core
    registers.
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 213080)
+++ gcc/config/arm/arm.c	(working copy)
@@ -14330,7 +14330,7 @@ arm_hard_regno_mode_ok (unsigned int reg
      they would use too many.  */
   if (regno <= LAST_ARM_REGNUM)
     return !(TARGET_LDRD && GET_MODE_SIZE (mode) > 4 && (regno & 1) != 0)
-      && !VALID_NEON_STRUCT_MODE (mode);
+      && !(VALID_NEON_STRUCT_MODE (mode) && mode != TImode);
 
   if (regno == FRAME_POINTER_REGNUM
       || regno == ARG_POINTER_REGNUM)

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