[llvm] r361230 - [AArch64][SVE2] Asm: add integer unary instructions (predicated)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 02:06:52 PDT 2019


Author: c-rhodes
Date: Tue May 21 02:06:51 2019
New Revision: 361230

URL: http://llvm.org/viewvc/llvm-project?rev=361230&view=rev
Log:
[AArch64][SVE2] Asm: add integer unary instructions (predicated)

Summary:
Patch adds support for the following instructions:

    * URECPE, URSQRTE, SQABS, SQNEG

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D62129

Added:
    llvm/trunk/test/MC/AArch64/SVE2/sqabs-diagnostics.s
    llvm/trunk/test/MC/AArch64/SVE2/sqabs.s
    llvm/trunk/test/MC/AArch64/SVE2/sqneg-diagnostics.s
    llvm/trunk/test/MC/AArch64/SVE2/sqneg.s
    llvm/trunk/test/MC/AArch64/SVE2/urecpe-diagnostics.s
    llvm/trunk/test/MC/AArch64/SVE2/urecpe.s
    llvm/trunk/test/MC/AArch64/SVE2/ursqrte-diagnostics.s
    llvm/trunk/test/MC/AArch64/SVE2/ursqrte.s
Modified:
    llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td
    llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td

Modified: llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td?rev=361230&r1=361229&r2=361230&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64SVEInstrInfo.td Tue May 21 02:06:51 2019
@@ -1134,6 +1134,12 @@ let Predicates = [HasSVE2] in {
   defm SMINP_ZPmZ : sve2_int_arith_pred<0b101101, "sminp">;
   defm UMINP_ZPmZ : sve2_int_arith_pred<0b101111, "uminp">;
 
+  // SVE2 integer unary operations (predicated)
+  defm URECPE_ZPmZ  : sve2_int_un_pred_arit_s<0b000, "urecpe">;
+  defm URSQRTE_ZPmZ : sve2_int_un_pred_arit_s<0b001, "ursqrte">;
+  defm SQABS_ZPmZ   : sve2_int_un_pred_arit<0b100, "sqabs">;
+  defm SQNEG_ZPmZ   : sve2_int_un_pred_arit<0b101, "sqneg">;
+
   // SVE2 integer multiply long
   defm SQDMULLB_ZZZ : sve2_wide_int_arith_long<0b11000, "sqdmullb">;
   defm SQDMULLT_ZZZ : sve2_wide_int_arith_long<0b11001, "sqdmullt">;

Modified: llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td?rev=361230&r1=361229&r2=361230&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td (original)
+++ llvm/trunk/lib/Target/AArch64/SVEInstrFormats.td Tue May 21 02:06:51 2019
@@ -2117,6 +2117,42 @@ multiclass sve2_int_sadd_long_accum_pair
   def _D : sve2_int_sadd_long_accum_pairwise<0b11, U, asm, ZPR64, ZPR32>;
 }
 
+class sve2_int_un_pred_arit<bits<2> sz, bit Q, bits<2> opc,
+                            string asm, ZPRRegOp zprty>
+: I<(outs zprty:$Zd), (ins zprty:$_Zd, PPR3bAny:$Pg, zprty:$Zn),
+  asm, "\t$Zd, $Pg/m, $Zn",
+  "",
+  []>, Sched<[]> {
+  bits<3> Pg;
+  bits<5> Zd;
+  bits<5> Zn;
+  let Inst{31-24} = 0b01000100;
+  let Inst{23-22} = sz;
+  let Inst{21-20} = 0b00;
+  let Inst{19}    = Q;
+  let Inst{18}    = 0b0;
+  let Inst{17-16} = opc;
+  let Inst{15-13} = 0b101;
+  let Inst{12-10} = Pg;
+  let Inst{9-5}   = Zn;
+  let Inst{4-0}   = Zd;
+
+  let Constraints = "$Zd = $_Zd";
+  let DestructiveInstType = Destructive;
+  let ElementSize = zprty.ElementSize;
+}
+
+multiclass sve2_int_un_pred_arit_s<bits<3> opc, string asm> {
+  def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0}, asm, ZPR32>;
+}
+
+multiclass sve2_int_un_pred_arit<bits<3> opc, string asm> {
+  def _B : sve2_int_un_pred_arit<0b00, opc{2}, opc{1-0}, asm, ZPR8>;
+  def _H : sve2_int_un_pred_arit<0b01, opc{2}, opc{1-0}, asm, ZPR16>;
+  def _S : sve2_int_un_pred_arit<0b10, opc{2}, opc{1-0}, asm, ZPR32>;
+  def _D : sve2_int_un_pred_arit<0b11, opc{2}, opc{1-0}, asm, ZPR64>;
+}
+
 //===----------------------------------------------------------------------===//
 // SVE2 Widening Integer Arithmetic Group
 //===----------------------------------------------------------------------===//

Added: llvm/trunk/test/MC/AArch64/SVE2/sqabs-diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/sqabs-diagnostics.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/sqabs-diagnostics.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/sqabs-diagnostics.s Tue May 21 02:06:51 2019
@@ -0,0 +1,23 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2  2>&1 < %s| FileCheck %s
+
+// ------------------------------------------------------------------------- //
+// Invalid predicate
+
+sqabs z0.s, p0/z, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: sqabs z0.s, p0/z, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+sqabs z0.s, p8/m, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7].
+// CHECK-NEXT: sqabs z0.s, p8/m, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element width
+
+sqabs z0.b, p7/m, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sqabs z0.b, p7/m, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

Added: llvm/trunk/test/MC/AArch64/SVE2/sqabs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/sqabs.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/sqabs.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/sqabs.s Tue May 21 02:06:51 2019
@@ -0,0 +1,60 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+sqabs z31.b, p7/m, z31.b
+// CHECK-INST: sqabs z31.b, p7/m, z31.b
+// CHECK-ENCODING: [0xff,0xbf,0x08,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 08 44 <unknown>
+
+sqabs z31.h, p7/m, z31.h
+// CHECK-INST: sqabs z31.h, p7/m, z31.h
+// CHECK-ENCODING: [0xff,0xbf,0x48,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 48 44 <unknown>
+
+sqabs z31.s, p7/m, z31.s
+// CHECK-INST: sqabs z31.s, p7/m, z31.s
+// CHECK-ENCODING: [0xff,0xbf,0x88,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 88 44 <unknown>
+
+sqabs z31.d, p7/m, z31.d
+// CHECK-INST: sqabs z31.d, p7/m, z31.d
+// CHECK-ENCODING: [0xff,0xbf,0xc8,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf c8 44 <unknown>
+
+
+// --------------------------------------------------------------------------//
+// Test compatibility with MOVPRFX instruction.
+
+movprfx z4.s, p7/z, z6.s
+// CHECK-INST: movprfx	z4.s, p7/z, z6.s
+// CHECK-ENCODING: [0xc4,0x3c,0x90,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 3c 90 04 <unknown>
+
+sqabs z4.s, p7/m, z31.s
+// CHECK-INST: sqabs z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x88,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 88 44 <unknown>
+
+movprfx z4, z6
+// CHECK-INST: movprfx	z4, z6
+// CHECK-ENCODING: [0xc4,0xbc,0x20,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 bc 20 04 <unknown>
+
+sqabs z4.s, p7/m, z31.s
+// CHECK-INST: sqabs z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x88,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 88 44 <unknown>

Added: llvm/trunk/test/MC/AArch64/SVE2/sqneg-diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/sqneg-diagnostics.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/sqneg-diagnostics.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/sqneg-diagnostics.s Tue May 21 02:06:51 2019
@@ -0,0 +1,23 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2  2>&1 < %s| FileCheck %s
+
+// ------------------------------------------------------------------------- //
+// Invalid predicate
+
+sqneg z0.s, p0/z, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: sqneg z0.s, p0/z, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+sqneg z0.s, p8/m, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7].
+// CHECK-NEXT: sqneg z0.s, p8/m, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element width
+
+sqneg z0.b, p7/m, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: sqneg z0.b, p7/m, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

Added: llvm/trunk/test/MC/AArch64/SVE2/sqneg.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/sqneg.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/sqneg.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/sqneg.s Tue May 21 02:06:51 2019
@@ -0,0 +1,60 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+sqneg z31.b, p7/m, z31.b
+// CHECK-INST: sqneg z31.b, p7/m, z31.b
+// CHECK-ENCODING: [0xff,0xbf,0x09,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 09 44 <unknown>
+
+sqneg z31.h, p7/m, z31.h
+// CHECK-INST: sqneg z31.h, p7/m, z31.h
+// CHECK-ENCODING: [0xff,0xbf,0x49,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 49 44 <unknown>
+
+sqneg z31.s, p7/m, z31.s
+// CHECK-INST: sqneg z31.s, p7/m, z31.s
+// CHECK-ENCODING: [0xff,0xbf,0x89,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 89 44 <unknown>
+
+sqneg z31.d, p7/m, z31.d
+// CHECK-INST: sqneg z31.d, p7/m, z31.d
+// CHECK-ENCODING: [0xff,0xbf,0xc9,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf c9 44 <unknown>
+
+
+// --------------------------------------------------------------------------//
+// Test compatibility with MOVPRFX instruction.
+
+movprfx z4.s, p7/z, z6.s
+// CHECK-INST: movprfx	z4.s, p7/z, z6.s
+// CHECK-ENCODING: [0xc4,0x3c,0x90,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 3c 90 04 <unknown>
+
+sqneg z4.s, p7/m, z31.s
+// CHECK-INST: sqneg z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x89,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 89 44 <unknown>
+
+movprfx z4, z6
+// CHECK-INST: movprfx	z4, z6
+// CHECK-ENCODING: [0xc4,0xbc,0x20,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 bc 20 04 <unknown>
+
+sqneg z4.s, p7/m, z31.s
+// CHECK-INST: sqneg z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x89,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 89 44 <unknown>

Added: llvm/trunk/test/MC/AArch64/SVE2/urecpe-diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/urecpe-diagnostics.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/urecpe-diagnostics.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/urecpe-diagnostics.s Tue May 21 02:06:51 2019
@@ -0,0 +1,33 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2  2>&1 < %s| FileCheck %s
+
+// ------------------------------------------------------------------------- //
+// Invalid predicate
+
+urecpe z0.s, p0/z, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: urecpe z0.s, p0/z, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+urecpe z0.s, p8/m, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7].
+// CHECK-NEXT: urecpe z0.s, p8/m, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element width
+
+urecpe z0.b, p7/m, z1.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: urecpe z0.b, p7/m, z1.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+urecpe z0.h, p7/m, z1.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: urecpe z0.h, p7/m, z1.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+urecpe z0.d, p7/m, z1.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: urecpe z0.d, p7/m, z1.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

Added: llvm/trunk/test/MC/AArch64/SVE2/urecpe.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/urecpe.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/urecpe.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/urecpe.s Tue May 21 02:06:51 2019
@@ -0,0 +1,42 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+urecpe z31.s, p7/m, z31.s
+// CHECK-INST: urecpe z31.s, p7/m, z31.s
+// CHECK-ENCODING: [0xff,0xbf,0x80,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 80 44 <unknown>
+
+
+// --------------------------------------------------------------------------//
+// Test compatibility with MOVPRFX instruction.
+
+movprfx z4.s, p7/z, z6.s
+// CHECK-INST: movprfx	z4.s, p7/z, z6.s
+// CHECK-ENCODING: [0xc4,0x3c,0x90,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 3c 90 04 <unknown>
+
+urecpe z4.s, p7/m, z31.s
+// CHECK-INST: urecpe z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x80,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 80 44 <unknown>
+
+movprfx z4, z6
+// CHECK-INST: movprfx	z4, z6
+// CHECK-ENCODING: [0xc4,0xbc,0x20,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 bc 20 04 <unknown>
+
+urecpe z4.s, p7/m, z31.s
+// CHECK-INST: urecpe z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x80,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 80 44 <unknown>

Added: llvm/trunk/test/MC/AArch64/SVE2/ursqrte-diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/ursqrte-diagnostics.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/ursqrte-diagnostics.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/ursqrte-diagnostics.s Tue May 21 02:06:51 2019
@@ -0,0 +1,33 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2  2>&1 < %s| FileCheck %s
+
+// ------------------------------------------------------------------------- //
+// Invalid predicate
+
+ursqrte z0.s, p0/z, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: ursqrte z0.s, p0/z, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+ursqrte z0.s, p8/m, z1.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7].
+// CHECK-NEXT: ursqrte z0.s, p8/m, z1.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+
+// ------------------------------------------------------------------------- //
+// Invalid element width
+
+ursqrte z0.b, p7/m, z1.b
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: ursqrte z0.b, p7/m, z1.b
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+ursqrte z0.h, p7/m, z1.h
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: ursqrte z0.h, p7/m, z1.h
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+ursqrte z0.d, p7/m, z1.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: ursqrte z0.d, p7/m, z1.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

Added: llvm/trunk/test/MC/AArch64/SVE2/ursqrte.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/SVE2/ursqrte.s?rev=361230&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/SVE2/ursqrte.s (added)
+++ llvm/trunk/test/MC/AArch64/SVE2/ursqrte.s Tue May 21 02:06:51 2019
@@ -0,0 +1,42 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+
+ursqrte z31.s, p7/m, z31.s
+// CHECK-INST: ursqrte z31.s, p7/m, z31.s
+// CHECK-ENCODING: [0xff,0xbf,0x81,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: ff bf 81 44 <unknown>
+
+
+// --------------------------------------------------------------------------//
+// Test compatibility with MOVPRFX instruction.
+
+movprfx z4.s, p7/z, z6.s
+// CHECK-INST: movprfx	z4.s, p7/z, z6.s
+// CHECK-ENCODING: [0xc4,0x3c,0x90,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 3c 90 04 <unknown>
+
+ursqrte z4.s, p7/m, z31.s
+// CHECK-INST: ursqrte z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x81,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 81 44 <unknown>
+
+movprfx z4, z6
+// CHECK-INST: movprfx	z4, z6
+// CHECK-ENCODING: [0xc4,0xbc,0x20,0x04]
+// CHECK-ERROR: instruction requires: sve
+// CHECK-UNKNOWN: c4 bc 20 04 <unknown>
+
+ursqrte z4.s, p7/m, z31.s
+// CHECK-INST: ursqrte z4.s, p7/m, z31.s
+// CHECK-ENCODING: [0xe4,0xbf,0x81,0x44]
+// CHECK-ERROR: instruction requires: sve2
+// CHECK-UNKNOWN: e4 bf 81 44 <unknown>




More information about the llvm-commits mailing list