arm.c (arm_legitimate_index_p): Add VFP load/store index range case.

2010-12-19  Chung-Lin Tang  <cltang@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_legitimate_index_p): Add VFP load/store
	index range case. Change to SF/DFmode tests to avoid capturing HFmode.
	(thumb2_legitimate_index_p): Same.

	gcc/testsuite/
	* gcc.target/arm/vfp-1.c (test_ldst): New test for VFP
	load/store immediate indexes.

From-SVN: r168045
This commit is contained in:
Chung-Lin Tang 2010-12-19 09:04:41 +00:00 committed by Chung-Lin Tang
parent 120d5f8ea4
commit f3fb659020
4 changed files with 27 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2010-12-19 Chung-Lin Tang <cltang@codesourcery.com>
* config/arm/arm.c (arm_legitimate_index_p): Add VFP load/store
index range case. Change to SF/DFmode tests to avoid capturing HFmode.
(thumb2_legitimate_index_p): Same.
2010-12-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/46969

View file

@ -5647,8 +5647,8 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, RTX_CODE outer,
/* Standard coprocessor addressing modes. */
if (TARGET_HARD_FLOAT
&& (TARGET_FPA || TARGET_MAVERICK)
&& (GET_MODE_CLASS (mode) == MODE_FLOAT
&& (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK)
&& (mode == SFmode || mode == DFmode
|| (TARGET_MAVERICK && mode == DImode)))
return (code == CONST_INT && INTVAL (index) < 1024
&& INTVAL (index) > -1024
@ -5768,8 +5768,8 @@ thumb2_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
/* ??? Combine arm and thumb2 coprocessor addressing modes. */
/* Standard coprocessor addressing modes. */
if (TARGET_HARD_FLOAT
&& (TARGET_FPA || TARGET_MAVERICK)
&& (GET_MODE_CLASS (mode) == MODE_FLOAT
&& (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK)
&& (mode == SFmode || mode == DFmode
|| (TARGET_MAVERICK && mode == DImode)))
return (code == CONST_INT && INTVAL (index) < 1024
&& INTVAL (index) > -1024

View file

@ -1,3 +1,8 @@
2010-12-19 Chung-Lin Tang <cltang@codesourcery.com>
* gcc.target/arm/vfp-1.c (test_ldst): New test for VFP
load/store immediate indexes.
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-resolve-method.m: Include objc/message.h.

View file

@ -125,3 +125,15 @@ void test_convert () {
d1 = u1;
}
void test_ldst (float f[], double d[]) {
/* { dg-final { scan-assembler "flds.+ \\\[r0, #1020\\\]" } } */
/* { dg-final { scan-assembler "flds.+ \\\[r0, #-1020\\\]" } } */
/* { dg-final { scan-assembler "add.+ r0, #1024" } } */
/* { dg-final { scan-assembler "fsts.+ \\\[r0, #0\\\]$" } } */
f[256] = f[255] + f[-255];
/* { dg-final { scan-assembler "fldd.+ \\\[r1, #1016\\\]" } } */
/* { dg-final { scan-assembler "fldd.+ \\\[r1, #-1016\\\]" } } */
/* { dg-final { scan-assembler "fstd.+ \\\[r1, #256\\\]" } } */
d[32] = d[127] + d[-127];
}