diff options
20 files changed, 394 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td index 9f16d74b37a..a6067af111a 100644 --- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -716,6 +716,16 @@ let Predicates = [HasSVE] in { def FCVTZS_ZPmZ_DtoD : sve_fp_2op_p_zd<0b1111110, "fcvtzs", ZPR64, ZPR64>; def FCVTZU_ZPmZ_DtoD : sve_fp_2op_p_zd<0b1111111, "fcvtzu", ZPR64, ZPR64>; + defm FRINTN_ZPmZ : sve_fp_2op_p_zd_HSD<0b00000, "frintn">; + defm FRINTP_ZPmZ : sve_fp_2op_p_zd_HSD<0b00001, "frintp">; + defm FRINTM_ZPmZ : sve_fp_2op_p_zd_HSD<0b00010, "frintm">; + defm FRINTZ_ZPmZ : sve_fp_2op_p_zd_HSD<0b00011, "frintz">; + defm FRINTA_ZPmZ : sve_fp_2op_p_zd_HSD<0b00100, "frinta">; + defm FRINTX_ZPmZ : sve_fp_2op_p_zd_HSD<0b00110, "frintx">; + defm FRINTI_ZPmZ : sve_fp_2op_p_zd_HSD<0b00111, "frinti">; + defm FRECPX_ZPmZ : sve_fp_2op_p_zd_HSD<0b01100, "frecpx">; + defm FSQRT_ZPmZ : sve_fp_2op_p_zd_HSD<0b01101, "fsqrt">; + // InstAliases def : InstAlias<"mov $Zd, $Zn", (ORR_ZZZ ZPR64:$Zd, ZPR64:$Zn, ZPR64:$Zn), 1>; diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td index 4b3bd094836..33251c079ae 100644 --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -1018,7 +1018,12 @@ class sve_fp_2op_p_zd<bits<7> opc, string asm, RegisterOperand i_zprtype, let Constraints = "$Zd = $_Zd"; } - +multiclass sve_fp_2op_p_zd_HSD<bits<5> opc, string asm> { + def _H : sve_fp_2op_p_zd<{ 0b01, opc }, asm, ZPR16, ZPR16>; + def _S : sve_fp_2op_p_zd<{ 0b10, opc }, asm, ZPR32, ZPR32>; + def _D : sve_fp_2op_p_zd<{ 0b11, opc }, asm, ZPR64, ZPR64>; +} + //===----------------------------------------------------------------------===// // SVE Integer Arithmetic - Binary Predicated Group //===----------------------------------------------------------------------===// diff --git a/llvm/test/MC/AArch64/SVE/frecpx-diagnostics.s b/llvm/test/MC/AArch64/SVE/frecpx-diagnostics.s new file mode 100644 index 00000000000..1daf1dbf3d1 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frecpx-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frecpx z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frecpx z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frecpx z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frecpx z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frecpx z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frecpx z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frecpx.s b/llvm/test/MC/AArch64/SVE/frecpx.s new file mode 100644 index 00000000000..49226abc33b --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frecpx.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frecpx z31.h, p7/m, z31.h +// CHECK-INST: frecpx z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x4c,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 4c 65 <unknown> + +frecpx z31.s, p7/m, z31.s +// CHECK-INST: frecpx z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x8c,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 8c 65 <unknown> + +frecpx z31.d, p7/m, z31.d +// CHECK-INST: frecpx z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xcc,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf cc 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frinta-diagnostics.s b/llvm/test/MC/AArch64/SVE/frinta-diagnostics.s new file mode 100644 index 00000000000..f0d1bcb117e --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frinta-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frinta z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frinta z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frinta z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frinta z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frinta z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frinta z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frinta.s b/llvm/test/MC/AArch64/SVE/frinta.s new file mode 100644 index 00000000000..ea7a48a29b9 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frinta.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frinta z31.h, p7/m, z31.h +// CHECK-INST: frinta z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x44,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 44 65 <unknown> + +frinta z31.s, p7/m, z31.s +// CHECK-INST: frinta z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x84,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 84 65 <unknown> + +frinta z31.d, p7/m, z31.d +// CHECK-INST: frinta z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc4,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c4 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frinti-diagnostics.s b/llvm/test/MC/AArch64/SVE/frinti-diagnostics.s new file mode 100644 index 00000000000..8a0578a737b --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frinti-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frinti z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frinti z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frinti z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frinti z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frinti z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frinti z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frinti.s b/llvm/test/MC/AArch64/SVE/frinti.s new file mode 100644 index 00000000000..7fde35c4a18 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frinti.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frinti z31.h, p7/m, z31.h +// CHECK-INST: frinti z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x47,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 47 65 <unknown> + +frinti z31.s, p7/m, z31.s +// CHECK-INST: frinti z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x87,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 87 65 <unknown> + +frinti z31.d, p7/m, z31.d +// CHECK-INST: frinti z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc7,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c7 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frintm-diagnostics.s b/llvm/test/MC/AArch64/SVE/frintm-diagnostics.s new file mode 100644 index 00000000000..47b6661a373 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintm-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frintm z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frintm z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintm z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frintm z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintm z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frintm z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frintm.s b/llvm/test/MC/AArch64/SVE/frintm.s new file mode 100644 index 00000000000..b33e922bbd5 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintm.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frintm z31.h, p7/m, z31.h +// CHECK-INST: frintm z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x42,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 42 65 <unknown> + +frintm z31.s, p7/m, z31.s +// CHECK-INST: frintm z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x82,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 82 65 <unknown> + +frintm z31.d, p7/m, z31.d +// CHECK-INST: frintm z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc2,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c2 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frintn-diagnostics.s b/llvm/test/MC/AArch64/SVE/frintn-diagnostics.s new file mode 100644 index 00000000000..a34e4d43dc1 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintn-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frintn z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frintn z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintn z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frintn z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintn z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frintn z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frintn.s b/llvm/test/MC/AArch64/SVE/frintn.s new file mode 100644 index 00000000000..d19f8552064 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintn.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frintn z31.h, p7/m, z31.h +// CHECK-INST: frintn z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x40,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 40 65 <unknown> + +frintn z31.s, p7/m, z31.s +// CHECK-INST: frintn z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x80,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 80 65 <unknown> + +frintn z31.d, p7/m, z31.d +// CHECK-INST: frintn z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc0,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c0 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frintp-diagnostics.s b/llvm/test/MC/AArch64/SVE/frintp-diagnostics.s new file mode 100644 index 00000000000..ab4b2eb2458 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintp-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frintp z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frintp z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintp z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frintp z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintp z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frintp z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frintp.s b/llvm/test/MC/AArch64/SVE/frintp.s new file mode 100644 index 00000000000..12fce742c79 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintp.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frintp z31.h, p7/m, z31.h +// CHECK-INST: frintp z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x41,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 41 65 <unknown> + +frintp z31.s, p7/m, z31.s +// CHECK-INST: frintp z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x81,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 81 65 <unknown> + +frintp z31.d, p7/m, z31.d +// CHECK-INST: frintp z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc1,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c1 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frintx-diagnostics.s b/llvm/test/MC/AArch64/SVE/frintx-diagnostics.s new file mode 100644 index 00000000000..4d3edcb453b --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintx-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frintx z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frintx z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintx z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frintx z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintx z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frintx z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frintx.s b/llvm/test/MC/AArch64/SVE/frintx.s new file mode 100644 index 00000000000..b33f4281d3d --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintx.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frintx z31.h, p7/m, z31.h +// CHECK-INST: frintx z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x46,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 46 65 <unknown> + +frintx z31.s, p7/m, z31.s +// CHECK-INST: frintx z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x86,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 86 65 <unknown> + +frintx z31.d, p7/m, z31.d +// CHECK-INST: frintx z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc6,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c6 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/frintz-diagnostics.s b/llvm/test/MC/AArch64/SVE/frintz-diagnostics.s new file mode 100644 index 00000000000..7686d701969 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintz-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +frintz z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: frintz z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintz z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: frintz z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +frintz z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: frintz z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/frintz.s b/llvm/test/MC/AArch64/SVE/frintz.s new file mode 100644 index 00000000000..22e2aef98b8 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/frintz.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +frintz z31.h, p7/m, z31.h +// CHECK-INST: frintz z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x43,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 43 65 <unknown> + +frintz z31.s, p7/m, z31.s +// CHECK-INST: frintz z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x83,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 83 65 <unknown> + +frintz z31.d, p7/m, z31.d +// CHECK-INST: frintz z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xc3,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf c3 65 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/fsqrt-diagnostics.s b/llvm/test/MC/AArch64/SVE/fsqrt-diagnostics.s new file mode 100644 index 00000000000..c958f37a257 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/fsqrt-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +fsqrt z0.b, p0/m, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: fsqrt z0.b, p0/m, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +fsqrt z0.s, p0/z, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand +// CHECK-NEXT: fsqrt z0.s, p0/z, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +fsqrt z0.s, p8/m, z0.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7] +// CHECK-NEXT: fsqrt z0.s, p8/m, z0.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/fsqrt.s b/llvm/test/MC/AArch64/SVE/fsqrt.s new file mode 100644 index 00000000000..949faba227b --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/fsqrt.s @@ -0,0 +1,26 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +fsqrt z31.h, p7/m, z31.h +// CHECK-INST: fsqrt z31.h, p7/m, z31.h +// CHECK-ENCODING: [0xff,0xbf,0x4d,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 4d 65 <unknown> + +fsqrt z31.s, p7/m, z31.s +// CHECK-INST: fsqrt z31.s, p7/m, z31.s +// CHECK-ENCODING: [0xff,0xbf,0x8d,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf 8d 65 <unknown> + +fsqrt z31.d, p7/m, z31.d +// CHECK-INST: fsqrt z31.d, p7/m, z31.d +// CHECK-ENCODING: [0xff,0xbf,0xcd,0x65] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff bf cd 65 <unknown> |

