]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm.c (arm_legitimate_index_p): Add VFP load/store index range case.
authorChung-Lin Tang <cltang@codesourcery.com>
Sun, 19 Dec 2010 09:04:41 +0000 (09:04 +0000)
committerChung-Lin Tang <cltang@gcc.gnu.org>
Sun, 19 Dec 2010 09:04:41 +0000 (09:04 +0000)
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

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/vfp-1.c

index 0450bfd37e6cc32552d5e5c2ba44929f1d522662..f79db55574a6419a21ab4c6caa49484d5658afa4 100644 (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
index 2bfdd9fec551f0e5b558310938a3d0cdf170357f..d7108a38ec053ce565a94b19aff6f8915454434c 100644 (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
index 6f30e61b1747528be054ed86b506d734310c7a08..d8c514654c5344130b3ae4d69974312eac0e7cf9 100644 (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.
index bbf91409842fca4773b4b403205a8b5d9041a6e7..3a7090e4be3d7472ff0e1722748e9fab0d5d0900 100644 (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];
+}