Commit 49460951 by Nathan Froyd Committed by Nathan Froyd

arm.c (arm_legitimate_index_p): Split VALID_NEON_QREG_MODE and VALID_NEON_DREG_MODE cases.

gcc/
	* config/arm/arm.c (arm_legitimate_index_p): Split
	VALID_NEON_QREG_MODE and VALID_NEON_DREG_MODE cases.  Permit
	slightly larger constants in the latter case.
	(thumb2_legitimate_index_p): Likewise.

gcc/testsuite/
	* gcc.target/arm/neon-offset-1.c: New test.

From-SVN: r167430
parent dd9f93dc
2010-12-03 Nathan Froyd <froydnj@codesourcery.com>
* config/arm/arm.c (arm_legitimate_index_p): Split
VALID_NEON_QREG_MODE and VALID_NEON_DREG_MODE cases. Permit
slightly larger constants in the latter case.
(thumb2_legitimate_index_p): Likewise.
2010-12-03 Joseph Myers <joseph@codesourcery.com> 2010-12-03 Joseph Myers <joseph@codesourcery.com>
* common.opt (N, Q, Qn, Qy, Z, n, r, s, t): New options. * common.opt (N, Q, Qn, Qy, Z, n, r, s, t): New options.
...@@ -5649,13 +5649,25 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, RTX_CODE outer, ...@@ -5649,13 +5649,25 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, RTX_CODE outer,
&& INTVAL (index) > -1024 && INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0); && (INTVAL (index) & 3) == 0);
if (TARGET_NEON /* For quad modes, we restrict the constant offset to be slightly less
&& (VALID_NEON_DREG_MODE (mode) || VALID_NEON_QREG_MODE (mode))) than what the instruction format permits. We do this because for
quad mode moves, we will actually decompose them into two separate
double-mode reads or writes. INDEX must therefore be a valid
(double-mode) offset and so should INDEX+8. */
if (TARGET_NEON && VALID_NEON_QREG_MODE (mode))
return (code == CONST_INT return (code == CONST_INT
&& INTVAL (index) < 1016 && INTVAL (index) < 1016
&& INTVAL (index) > -1024 && INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0); && (INTVAL (index) & 3) == 0);
/* We have no such constraint on double mode offsets, so we permit the
full range of the instruction format. */
if (TARGET_NEON && VALID_NEON_DREG_MODE (mode))
return (code == CONST_INT
&& INTVAL (index) < 1024
&& INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0);
if (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (mode)) if (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (mode))
return (code == CONST_INT return (code == CONST_INT
&& INTVAL (index) < 1024 && INTVAL (index) < 1024
...@@ -5769,13 +5781,25 @@ thumb2_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p) ...@@ -5769,13 +5781,25 @@ thumb2_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
&& (INTVAL (index) & 3) == 0); && (INTVAL (index) & 3) == 0);
} }
if (TARGET_NEON /* For quad modes, we restrict the constant offset to be slightly less
&& (VALID_NEON_DREG_MODE (mode) || VALID_NEON_QREG_MODE (mode))) than what the instruction format permits. We do this because for
quad mode moves, we will actually decompose them into two separate
double-mode reads or writes. INDEX must therefore be a valid
(double-mode) offset and so should INDEX+8. */
if (TARGET_NEON && VALID_NEON_QREG_MODE (mode))
return (code == CONST_INT return (code == CONST_INT
&& INTVAL (index) < 1016 && INTVAL (index) < 1016
&& INTVAL (index) > -1024 && INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0); && (INTVAL (index) & 3) == 0);
/* We have no such constraint on double mode offsets, so we permit the
full range of the instruction format. */
if (TARGET_NEON && VALID_NEON_DREG_MODE (mode))
return (code == CONST_INT
&& INTVAL (index) < 1024
&& INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0);
if (arm_address_register_rtx_p (index, strict_p) if (arm_address_register_rtx_p (index, strict_p)
&& (GET_MODE_SIZE (mode) <= 4)) && (GET_MODE_SIZE (mode) <= 4))
return 1; return 1;
......
2010-12-03 Nathan Froyd <froydnj@codesourcery.com>
* gcc.target/arm/neon-offset-1.c: New test.
2010-12-03 Alexander Monakov <amonakov@ispras.ru> 2010-12-03 Alexander Monakov <amonakov@ispras.ru>
PR rtl-optimization/45354 PR rtl-optimization/45354
......
/* { dg-do compile } */
/* { dg-require-effective-target arm_neon_ok } */
/* { dg-options "-O1" } */
/* { dg-add-options arm_neon } */
#include <arm_neon.h>
void neon_internal_error(int32x4_t *dst, char *src)
{
*dst = *(int32x4_t *)(src+1008);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment