Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 16f1820

Browse files
committed
[AArch64][SVE] Asm: Support for vector element compares (immediate).
Compare vector elements with a signed/unsigned immediate, e.g. cmpgt p0.s, p0/z, z0.s, #-16 cmphi p0.s, p0/z, z0.s, #127 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336081 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 529d733 commit 16f1820

22 files changed

+704
-0
lines changed

lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,17 @@ let Predicates = [HasSVE] in {
527527
defm CMPLO_WIDE_PPzZZ : sve_int_cmp_1_wide<0b110, "cmplo">;
528528
defm CMPLS_WIDE_PPzZZ : sve_int_cmp_1_wide<0b111, "cmpls">;
529529

530+
defm CMPGE_PPzZI : sve_int_scmp_vi<0b000, "cmpge">;
531+
defm CMPGT_PPzZI : sve_int_scmp_vi<0b001, "cmpgt">;
532+
defm CMPLT_PPzZI : sve_int_scmp_vi<0b010, "cmplt">;
533+
defm CMPLE_PPzZI : sve_int_scmp_vi<0b011, "cmple">;
534+
defm CMPEQ_PPzZI : sve_int_scmp_vi<0b100, "cmpeq">;
535+
defm CMPNE_PPzZI : sve_int_scmp_vi<0b101, "cmpne">;
536+
defm CMPHS_PPzZI : sve_int_ucmp_vi<0b00, "cmphs">;
537+
defm CMPHI_PPzZI : sve_int_ucmp_vi<0b01, "cmphi">;
538+
defm CMPLO_PPzZI : sve_int_ucmp_vi<0b10, "cmplo">;
539+
defm CMPLS_PPzZI : sve_int_ucmp_vi<0b11, "cmpls">;
540+
530541
defm SQINCB_XPiWdI : sve_int_pred_pattern_b_s32<0b00000, "sqincb">;
531542
defm UQINCB_WPiI : sve_int_pred_pattern_b_u32<0b00001, "uqincb">;
532543
defm SQDECB_XPiWdI : sve_int_pred_pattern_b_s32<0b00010, "sqdecb">;

lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,80 @@ multiclass sve_int_cmp_1_wide<bits<3> opc, string asm> {
10511051
def _S : sve_int_cmp<0b1, 0b10, opc, asm, PPR32, ZPR32, ZPR64>;
10521052
}
10531053

1054+
1055+
//===----------------------------------------------------------------------===//
1056+
// SVE Integer Compare - Signed Immediate Group
1057+
//===----------------------------------------------------------------------===//
1058+
1059+
class sve_int_scmp_vi<bits<2> sz8_64, bits<3> opc, string asm, PPRRegOp pprty,
1060+
ZPRRegOp zprty,
1061+
Operand immtype>
1062+
: I<(outs pprty:$Pd), (ins PPR3bAny:$Pg, zprty:$Zn, immtype:$imm5),
1063+
asm, "\t$Pd, $Pg/z, $Zn, $imm5",
1064+
"",
1065+
[]>, Sched<[]> {
1066+
bits<4> Pd;
1067+
bits<3> Pg;
1068+
bits<5> Zn;
1069+
bits<5> imm5;
1070+
let Inst{31-24} = 0b00100101;
1071+
let Inst{23-22} = sz8_64;
1072+
let Inst{21} = 0b0;
1073+
let Inst{20-16} = imm5;
1074+
let Inst{15} = opc{2};
1075+
let Inst{14} = 0b0;
1076+
let Inst{13} = opc{1};
1077+
let Inst{12-10} = Pg;
1078+
let Inst{9-5} = Zn;
1079+
let Inst{4} = opc{0};
1080+
let Inst{3-0} = Pd;
1081+
1082+
let Defs = [NZCV];
1083+
}
1084+
1085+
multiclass sve_int_scmp_vi<bits<3> opc, string asm> {
1086+
def _B : sve_int_scmp_vi<0b00, opc, asm, PPR8, ZPR8, simm5_32b>;
1087+
def _H : sve_int_scmp_vi<0b01, opc, asm, PPR16, ZPR16, simm5_32b>;
1088+
def _S : sve_int_scmp_vi<0b10, opc, asm, PPR32, ZPR32, simm5_32b>;
1089+
def _D : sve_int_scmp_vi<0b11, opc, asm, PPR64, ZPR64, simm5_64b>;
1090+
}
1091+
1092+
1093+
//===----------------------------------------------------------------------===//
1094+
// SVE Integer Compare - Unsigned Immediate Group
1095+
//===----------------------------------------------------------------------===//
1096+
1097+
class sve_int_ucmp_vi<bits<2> sz8_64, bits<2> opc, string asm, PPRRegOp pprty,
1098+
ZPRRegOp zprty, Operand immtype>
1099+
: I<(outs pprty:$Pd), (ins PPR3bAny:$Pg, zprty:$Zn, immtype:$imm7),
1100+
asm, "\t$Pd, $Pg/z, $Zn, $imm7",
1101+
"",
1102+
[]>, Sched<[]> {
1103+
bits<4> Pd;
1104+
bits<3> Pg;
1105+
bits<5> Zn;
1106+
bits<7> imm7;
1107+
let Inst{31-24} = 0b00100100;
1108+
let Inst{23-22} = sz8_64;
1109+
let Inst{21} = 1;
1110+
let Inst{20-14} = imm7;
1111+
let Inst{13} = opc{1};
1112+
let Inst{12-10} = Pg;
1113+
let Inst{9-5} = Zn;
1114+
let Inst{4} = opc{0};
1115+
let Inst{3-0} = Pd;
1116+
1117+
let Defs = [NZCV];
1118+
}
1119+
1120+
multiclass sve_int_ucmp_vi<bits<2> opc, string asm> {
1121+
def _B : sve_int_ucmp_vi<0b00, opc, asm, PPR8, ZPR8, imm0_127>;
1122+
def _H : sve_int_ucmp_vi<0b01, opc, asm, PPR16, ZPR16, imm0_127>;
1123+
def _S : sve_int_ucmp_vi<0b10, opc, asm, PPR32, ZPR32, imm0_127>;
1124+
def _D : sve_int_ucmp_vi<0b11, opc, asm, PPR64, ZPR64, imm0_127>;
1125+
}
1126+
1127+
10541128
//===----------------------------------------------------------------------===//
10551129
//SVE Index Generation Group
10561130
//===----------------------------------------------------------------------===//

test/MC/AArch64/SVE/cmpeq-diagnostics.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,17 @@ cmpeq p0.d, p0/z, z0.s, z0.s
6060
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
6161
// CHECK-NEXT: cmpeq p0.d, p0/z, z0.s, z0.s
6262
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63+
64+
65+
// --------------------------------------------------------------------------//
66+
// Invalid immediate range
67+
68+
cmpeq p0.s, p0/z, z0.s, #-17
69+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
70+
// CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, #-17
71+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72+
73+
cmpeq p0.s, p0/z, z0.s, #16
74+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
75+
// CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, #16
76+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

test/MC/AArch64/SVE/cmpeq.s

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,51 @@ cmpeq p0.s, p0/z, z0.s, z0.d
4949
// CHECK-ENCODING: [0x00,0x20,0x80,0x24]
5050
// CHECK-ERROR: instruction requires: sve
5151
// CHECK-UNKNOWN: 00 20 80 24 <unknown>
52+
53+
cmpeq p0.b, p0/z, z0.b, #-16
54+
// CHECK-INST: cmpeq p0.b, p0/z, z0.b, #-16
55+
// CHECK-ENCODING: [0x00,0x80,0x10,0x25]
56+
// CHECK-ERROR: instruction requires: sve
57+
// CHECK-UNKNOWN: 00 80 10 25 <unknown>
58+
59+
cmpeq p0.h, p0/z, z0.h, #-16
60+
// CHECK-INST: cmpeq p0.h, p0/z, z0.h, #-16
61+
// CHECK-ENCODING: [0x00,0x80,0x50,0x25]
62+
// CHECK-ERROR: instruction requires: sve
63+
// CHECK-UNKNOWN: 00 80 50 25 <unknown>
64+
65+
cmpeq p0.s, p0/z, z0.s, #-16
66+
// CHECK-INST: cmpeq p0.s, p0/z, z0.s, #-16
67+
// CHECK-ENCODING: [0x00,0x80,0x90,0x25]
68+
// CHECK-ERROR: instruction requires: sve
69+
// CHECK-UNKNOWN: 00 80 90 25 <unknown>
70+
71+
cmpeq p0.d, p0/z, z0.d, #-16
72+
// CHECK-INST: cmpeq p0.d, p0/z, z0.d, #-16
73+
// CHECK-ENCODING: [0x00,0x80,0xd0,0x25]
74+
// CHECK-ERROR: instruction requires: sve
75+
// CHECK-UNKNOWN: 00 80 d0 25 <unknown>
76+
77+
cmpeq p0.b, p0/z, z0.b, #15
78+
// CHECK-INST: cmpeq p0.b, p0/z, z0.b, #15
79+
// CHECK-ENCODING: [0x00,0x80,0x0f,0x25]
80+
// CHECK-ERROR: instruction requires: sve
81+
// CHECK-UNKNOWN: 00 80 0f 25 <unknown>
82+
83+
cmpeq p0.h, p0/z, z0.h, #15
84+
// CHECK-INST: cmpeq p0.h, p0/z, z0.h, #15
85+
// CHECK-ENCODING: [0x00,0x80,0x4f,0x25]
86+
// CHECK-ERROR: instruction requires: sve
87+
// CHECK-UNKNOWN: 00 80 4f 25 <unknown>
88+
89+
cmpeq p0.s, p0/z, z0.s, #15
90+
// CHECK-INST: cmpeq p0.s, p0/z, z0.s, #15
91+
// CHECK-ENCODING: [0x00,0x80,0x8f,0x25]
92+
// CHECK-ERROR: instruction requires: sve
93+
// CHECK-UNKNOWN: 00 80 8f 25 <unknown>
94+
95+
cmpeq p0.d, p0/z, z0.d, #15
96+
// CHECK-INST: cmpeq p0.d, p0/z, z0.d, #15
97+
// CHECK-ENCODING: [0x00,0x80,0xcf,0x25]
98+
// CHECK-ERROR: instruction requires: sve
99+
// CHECK-UNKNOWN: 00 80 cf 25 <unknown>

test/MC/AArch64/SVE/cmpge-diagnostics.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,17 @@ cmpge p0.d, p0/z, z0.s, z0.s
6060
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
6161
// CHECK-NEXT: cmpge p0.d, p0/z, z0.s, z0.s
6262
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63+
64+
65+
// --------------------------------------------------------------------------//
66+
// Invalid immediate range
67+
68+
cmpge p0.s, p0/z, z0.s, #-17
69+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
70+
// CHECK-NEXT: cmpge p0.s, p0/z, z0.s, #-17
71+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72+
73+
cmpge p0.s, p0/z, z0.s, #16
74+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
75+
// CHECK-NEXT: cmpge p0.s, p0/z, z0.s, #16
76+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

test/MC/AArch64/SVE/cmpge.s

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,51 @@ cmpge p0.s, p0/z, z0.s, z0.d
4848
// CHECK-ENCODING: [0x00,0x40,0x80,0x24]
4949
// CHECK-ERROR: instruction requires: sve
5050
// CHECK-UNKNOWN: 00 40 80 24 <unknown>
51+
52+
cmpge p0.b, p0/z, z0.b, #-16
53+
// CHECK-INST: cmpge p0.b, p0/z, z0.b, #-16
54+
// CHECK-ENCODING: [0x00,0x00,0x10,0x25]
55+
// CHECK-ERROR: instruction requires: sve
56+
// CHECK-UNKNOWN: 00 00 10 25 <unknown>
57+
58+
cmpge p0.h, p0/z, z0.h, #-16
59+
// CHECK-INST: cmpge p0.h, p0/z, z0.h, #-16
60+
// CHECK-ENCODING: [0x00,0x00,0x50,0x25]
61+
// CHECK-ERROR: instruction requires: sve
62+
// CHECK-UNKNOWN: 00 00 50 25 <unknown>
63+
64+
cmpge p0.s, p0/z, z0.s, #-16
65+
// CHECK-INST: cmpge p0.s, p0/z, z0.s, #-16
66+
// CHECK-ENCODING: [0x00,0x00,0x90,0x25]
67+
// CHECK-ERROR: instruction requires: sve
68+
// CHECK-UNKNOWN: 00 00 90 25 <unknown>
69+
70+
cmpge p0.d, p0/z, z0.d, #-16
71+
// CHECK-INST: cmpge p0.d, p0/z, z0.d, #-16
72+
// CHECK-ENCODING: [0x00,0x00,0xd0,0x25]
73+
// CHECK-ERROR: instruction requires: sve
74+
// CHECK-UNKNOWN: 00 00 d0 25 <unknown>
75+
76+
cmpge p0.b, p0/z, z0.b, #15
77+
// CHECK-INST: cmpge p0.b, p0/z, z0.b, #15
78+
// CHECK-ENCODING: [0x00,0x00,0x0f,0x25]
79+
// CHECK-ERROR: instruction requires: sve
80+
// CHECK-UNKNOWN: 00 00 0f 25 <unknown>
81+
82+
cmpge p0.h, p0/z, z0.h, #15
83+
// CHECK-INST: cmpge p0.h, p0/z, z0.h, #15
84+
// CHECK-ENCODING: [0x00,0x00,0x4f,0x25]
85+
// CHECK-ERROR: instruction requires: sve
86+
// CHECK-UNKNOWN: 00 00 4f 25 <unknown>
87+
88+
cmpge p0.s, p0/z, z0.s, #15
89+
// CHECK-INST: cmpge p0.s, p0/z, z0.s, #15
90+
// CHECK-ENCODING: [0x00,0x00,0x8f,0x25]
91+
// CHECK-ERROR: instruction requires: sve
92+
// CHECK-UNKNOWN: 00 00 8f 25 <unknown>
93+
94+
cmpge p0.d, p0/z, z0.d, #15
95+
// CHECK-INST: cmpge p0.d, p0/z, z0.d, #15
96+
// CHECK-ENCODING: [0x00,0x00,0xcf,0x25]
97+
// CHECK-ERROR: instruction requires: sve
98+
// CHECK-UNKNOWN: 00 00 cf 25 <unknown>

test/MC/AArch64/SVE/cmpgt-diagnostics.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,17 @@ cmpgt p0.d, p0/z, z0.s, z0.s
6060
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
6161
// CHECK-NEXT: cmpgt p0.d, p0/z, z0.s, z0.s
6262
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63+
64+
65+
// --------------------------------------------------------------------------//
66+
// Invalid immediate range
67+
68+
cmpgt p0.s, p0/z, z0.s, #-17
69+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
70+
// CHECK-NEXT: cmpgt p0.s, p0/z, z0.s, #-17
71+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72+
73+
cmpgt p0.s, p0/z, z0.s, #16
74+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
75+
// CHECK-NEXT: cmpgt p0.s, p0/z, z0.s, #16
76+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

test/MC/AArch64/SVE/cmpgt.s

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,51 @@ cmpgt p0.s, p0/z, z0.s, z0.d
4949
// CHECK-ENCODING: [0x10,0x40,0x80,0x24]
5050
// CHECK-ERROR: instruction requires: sve
5151
// CHECK-UNKNOWN: 10 40 80 24 <unknown>
52+
53+
cmpgt p0.b, p0/z, z0.b, #-16
54+
// CHECK-INST: cmpgt p0.b, p0/z, z0.b, #-16
55+
// CHECK-ENCODING: [0x10,0x00,0x10,0x25]
56+
// CHECK-ERROR: instruction requires: sve
57+
// CHECK-UNKNOWN: 10 00 10 25 <unknown>
58+
59+
cmpgt p0.h, p0/z, z0.h, #-16
60+
// CHECK-INST: cmpgt p0.h, p0/z, z0.h, #-16
61+
// CHECK-ENCODING: [0x10,0x00,0x50,0x25]
62+
// CHECK-ERROR: instruction requires: sve
63+
// CHECK-UNKNOWN: 10 00 50 25 <unknown>
64+
65+
cmpgt p0.s, p0/z, z0.s, #-16
66+
// CHECK-INST: cmpgt p0.s, p0/z, z0.s, #-16
67+
// CHECK-ENCODING: [0x10,0x00,0x90,0x25]
68+
// CHECK-ERROR: instruction requires: sve
69+
// CHECK-UNKNOWN: 10 00 90 25 <unknown>
70+
71+
cmpgt p0.d, p0/z, z0.d, #-16
72+
// CHECK-INST: cmpgt p0.d, p0/z, z0.d, #-16
73+
// CHECK-ENCODING: [0x10,0x00,0xd0,0x25]
74+
// CHECK-ERROR: instruction requires: sve
75+
// CHECK-UNKNOWN: 10 00 d0 25 <unknown>
76+
77+
cmpgt p0.b, p0/z, z0.b, #15
78+
// CHECK-INST: cmpgt p0.b, p0/z, z0.b, #15
79+
// CHECK-ENCODING: [0x10,0x00,0x0f,0x25]
80+
// CHECK-ERROR: instruction requires: sve
81+
// CHECK-UNKNOWN: 10 00 0f 25 <unknown>
82+
83+
cmpgt p0.h, p0/z, z0.h, #15
84+
// CHECK-INST: cmpgt p0.h, p0/z, z0.h, #15
85+
// CHECK-ENCODING: [0x10,0x00,0x4f,0x25]
86+
// CHECK-ERROR: instruction requires: sve
87+
// CHECK-UNKNOWN: 10 00 4f 25 <unknown>
88+
89+
cmpgt p0.s, p0/z, z0.s, #15
90+
// CHECK-INST: cmpgt p0.s, p0/z, z0.s, #15
91+
// CHECK-ENCODING: [0x10,0x00,0x8f,0x25]
92+
// CHECK-ERROR: instruction requires: sve
93+
// CHECK-UNKNOWN: 10 00 8f 25 <unknown>
94+
95+
cmpgt p0.d, p0/z, z0.d, #15
96+
// CHECK-INST: cmpgt p0.d, p0/z, z0.d, #15
97+
// CHECK-ENCODING: [0x10,0x00,0xcf,0x25]
98+
// CHECK-ERROR: instruction requires: sve
99+
// CHECK-UNKNOWN: 10 00 cf 25 <unknown>

test/MC/AArch64/SVE/cmphi-diagnostics.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,17 @@ cmphi p0.d, p0/z, z0.s, z0.s
6060
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
6161
// CHECK-NEXT: cmphi p0.d, p0/z, z0.s, z0.s
6262
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63+
64+
65+
// --------------------------------------------------------------------------//
66+
// Invalid immediate range
67+
68+
cmphi p0.s, p0/z, z0.s, #-1
69+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 127].
70+
// CHECK-NEXT: cmphi p0.s, p0/z, z0.s, #-1
71+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72+
73+
cmphi p0.s, p0/z, z0.s, #128
74+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 127].
75+
// CHECK-NEXT: cmphi p0.s, p0/z, z0.s, #128
76+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

test/MC/AArch64/SVE/cmphi.s

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,51 @@ cmphi p0.s, p0/z, z0.s, z0.d
4949
// CHECK-ENCODING: [0x10,0xc0,0x80,0x24]
5050
// CHECK-ERROR: instruction requires: sve
5151
// CHECK-UNKNOWN: 10 c0 80 24 <unknown>
52+
53+
cmphi p0.b, p0/z, z0.b, #0
54+
// CHECK-INST: cmphi p0.b, p0/z, z0.b, #0
55+
// CHECK-ENCODING: [0x10,0x00,0x20,0x24]
56+
// CHECK-ERROR: instruction requires: sve
57+
// CHECK-UNKNOWN: 10 00 20 24 <unknown>
58+
59+
cmphi p0.h, p0/z, z0.h, #0
60+
// CHECK-INST: cmphi p0.h, p0/z, z0.h, #0
61+
// CHECK-ENCODING: [0x10,0x00,0x60,0x24]
62+
// CHECK-ERROR: instruction requires: sve
63+
// CHECK-UNKNOWN: 10 00 60 24 <unknown>
64+
65+
cmphi p0.s, p0/z, z0.s, #0
66+
// CHECK-INST: cmphi p0.s, p0/z, z0.s, #0
67+
// CHECK-ENCODING: [0x10,0x00,0xa0,0x24]
68+
// CHECK-ERROR: instruction requires: sve
69+
// CHECK-UNKNOWN: 10 00 a0 24 <unknown>
70+
71+
cmphi p0.d, p0/z, z0.d, #0
72+
// CHECK-INST: cmphi p0.d, p0/z, z0.d, #0
73+
// CHECK-ENCODING: [0x10,0x00,0xe0,0x24]
74+
// CHECK-ERROR: instruction requires: sve
75+
// CHECK-UNKNOWN: 10 00 e0 24 <unknown>
76+
77+
cmphi p0.b, p0/z, z0.b, #127
78+
// CHECK-INST: cmphi p0.b, p0/z, z0.b, #127
79+
// CHECK-ENCODING: [0x10,0xc0,0x3f,0x24]
80+
// CHECK-ERROR: instruction requires: sve
81+
// CHECK-UNKNOWN: 10 c0 3f 24 <unknown>
82+
83+
cmphi p0.h, p0/z, z0.h, #127
84+
// CHECK-INST: cmphi p0.h, p0/z, z0.h, #127
85+
// CHECK-ENCODING: [0x10,0xc0,0x7f,0x24]
86+
// CHECK-ERROR: instruction requires: sve
87+
// CHECK-UNKNOWN: 10 c0 7f 24 <unknown>
88+
89+
cmphi p0.s, p0/z, z0.s, #127
90+
// CHECK-INST: cmphi p0.s, p0/z, z0.s, #127
91+
// CHECK-ENCODING: [0x10,0xc0,0xbf,0x24]
92+
// CHECK-ERROR: instruction requires: sve
93+
// CHECK-UNKNOWN: 10 c0 bf 24 <unknown>
94+
95+
cmphi p0.d, p0/z, z0.d, #127
96+
// CHECK-INST: cmphi p0.d, p0/z, z0.d, #127
97+
// CHECK-ENCODING: [0x10,0xc0,0xff,0x24]
98+
// CHECK-ERROR: instruction requires: sve
99+
// CHECK-UNKNOWN: 10 c0 ff 24 <unknown>

test/MC/AArch64/SVE/cmphs-diagnostics.s

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,16 @@ cmphs p0.d, p0/z, z0.s, z0.s
6161
// CHECK-NEXT: cmphs p0.d, p0/z, z0.s, z0.s
6262
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
6363

64+
65+
// --------------------------------------------------------------------------//
66+
// Invalid immediate range
67+
68+
cmphs p0.s, p0/z, z0.s, #-1
69+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 127].
70+
// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, #-1
71+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72+
73+
cmphs p0.s, p0/z, z0.s, #128
74+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 127].
75+
// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, #128
76+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)