arm: Fix MVE constraints for movmisalign [PR target/99727]
authorChristophe Lyon <christophe.lyon@linaro.org>
Wed, 24 Mar 2021 08:51:41 +0000 (08:51 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Wed, 24 Mar 2021 14:22:48 +0000 (14:22 +0000)
MVE has different constraints than Neon for load/store: we should use
the Ux constraint instead of Um.

2021-03-24  Christophe Lyon  <christophe.lyon@linaro.org>

PR target/99727
gcc/
* config/arm/mve.md (movmisalign<mode>_mve_store): Use Ux
constraint.
(movmisalign<mode>_mve_load): Likewise.

gcc/testsuite/
* gcc.target/arm/pr99727.c: New test.

gcc/config/arm/mve.md
gcc/testsuite/gcc.target/arm/pr99727.c [new file with mode: 0644]

index 440fd6a..1351863 100644 (file)
 )
 
 (define_insn "*movmisalign<mode>_mve_store"
-  [(set (match_operand:MVE_VLD_ST 0 "neon_permissive_struct_operand"        "=Um")
+  [(set (match_operand:MVE_VLD_ST 0 "neon_permissive_struct_operand"        "=Ux")
        (unspec:MVE_VLD_ST [(match_operand:MVE_VLD_ST 1 "s_register_operand" " w")]
         UNSPEC_MISALIGNED_ACCESS))]
   "((TARGET_HAVE_MVE && VALID_MVE_SI_MODE (<MODE>mode))
 
 (define_insn "*movmisalign<mode>_mve_load"
   [(set (match_operand:MVE_VLD_ST 0 "s_register_operand"                                "=w")
-       (unspec:MVE_VLD_ST [(match_operand:MVE_VLD_ST 1 "neon_permissive_struct_operand" " Um")]
+       (unspec:MVE_VLD_ST [(match_operand:MVE_VLD_ST 1 "neon_permissive_struct_operand" " Ux")]
         UNSPEC_MISALIGNED_ACCESS))]
   "((TARGET_HAVE_MVE && VALID_MVE_SI_MODE (<MODE>mode))
     || (TARGET_HAVE_MVE_FLOAT && VALID_MVE_SF_MODE (<MODE>mode)))
diff --git a/gcc/testsuite/gcc.target/arm/pr99727.c b/gcc/testsuite/gcc.target/arm/pr99727.c
new file mode 100644 (file)
index 0000000..92585e2
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-options "-O3" } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+char a[7][25][15][14];
+void b() {
+  for (int c;; ++c)
+    for (int d = 0; d < 25; ++d)
+      for (int e = 0; e < 15; ++e)
+       for (int f = 0; f < 14; ++f)
+         a[c][d][e][f] = 1;
+}