aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-10-19 16:22:15 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2009-10-19 16:22:15 +0100
commit5728868b825368b02d73a4474c23b0016850af3c (patch)
tree96505bd19d105cb2157f329de264a3b2a50c62ff
parent21750c78c4afdc2ca2baa639bfc19365a8487e22 (diff)
downloadgcc-5728868b825368b02d73a4474c23b0016850af3c.zip
gcc-5728868b825368b02d73a4474c23b0016850af3c.tar.gz
gcc-5728868b825368b02d73a4474c23b0016850af3c.tar.bz2
arm.c (output_move_neon): Use DImode in call to adjust_address.
* config/arm/arm.c (output_move_neon): Use DImode in call to adjust_address. testsuite: * gcc.target/arm/neon-thumb2-move.c: New test. From-SVN: r152977
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-thumb2-move.c98
4 files changed, 108 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f8b7547..19b0169 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-19 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/arm.c (output_move_neon): Use DImode in call to
+ adjust_address.
+
2009-10-19 Matthias Klose <doko@ubuntu.com>
PR target/40134
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 3aff8e7..e013dc2 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12269,7 +12269,7 @@ output_move_neon (rtx *operands)
{
/* We're only using DImode here because it's a convenient size. */
ops[0] = gen_rtx_REG (DImode, REGNO (reg) + 2 * i);
- ops[1] = adjust_address (mem, SImode, 8 * i);
+ ops[1] = adjust_address (mem, DImode, 8 * i);
if (reg_overlap_mentioned_p (ops[0], mem))
{
gcc_assert (overlap == -1);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d4d46529..0042764a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-19 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.target/arm/neon-thumb2-move.c: New test.
+
2009-10-19 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/debug/vta-3.c: New test.
diff --git a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
new file mode 100644
index 0000000..8822851
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
@@ -0,0 +1,98 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-O2 -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon" } */
+
+#include <arm_neon.h>
+#include <stddef.h>
+
+void *
+memset (DST, C, LENGTH)
+ void *DST;
+ int C;
+ size_t LENGTH;
+{
+ void* DST0 = DST;
+ unsigned char C_BYTE = C;
+
+
+ if (__builtin_expect(LENGTH < 4, 1)) {
+ size_t i = 0;
+ while (i < LENGTH) {
+ ((char*)DST)[i] = C_BYTE;
+ i++;
+ }
+ return DST;
+ }
+
+ const char* DST_end = (char*)DST + LENGTH;
+
+
+ while ((uintptr_t)DST % 4 != 0) {
+ *(char*) (DST++) = C_BYTE;
+ }
+
+
+ uint32_t C_SHORTWORD = (uint32_t)(unsigned char)(C_BYTE) * 0x01010101;
+
+
+ if (__builtin_expect(DST_end - (char*)DST >= 16, 0)) {
+ while ((uintptr_t)DST % 16 != 0) {
+ *((uint32_t*)((char*)(DST) + (0))) = C_SHORTWORD;
+ DST += 4;
+ }
+
+
+ uint8x16_t C_WORD = vdupq_n_u8(C_BYTE);
+
+
+
+
+
+ size_t i = 0;
+ LENGTH = DST_end - (char*)DST;
+ while (i + 16 * 16 <= LENGTH) {
+ *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 1))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 2))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 3))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 4))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 5))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 6))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 7))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 8))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 9))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 10))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 11))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 12))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 13))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 14))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 15))) = C_WORD;
+ i += 16 * 16;
+ }
+ while (i + 16 * 4 <= LENGTH) {
+ *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 1))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 2))) = C_WORD;
+ *((uint8x16_t*)((char*)(DST) + (i + 16 * 3))) = C_WORD;
+ i += 16 * 4;
+ }
+ while (i + 16 <= LENGTH) {
+ *((uint8x16_t*)((char*)(DST) + (i))) = C_WORD;
+ i += 16;
+ }
+ DST += i;
+ }
+
+ while (4 <= DST_end - (char*)DST) {
+ *((uint32_t*)((char*)(DST) + (0))) = C_SHORTWORD;
+ DST += 4;
+ }
+
+
+ while ((char*)DST < DST_end) {
+ *((char*)DST) = C_BYTE;
+ DST++;
+ }
+
+ return DST0;
+}