]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Arm: Fix IT-predicated MVE vcvt
authorJoe Ramsay <joe.ramsay@.arm.com>
Fri, 14 Aug 2020 07:00:03 +0000 (08:00 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 14 Aug 2020 07:12:40 +0000 (08:12 +0100)
This patch fixes an incorrect parsing of vcvtne for MVE. Even when it appeared
in an IT block, vcvtne would be parsed as a VPT-predicated vcvtn, instead of an
IT-predicated vcvt. This change extends the existing handling of MVE vcvt to
properly account for IT predication.

gas/ChangeLog:

2020-08-13  Joe Ramsay  <joe.ramsay@arm.com>

Backported from master
2020-08-04  Joe Ramsay <joe.ramsay@.arm.com>

* config/tc-arm.c (do_neon_cvt_1): Parse vcvtne as vcvt-ne for
NS_FD shape when MVE is present
* testsuite/gas/arm/mve-vcvtne-it-bad.d: New test.
* testsuite/gas/arm/mve-vcvtne-it-bad.l: New test.
* testsuite/gas/arm/mve-vcvtne-it-bad.s: New test.
* testsuite/gas/arm/mve-vcvtne-it.d: New test.
* testsuite/gas/arm/mve-vcvtne-it.s: New test.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/gas/arm/mve-vcvtne-it-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/mve-vcvtne-it-bad.l [new file with mode: 0644]
gas/testsuite/gas/arm/mve-vcvtne-it-bad.s [new file with mode: 0644]
gas/testsuite/gas/arm/mve-vcvtne-it.d [new file with mode: 0644]
gas/testsuite/gas/arm/mve-vcvtne-it.s [new file with mode: 0644]

index fa480141e02f91ef5a41fa2fff883211bed6f844..183cfe58d84284cb82f6aea8280da472dc1d570f 100644 (file)
@@ -1,3 +1,16 @@
+2020-08-14  Joe Ramsay  <joe.ramsay@arm.com>
+
+       Backported from master
+       2020-08-04  Joe Ramsay <joe.ramsay@.arm.com>
+
+       * config/tc-arm.c (do_neon_cvt_1): Parse vcvtne as vcvt-ne for
+       NS_FD shape when MVE is present
+       * testsuite/gas/arm/mve-vcvtne-it-bad.d: New test.
+       * testsuite/gas/arm/mve-vcvtne-it-bad.l: New test.
+       * testsuite/gas/arm/mve-vcvtne-it-bad.s: New test.
+       * testsuite/gas/arm/mve-vcvtne-it.d: New test.
+       * testsuite/gas/arm/mve-vcvtne-it.s: New test.
+
 2020-08-12  Nick Clifton  <nickc@redhat.com>
 
        * po/ru.po: Updated Russian translation.
index a7e0ae785b7229cf183811771701796f4c23a78d..e0d0cbd5463afe26a877e6a33e5d6f7684a163f0 100644 (file)
@@ -19087,6 +19087,16 @@ do_neon_cvt_1 (enum neon_cvt_mode mode)
       return;
     }
 
+  if ((rs == NS_FD || rs == NS_QQI) && mode == neon_cvt_mode_n
+      && ARM_CPU_HAS_FEATURE (cpu_variant, mve_ext))
+    {
+      /* We are dealing with vcvt with the 'ne' condition.  */
+      inst.cond = 0x1;
+      inst.instruction = N_MNEM_vcvt;
+      do_neon_cvt_1 (neon_cvt_mode_z);
+      return;
+    }
+
   /* VFP rather than Neon conversions.  */
   if (flavour >= neon_cvt_flavour_first_fp)
     {
@@ -19115,14 +19125,6 @@ do_neon_cvt_1 (enum neon_cvt_mode mode)
                                             NEON_CHECK_CC | NEON_CHECK_ARCH))
            return;
        }
-      else if (mode == neon_cvt_mode_n)
-       {
-         /* We are dealing with vcvt with the 'ne' condition.  */
-         inst.cond = 0x1;
-         inst.instruction = N_MNEM_vcvt;
-         do_neon_cvt_1 (neon_cvt_mode_z);
-         return;
-       }
       /* fall through.  */
     case NS_DDI:
       {
diff --git a/gas/testsuite/gas/arm/mve-vcvtne-it-bad.d b/gas/testsuite/gas/arm/mve-vcvtne-it-bad.d
new file mode 100644 (file)
index 0000000..110f45f
--- /dev/null
@@ -0,0 +1,5 @@
+# name: MVE vcvtne instruction outside of IT block
+# as: -march=armv8.1-m.main+mve.fp+fp.dp
+# error_output: mve-vcvtne-it-bad.l
+
+.*: +file format .*arm.*
diff --git a/gas/testsuite/gas/arm/mve-vcvtne-it-bad.l b/gas/testsuite/gas/arm/mve-vcvtne-it-bad.l
new file mode 100644 (file)
index 0000000..8765ae0
--- /dev/null
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:3: Error: thumb conditional instruction should be in IT block -- `vcvtne.s32.f64 s13,d8'
diff --git a/gas/testsuite/gas/arm/mve-vcvtne-it-bad.s b/gas/testsuite/gas/arm/mve-vcvtne-it-bad.s
new file mode 100644 (file)
index 0000000..e4c1b99
--- /dev/null
@@ -0,0 +1,3 @@
+.syntax unified
+.text
+vcvtne.s32.f64 s13, d8
diff --git a/gas/testsuite/gas/arm/mve-vcvtne-it.d b/gas/testsuite/gas/arm/mve-vcvtne-it.d
new file mode 100644 (file)
index 0000000..b376a98
--- /dev/null
@@ -0,0 +1,9 @@
+# name: Armv8.1-M Mainline vcvt instruction in it block (with MVE)
+# as: -march=armv8.1-m.main+mve.fp+fp.dp
+# objdump: -dr --prefix-addresses --show-raw-insn -marmv8.1-m.main
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+^[^>]*> bf18[  ]+it[   ]+ne
+^[^>]*> eefd 6bc8[     ]+vcvtne.s32.f64[       ]+s13, d8
\ No newline at end of file
diff --git a/gas/testsuite/gas/arm/mve-vcvtne-it.s b/gas/testsuite/gas/arm/mve-vcvtne-it.s
new file mode 100644 (file)
index 0000000..a9f2606
--- /dev/null
@@ -0,0 +1,4 @@
+.syntax unified
+.text
+it ne
+vcvtne.s32.f64 s13, d8