Skip to content

Commit 2c5208a

Browse files
authored
[LLVM][AARCH64] Add assembly/disassembly of zeroing convert instructions (#113292)
This patch adds the zeroing predicate forms (Pg/z) of the following instructions: - FCVTXNT - FCVTNT - FCVTLT - BFCVTNT As specified in https://developer.arm.com/documentation/ddi0602. Co-authored-by: Spencer Abson [[email protected]](mailto:[email protected])
1 parent a59f712 commit 2c5208a

20 files changed

+446
-4
lines changed

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4199,6 +4199,22 @@ defm TBXQ_ZZZ : sve2_int_perm_tbx<"tbxq", 0b10, int_aarch64_sve_tbxq>;
41994199
defm TBLQ_ZZZ : sve2p1_tblq<"tblq", int_aarch64_sve_tblq>;
42004200
} // End HasSVE2p1_or_HasSME2p1
42014201

4202+
4203+
//===----------------------------------------------------------------------===//
4204+
// SME2.2 or SVE2.2 instructions
4205+
//===----------------------------------------------------------------------===//
4206+
let Predicates = [HasSVE2p2orSME2p2] in {
4207+
// SVE2p2 floating-point convert precision down (placing odd), zeroing predicate
4208+
defm FCVTNT_ZPzZ : sve_fp_fcvtntz<"fcvtnt">;
4209+
def FCVTXNT_ZPzZ_DtoS : sve_fp_fcvt2z<0b0010, "fcvtxnt", ZPR32, ZPR64>;
4210+
4211+
// SVE2p2 floating-point convert precision up, zeroing predicate
4212+
defm FCVTLT_ZPzZ : sve_fp_fcvtltz<"fcvtlt">;
4213+
4214+
// SVE2p2 floating-point convert single-to-bf (placing odd), zeroing predicate
4215+
def BFCVTNT_ZPzZ : sve_fp_fcvt2z<0b1010, "bfcvtnt", ZPR16, ZPR32>;
4216+
} // End HasSME2p2orSVE2p2
4217+
42024218
//===----------------------------------------------------------------------===//
42034219
// SVE2 FP8 instructions
42044220
//===----------------------------------------------------------------------===//

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,37 @@ multiclass sve2_fp_convert_down_odd_rounding_top<string asm, string op> {
27352735
def : SVE_3_Op_Pat<nxv4f32, !cast<SDPatternOperator>(op # _f32f64), nxv4f32, nxv2i1, nxv2f64, !cast<Instruction>(NAME # _DtoS)>;
27362736
}
27372737

2738+
class sve_fp_fcvt2z<bits<4> opc, string asm, ZPRRegOp zprty1,
2739+
ZPRRegOp zprty2>
2740+
: I<(outs zprty1:$Zd), (ins PPR3bAny:$Pg, zprty2:$Zn),
2741+
asm, "\t$Zd, $Pg/z, $Zn",
2742+
"",
2743+
[]>, Sched<[]> {
2744+
bits<5> Zd;
2745+
bits<5> Zn;
2746+
bits<3> Pg;
2747+
let Inst{31-24} = 0b01100100;
2748+
let Inst{23-22} = opc{3-2};
2749+
let Inst{21-18} = 0b0000;
2750+
let Inst{17-16} = opc{1-0};
2751+
let Inst{15-13} = 0b101;
2752+
let Inst{12-10} = Pg;
2753+
let Inst{9-5} = Zn;
2754+
let Inst{4-0} = Zd;
2755+
let hasSideEffects = 0;
2756+
let mayRaiseFPException = 1;
2757+
}
2758+
2759+
multiclass sve_fp_fcvtntz<string asm> {
2760+
def _StoH : sve_fp_fcvt2z<0b1000, asm, ZPR16, ZPR32>;
2761+
def _DtoS : sve_fp_fcvt2z<0b1110, asm, ZPR32, ZPR64>;
2762+
}
2763+
2764+
multiclass sve_fp_fcvtltz<string asm> {
2765+
def _HtoS : sve_fp_fcvt2z<0b1001, asm, ZPR32, ZPR16>;
2766+
def _StoD : sve_fp_fcvt2z<0b1111, asm, ZPR64, ZPR32>;
2767+
}
2768+
27382769
//===----------------------------------------------------------------------===//
27392770
// SVE2 Floating Point Pairwise Group
27402771
//===----------------------------------------------------------------------===//

llvm/test/MC/AArch64/SVE/bfcvtnt-diagnostics.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bfcvtnt z0.h, p0/m, z1.h
1111
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
1212

1313
bfcvtnt z0.h, p0/z, z1.s
14-
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
14+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: sme2p2 or sve2p2
1515
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.s
1616
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
1717

llvm/test/MC/AArch64/SVE2/fcvtlt-diagnostics.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fcvtlt z0.q, p0/m, z0.d
3939
// Invalid predicate operation
4040

4141
fcvtlt z0.s, p0/z, z0.h
42-
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
42+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: sme2p2 or sve2p2
4343
// CHECK-NEXT: fcvtlt z0.s, p0/z, z0.h
4444
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
4545

llvm/test/MC/AArch64/SVE2/fcvtnt-diagnostics.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fcvtnt z0.d, p0/m, z0.q
3939
// Invalid predicate operation
4040

4141
fcvtnt z0.h, p0/z, z0.s
42-
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
42+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: sme2p2 or sve2p2
4343
// CHECK-NEXT: fcvtnt z0.h, p0/z, z0.s
4444
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
4545

llvm/test/MC/AArch64/SVE2/fcvtxnt-diagnostics.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fcvtxnt z0.d, p0/m, z0.q
4444
// Invalid predicate operation
4545

4646
fcvtxnt z0.s, p0/z, z0.d
47-
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
47+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: sme2p2 or sve2p2
4848
// CHECK-NEXT: fcvtxnt z0.s, p0/z, z0.d
4949
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
5050

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid element width
5+
6+
bfcvtnt z0.s, p0/z, z1.s
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8+
// CHECK-NEXT: bfcvtnt z0.s, p0/z, z1.s
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
bfcvtnt z0.d, p0/z, z1.d
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
13+
// CHECK-NEXT: bfcvtnt z0.d, p0/z, z1.d
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
bfcvtnt z0.h, p0/z, z1.h
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
18+
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.h
19+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20+
21+
bfcvtnt z0.h, p0/z, z1.d
22+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
23+
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.d
24+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25+
26+
bfcvtnt z0.h, p0/z, z1.q
27+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
28+
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.q
29+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}
30+
31+
// --------------------------------------------------------------------------//
32+
// Predicate not in restricted predicate range
33+
34+
bfcvtnt z0.h, p8/z, z1.s
35+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
36+
// CHECK-NEXT: bfcvtnt z0.h, p8/z, z1.s
37+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38+
39+
// --------------------------------------------------------------------------//
40+
// Negative tests for instructions that are incompatible with movprfx
41+
42+
movprfx z0.h, p0/m, z7.h
43+
bfcvtnt z0.h, p0/z, z1.s
44+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
45+
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.s
46+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
47+
48+
movprfx z0, z7
49+
bfcvtnt z0.h, p0/z, z1.s
50+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
51+
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.s
52+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2 < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5+
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6+
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %s \
8+
// RUN: | llvm-objdump -d --mattr=+sve2p2 - | FileCheck %s --check-prefix=CHECK-INST
9+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %s \
10+
// RUN: | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
12+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \
13+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
14+
// RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p2 -disassemble -show-encoding \
15+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
16+
17+
bfcvtnt z0.h, p0/z, z0.s // 01100100-10000010-10100000-00000000
18+
// CHECK-INST: bfcvtnt z0.h, p0/z, z0.s
19+
// CHECK-ENCODING: [0x00,0xa0,0x82,0x64]
20+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
21+
// CHECK-UNKNOWN: 6482a000 <unknown>
22+
23+
bfcvtnt z23.h, p3/z, z13.s // 01100100-10000010-10101101-10110111
24+
// CHECK-INST: bfcvtnt z23.h, p3/z, z13.s
25+
// CHECK-ENCODING: [0xb7,0xad,0x82,0x64]
26+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
27+
// CHECK-UNKNOWN: 6482adb7 <unknown>
28+
29+
bfcvtnt z31.h, p7/z, z31.s // 01100100-10000010-10111111-11111111
30+
// CHECK-INST: bfcvtnt z31.h, p7/z, z31.s
31+
// CHECK-ENCODING: [0xff,0xbf,0x82,0x64]
32+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
33+
// CHECK-UNKNOWN: 6482bfff <unknown>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s
2+
3+
.arch armv9-a+sve2p2
4+
.arch armv9-a+nosve2p2
5+
bfcvtnt z23.h, p3/z, z13.s
6+
// CHECK: error: instruction requires: sme2p2 or sve2p2
7+
// CHECK-NEXT: bfcvtnt z23.h, p3/z, z13.s
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s
2+
3+
.arch armv9-a+sve2p2
4+
bfcvtnt z23.h, p3/z, z13.s
5+
// CHECK: bfcvtnt z23.h, p3/z, z13.s
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s
2+
3+
.arch_extension sve2p2
4+
.arch_extension nosve2p2
5+
bfcvtnt z0.h, p0/z, z0.s
6+
// CHECK: error: instruction requires: sme2p2 or sve2p2
7+
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z0.s
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s
2+
3+
.arch_extension sve2p2
4+
bfcvtnt z0.h, p0/z, z0.s
5+
// CHECK: bfcvtnt z0.h, p0/z, z0.s
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s
2+
3+
.cpu generic+sve2p2
4+
.cpu generic+nosve2p2
5+
fcvtnt z0.s, p0/z, z0.d
6+
// CHECK: error: instruction requires: sme2p2 or sve2p2
7+
// CHECK-NEXT: fcvtnt z0.s, p0/z, z0.d
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s
2+
3+
.cpu generic+sve2p2
4+
fcvtnt z0.s, p0/z, z0.d
5+
// CHECK: fcvtnt z0.s, p0/z, z0.d
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid element width
5+
6+
fcvtlt z0.b, p0/z, z0.b
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8+
// CHECK-NEXT: fcvtlt z0.b, p0/z, z0.b
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
fcvtlt z0.h, p0/z, z0.h
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
13+
// CHECK-NEXT: fcvtlt z0.h, p0/z, z0.h
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
fcvtlt z0.s, p0/z, z0.s
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
18+
// CHECK-NEXT: fcvtlt z0.s, p0/z, z0.s
19+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20+
21+
fcvtlt z0.d, p0/z, z0.d
22+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
23+
// CHECK-NEXT: fcvtlt z0.d, p0/z, z0.d
24+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25+
26+
fcvtlt z0.h, p0/z, z0.b
27+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
28+
// CHECK-NEXT: fcvtlt z0.h, p0/z, z0.b
29+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30+
31+
fcvtlt z0.q, p0/z, z0.d
32+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
33+
// CHECK-NEXT: fcvtlt z0.q, p0/z, z0.d
34+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
35+
36+
// --------------------------------------------------------------------------//
37+
// Predicate not in restricted predicate range
38+
39+
fcvtlt z0.s, p8/z, z0.h
40+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
41+
// CHECK-NEXT: fcvtlt z0.s, p8/z, z0.h
42+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
43+
44+
// --------------------------------------------------------------------------//
45+
// Negative tests for instructions that are incompatible with movprfx
46+
47+
movprfx z0.s, p0/z, z7.s
48+
fcvtlt z0.s, p7/z, z1.h
49+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
50+
// CHECK-NEXT: fcvtlt z0.s, p7/z, z1.h
51+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
52+
53+
movprfx z0, z7
54+
fcvtlt z0.s, p7/z, z1.h
55+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
56+
// CHECK-NEXT: fcvtlt z0.s, p7/z, z1.h
57+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \
2+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2 < %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5+
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6+
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
7+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %s \
8+
// RUN: | llvm-objdump -d --mattr=+sve2p2 - | FileCheck %s --check-prefix=CHECK-INST
9+
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %s \
10+
// RUN: | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11+
// Disassemble encoding and check the re-encoding (-show-encoding) matches.
12+
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \
13+
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
14+
// RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p2 -disassemble -show-encoding \
15+
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
16+
17+
fcvtlt z0.d, p0/z, z0.s // 01100100-11000011-10100000-00000000
18+
// CHECK-INST: fcvtlt z0.d, p0/z, z0.s
19+
// CHECK-ENCODING: [0x00,0xa0,0xc3,0x64]
20+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
21+
// CHECK-UNKNOWN: 64c3a000 <unknown>
22+
23+
fcvtlt z23.d, p3/z, z13.s // 01100100-11000011-10101101-10110111
24+
// CHECK-INST: fcvtlt z23.d, p3/z, z13.s
25+
// CHECK-ENCODING: [0xb7,0xad,0xc3,0x64]
26+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
27+
// CHECK-UNKNOWN: 64c3adb7 <unknown>
28+
29+
fcvtlt z31.s, p7/z, z31.h // 01100100-10000001-10111111-11111111
30+
// CHECK-INST: fcvtlt z31.s, p7/z, z31.h
31+
// CHECK-ENCODING: [0xff,0xbf,0x81,0x64]
32+
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2
33+
// CHECK-UNKNOWN: 6481bfff <unknown>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid element width
5+
6+
fcvtnt z0.h, p0/z, z0.h
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8+
// CHECK-NEXT: fcvtnt z0.h, p0/z, z0.h
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
fcvtnt z0.s, p0/z, z0.s
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
13+
// CHECK-NEXT: fcvtnt z0.s, p0/z, z0.s
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
fcvtnt z0.d, p0/z, z0.q
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
18+
// CHECK-NEXT: fcvtnt z0.d, p0/z, z0.q
19+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20+
21+
// --------------------------------------------------------------------------//
22+
// Invalid operand for instruction
23+
24+
fcvtnt z0.b, p0/z, z0.h
25+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
26+
// CHECK-NEXT: fcvtnt z0.b, p0/z, z0.h
27+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
28+
29+
fcvtnt z0.b, p0/z, z0.b
30+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
31+
// CHECK-NEXT: fcvtnt z0.b, p0/z, z0.b
32+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33+
34+
// --------------------------------------------------------------------------//
35+
// Predicate not in restricted predicate range
36+
37+
fcvtnt z0.h, p8/z, z0.s
38+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
39+
// CHECK-NEXT: fcvtnt z0.h, p8/z, z0.s
40+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
41+
42+
// --------------------------------------------------------------------------//
43+
// Negative tests for instructions that are incompatible with movprfx
44+
45+
movprfx z0.s, p0/z, z7.s
46+
fcvtnt z0.s, p7/z, z1.d
47+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
48+
// CHECK-NEXT: fcvtnt z0.s, p7/z, z1.d
49+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
50+
51+
movprfx z0, z7
52+
fcvtnt z0.s, p7/z, z1.d
53+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
54+
// CHECK-NEXT: fcvtnt z0.s, p7/z, z1.d
55+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
56+

0 commit comments

Comments
 (0)