This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[csl-arm] NEON addressing mode fix.
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 21 Oct 2006 02:35:08 +0100
- Subject: [csl-arm] NEON addressing mode fix.
The patch below fixes an inconsistency between arm_legitimate address_p and
the addresses accepted by the NEON vector mov patterns. This caused ices when
vectorizing code like:
p[i] = r[i] + r[i+1];
We probably shouldn't be trying to vectorize such code on targets that don't
have unaligned loads, but that's a different issue. The vector code is
technically legal because it's protected by a condition that will never be
true.
Paul
2006-10-21 Paul Brook <paul@codesourcery.com>
gcc/
* config/arm/arm.c (arm_legitimate_index_p): Add NEON vector
addressing modes.
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c (revision 117906)
+++ gcc/config/arm/arm.c (working copy)
@@ -3778,6 +3778,13 @@ arm_legitimate_index_p (enum machine_mod
&& INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0);
+ if (TARGET_NEON
+ && (VALID_NEON_DREG_MODE (mode) || VALID_NEON_QREG_MODE (mode)))
+ return (code == CONST_INT
+ && INTVAL (index) < 1016
+ && INTVAL (index) > -1024
+ && (INTVAL (index) & 3) == 0);
+
if (arm_address_register_rtx_p (index, strict_p)
&& (GET_MODE_SIZE (mode) <= 4))
return 1;