neon.md (neon_vshll_n<mode>): Checking Bounds fixed.
authorDaniel Gutson <dgutson@codesourcery.com>
Wed, 14 Oct 2009 19:18:20 +0000 (19:18 +0000)
committerDaniel Gutson <dgutson@gcc.gnu.org>
Wed, 14 Oct 2009 19:18:20 +0000 (19:18 +0000)
2009-10-14  Daniel Gutson  <dgutson@codesourcery.com>

        gcc/
        * config/arm/neon.md (neon_vshll_n<mode>): Checking Bounds
        fixed.

        gcc/testsuite/
        * gcc.target/arm/neon/vfp-shift-a2t2.c: New test case.

From-SVN: r152777

ChangeLog
gcc/config/arm/neon.md
gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c [new file with mode: 0644]

index 552f0457ae5b32e5592df8ae61dc89d5bb770025..86a082dd8ceb088f057f52846d6b5b989bc7488f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-14  Daniel Gutson  <dgutson@codesourcery.com>
+
+       gcc/
+       * config/arm/neon.md (neon_vshll_n<mode>): Checking Bounds
+       fixed.
+
+       gcc/testsuite/
+       * gcc.target/arm/neon/vfp-shift-a2t2.c: New test case.
+
 2009-10-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure.ac: Add 'lto' to enable_languages, not
index 85bc3eed1007450a662fef9902af2ea8f1ec76c5..7d1ef11133939cdc6f24e373f1c69085304b722a 100644 (file)
                          UNSPEC_VSHLL_N))]
   "TARGET_NEON"
 {
-  neon_const_bounds (operands[2], 0, neon_element_bits (<MODE>mode));
+  /* The boundaries are: 0 < imm <= size.  */
+  neon_const_bounds (operands[2], 0, neon_element_bits (<MODE>mode) + 1);
   return "vshll.%T3%#<V_sz_elem>\t%q0, %P1, %2";
 }
   [(set_attr "neon_type" "neon_shift_1")]
diff --git a/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c b/gcc/testsuite/gcc.target/arm/neon/vfp-shift-a2t2.c
new file mode 100644 (file)
index 0000000..2541df8
--- /dev/null
@@ -0,0 +1,27 @@
+/* Check that NEON vector shifts support immediate values == size.  /*
+
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-save-temps -mfpu=neon -mfloat-abi=softfp" } */
+
+#include <arm_neon.h>
+
+uint16x8_t test_vshll_n_u8 (uint8x8_t a)
+{
+    return vshll_n_u8(a, 8);
+}
+
+uint32x4_t test_vshll_n_u16 (uint16x4_t a)
+{   
+    return vshll_n_u16(a, 16);
+}
+
+uint64x2_t test_vshll_n_u32 (uint32x2_t a)
+{
+    return vshll_n_u32(a, 32);
+}
+
+/* { dg-final { scan-assembler "vshll\.u16\[   \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[      \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
+/* { dg-final { scan-assembler "vshll\.u32\[   \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[      \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
+/* { dg-final { scan-assembler "vshll\.u8\[    \]+\[qQ\]\[0-9\]+, \[dD\]\[0-9\]+, #\[0-9\]+!?\(\[      \]+@\[a-zA-Z0-9 \]+\)?\n" } } */
+/* { dg-final { cleanup-saved-temps } } */