Skip to content

Commit 835c885

Browse files
authored
[llvm][AArch64][Assembly]: Add LUT assembly/disassembly. (llvm#70802)
This patch adds the feature flags of LUT and SME_LUTv2, and the assembly/disassembly for the following instructions of NEON, SVE2 and SME2: * NEON: - LUT2 - LUT4 * SVE2: - LUTI2_ZZZI - LUTI4_ZZZI - LUTI4_Z2ZZI * SME: - MOVT - LUTI4_4ZZT2Z - LUTI4_S_4ZZT2Z That is according to this documentation: https://developer.arm.com/documentation/ddi0602/2023-09
1 parent 033d2b7 commit 835c885

26 files changed

+761
-5
lines changed

llvm/include/llvm/TargetParser/AArch64TargetParser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ enum ArchExtKind : unsigned {
168168
AEK_SSVE_FP8DOT2 = 64, // FEAT_SSVE_FP8DOT2
169169
AEK_FP8DOT4 = 65, // FEAT_FP8DOT4
170170
AEK_SSVE_FP8DOT4 = 66, // FEAT_SSVE_FP8DOT4
171+
AEK_LUT = 67, // FEAT_LUT
172+
AEK_SME_LUTv2 = 68, // FEAT_SME_LUTv2
171173
AEK_NUM_EXTENSIONS
172174
};
173175
using ExtensionBitset = Bitset<AEK_NUM_EXTENSIONS>;
@@ -285,6 +287,8 @@ inline constexpr ExtensionInfo Extensions[] = {
285287
{"ssve-fp8dot2", AArch64::AEK_SSVE_FP8DOT2, "+ssve-fp8dot2", "-ssve-fp8dot2", FEAT_INIT, "+sme2", 0},
286288
{"fp8dot4", AArch64::AEK_FP8DOT4, "+fp8dot4", "-fp8dot4", FEAT_INIT, "", 0},
287289
{"ssve-fp8dot4", AArch64::AEK_SSVE_FP8DOT4, "+ssve-fp8dot4", "-ssve-fp8dot4", FEAT_INIT, "+sme2", 0},
290+
{"lut", AArch64::AEK_LUT, "+lut", "-lut", FEAT_INIT, "", 0},
291+
{"sme-lutv2", AArch64::AEK_SME_LUTv2, "+sme-lutv2", "-sme-lutv2", FEAT_INIT, "", 0},
288292
// Special cases
289293
{"none", AArch64::AEK_NONE, {}, {}, FEAT_INIT, "", ExtensionInfo::MaxFMVPriority},
290294
};

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ def FeatureFP8DOT4: SubtargetFeature<"fp8dot4", "HasFP8DOT4", "true",
534534

535535
def FeatureSSVE_FP8DOT4 : SubtargetFeature<"ssve-fp8dot4", "HasSSVE_FP8DOT4", "true",
536536
"Enable SVE2 fp8 4-way dot product instructions (FEAT_SSVE_FP8DOT4)", [FeatureSME2]>;
537+
def FeatureLUT: SubtargetFeature<"lut", "HasLUT", "true",
538+
"Enable Lookup Table instructions (FEAT_LUT)">;
539+
540+
def FeatureSME_LUTv2 : SubtargetFeature<"sme-lutv2", "HasSME_LUTv2", "true",
541+
"Enable Scalable Matrix Extension (SME) LUTv2 instructions (FEAT_SME_LUTv2)">;
537542

538543
def FeatureAppleA7SysReg : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
539544
"Apple A7 (the CPU formerly known as Cyclone)">;

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8119,6 +8119,54 @@ multiclass SIMDTableLookupTied<bit op, string asm> {
81198119
V128, VecListFour128>;
81208120
}
81218121

8122+
//----------------------------------------------------------------------------
8123+
// AdvSIMD LUT
8124+
//----------------------------------------------------------------------------
8125+
let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in
8126+
class BaseSIMDTableLookupIndexed<bit Q, bits<5> opc, RegisterOperand vectype,
8127+
RegisterOperand listtype, Operand idx_type,
8128+
string asm, string kind>
8129+
: I<(outs vectype:$Rd),
8130+
(ins listtype:$Rn, vectype:$Rm, idx_type:$idx),
8131+
asm, "\t$Rd" # kind # ", $Rn, $Rm$idx", "", []>,
8132+
Sched<[]> {
8133+
bits<5> Rd;
8134+
bits<5> Rn;
8135+
bits<5> Rm;
8136+
let Inst{31} = 0;
8137+
let Inst{30} = Q;
8138+
let Inst{29-24} = 0b001110;
8139+
let Inst{23-22} = opc{4-3};
8140+
let Inst{21} = 0;
8141+
let Inst{20-16} = Rm;
8142+
let Inst{15} = 0;
8143+
let Inst{14-12} = opc{2-0};
8144+
let Inst{11-10} = 0b00;
8145+
let Inst{9-5} = Rn;
8146+
let Inst{4-0} = Rd;
8147+
}
8148+
8149+
multiclass BaseSIMDTableLookupIndexed2<string asm> {
8150+
def v16f8 : BaseSIMDTableLookupIndexed<0b1, {0b10,?,?,0b1}, V128, VecListOne16b, VectorIndexS, asm, ".16b"> {
8151+
bits<2> idx;
8152+
let Inst{14-13} = idx;
8153+
}
8154+
def v8f16 : BaseSIMDTableLookupIndexed<0b1, {0b11,?,?,?}, V128, VecListOne8h, VectorIndexH, asm, ".8h" > {
8155+
bits<3> idx;
8156+
let Inst{14-12} = idx;
8157+
}
8158+
}
8159+
8160+
multiclass BaseSIMDTableLookupIndexed4<string asm> {
8161+
def v16f8 : BaseSIMDTableLookupIndexed<0b1, {0b01,?,0b10}, V128, VecListOne16b, VectorIndexD, asm, ".16b"> {
8162+
bit idx;
8163+
let Inst{14} = idx;
8164+
}
8165+
def v8f16 : BaseSIMDTableLookupIndexed<0b1, {0b01,?,?,0b1}, V128, VecListTwo8h, VectorIndexS, asm, ".8h" > {
8166+
bits<2> idx;
8167+
let Inst{14-13} = idx;
8168+
}
8169+
}
81228170

81238171
//----------------------------------------------------------------------------
81248172
// AdvSIMD scalar DUP

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ def HasSSVE_FP8DOT4 : Predicate<"Subtarget->hasSSVE_FP8DOT4() || "
187187
AssemblerPredicateWithAll<(any_of FeatureSSVE_FP8DOT4,
188188
(all_of FeatureSVE2, FeatureFP8DOT4)),
189189
"ssve-fp8dot4 or (sve2 and fp8dot4)">;
190+
def HasLUT : Predicate<"Subtarget->hasLUT()">,
191+
AssemblerPredicateWithAll<(all_of FeatureLUT), "lut">;
192+
def HasSME_LUTv2 : Predicate<"Subtarget->hasSME_LUTv2()">,
193+
AssemblerPredicateWithAll<(all_of FeatureSME_LUTv2), "sme-lutv2">;
190194

191195
// A subset of SVE(2) instructions are legal in Streaming SVE execution mode,
192196
// they should be enabled if either has been specified.
@@ -5964,6 +5968,13 @@ def : Pat<(v16i8 (int_aarch64_neon_tbx1 (v16i8 V128:$Rd),
59645968
(v16i8 V128:$Ri), (v16i8 V128:$Rn))),
59655969
(TBXv16i8One V128:$Rd, V128:$Ri, V128:$Rn)>;
59665970

5971+
//----------------------------------------------------------------------------
5972+
// AdvSIMD LUT instructions
5973+
//----------------------------------------------------------------------------
5974+
let Predicates = [HasLUT] in {
5975+
defm LUT2 : BaseSIMDTableLookupIndexed2<"luti2">;
5976+
defm LUT4 : BaseSIMDTableLookupIndexed4<"luti4">;
5977+
}
59675978

59685979
//----------------------------------------------------------------------------
59695980
// AdvSIMD scalar DUP instruction

llvm/lib/Target/AArch64/AArch64RegisterInfo.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,10 @@ class ZPRVectorListMul<int ElementWidth, int NumRegs> : ZPRVectorList<ElementWid
12681268

12691269
let EncoderMethod = "EncodeRegAsMultipleOf<2>",
12701270
DecoderMethod = "DecodeZPR2Mul2RegisterClass" in {
1271+
def ZZ_mul_r : RegisterOperand<ZPR2Mul2, "printTypedVectorList<0,0>"> {
1272+
let ParserMatchClass = ZPRVectorListMul<0, 2>;
1273+
}
1274+
12711275
def ZZ_b_mul_r : RegisterOperand<ZPR2Mul2, "printTypedVectorList<0,'b'>"> {
12721276
let ParserMatchClass = ZPRVectorListMul<8, 2>;
12731277
}

llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,3 +885,12 @@ defm FAMIN_2Z2Z : sme2_fp_sve_destructive_vector_vg2_multi<"famin", 0b0010101>;
885885
defm FAMAX_4Z4Z : sme2_fp_sve_destructive_vector_vg4_multi<"famax", 0b0010100>;
886886
defm FAMIN_4Z4Z : sme2_fp_sve_destructive_vector_vg4_multi<"famin", 0b0010101>;
887887
} //[HasSME2, HasFAMINMAX]
888+
889+
let Predicates = [HasSME2, HasSME_LUTv2] in {
890+
defm MOVT : sme2_movt_zt_to_zt<"movt", 0b0011111>;
891+
def LUTI4_4ZZT2Z : sme2_luti4_vector_vg4<0b00, 0b00,"luti4">;
892+
} //[HasSME2, HasSME_LUTv2]
893+
894+
let Predicates = [HasSME2p1, HasSME_LUTv2] in {
895+
def LUTI4_S_4ZZT2Z : sme2_luti4_vector_vg4_strided<0b00, 0b00, "luti4">;
896+
} //[HasSME2p1, HasSME_LUTv2]

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4081,3 +4081,12 @@ defm FDOT_ZZZI_BtoS : sve_float_dot_indexed<0b1, 0b01, ZPR8, ZPR3b8, "fdot",
40814081
// FP8 Widening Dot-Product - Group
40824082
defm FDOT_ZZZ_BtoS : sve_float_dot<0b1, 0b1, ZPR32, ZPR8, "fdot", nxv16i8, null_frag>;
40834083
}
4084+
4085+
let Predicates = [HasSVE2orSME2, HasLUT] in {
4086+
// LUTI2
4087+
defm LUTI2_ZZZI : sve2_luti2_vector_index<"luti2">;
4088+
// LUTI4
4089+
defm LUTI4_ZZZI : sve2_luti4_vector_index<"luti4">;
4090+
// LUTI4 (two contiguous registers)
4091+
defm LUTI4_Z2ZZI : sve2_luti4_vector_vg2_index<"luti4">;
4092+
} // End HasSVE2orSME2, HasLUT

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3658,6 +3658,8 @@ static const struct Extension {
36583658
{"ssve-fp8dot2", {AArch64::FeatureSSVE_FP8DOT2}},
36593659
{"fp8dot4", {AArch64::FeatureFP8DOT4}},
36603660
{"ssve-fp8dot4", {AArch64::FeatureSSVE_FP8DOT4}},
3661+
{"lut", {AArch64::FeatureLUT}},
3662+
{"sme-lutv2", {AArch64::FeatureSME_LUTv2}},
36613663
};
36623664

36633665
static void setRequiredFeatureString(FeatureBitset FBS, std::string &Str) {
@@ -4553,7 +4555,7 @@ ParseStatus AArch64AsmParser::tryParseZTOperand(OperandVector &Operands) {
45534555

45544556
Operands.push_back(AArch64Operand::CreateReg(
45554557
RegNum, RegKind::LookupTable, StartLoc, getLoc(), getContext()));
4556-
Lex(); // Eat identifier token.
4558+
Lex(); // Eat register.
45574559

45584560
// Check if register is followed by an index
45594561
if (parseOptionalToken(AsmToken::LBrac)) {
@@ -4565,12 +4567,14 @@ ParseStatus AArch64AsmParser::tryParseZTOperand(OperandVector &Operands) {
45654567
const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(ImmVal);
45664568
if (!MCE)
45674569
return TokError("immediate value expected for vector index");
4568-
if (parseToken(AsmToken::RBrac, "']' expected"))
4569-
return ParseStatus::Failure;
4570-
45714570
Operands.push_back(AArch64Operand::CreateImm(
45724571
MCConstantExpr::create(MCE->getValue(), getContext()), StartLoc,
45734572
getLoc(), getContext()));
4573+
if (parseOptionalToken(AsmToken::Comma))
4574+
if (parseOptionalMulOperand(Operands))
4575+
return MatchOperand_ParseFail;
4576+
if (parseToken(AsmToken::RBrac, "']' expected"))
4577+
return ParseStatus::Failure;
45744578
Operands.push_back(
45754579
AArch64Operand::CreateToken("]", getLoc(), getContext()));
45764580
}

llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,10 @@ template <unsigned NumLanes, char LaneKind>
17401740
void AArch64InstPrinter::printTypedVectorList(const MCInst *MI, unsigned OpNum,
17411741
const MCSubtargetInfo &STI,
17421742
raw_ostream &O) {
1743+
if (LaneKind == 0) {
1744+
printVectorList(MI, OpNum, STI, O, "");
1745+
return;
1746+
}
17431747
std::string Suffix(".");
17441748
if (NumLanes)
17451749
Suffix += itostr(NumLanes) + LaneKind;

llvm/lib/Target/AArch64/SMEInstrFormats.td

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,6 +3059,25 @@ class sme2_movt_scalar_to_zt<string mnemonic, bits<7> opc>
30593059
let Inst{4-0} = Rt;
30603060
}
30613061

3062+
// SME2 move vector to lookup table
3063+
class sme2_movt_zt_to_zt<string mnemonic, bits<7> opc>
3064+
: I<(outs ZTR:$ZTt), (ins sme_elm_idx0_3:$off2, ZPRAny:$Zt),
3065+
mnemonic, "\t$ZTt[$off2, mul vl], $Zt",
3066+
"", []>, Sched<[]> {
3067+
bits<5> Zt;
3068+
bits<2> off2;
3069+
let Inst{31-14} = 0b110000000100111100;
3070+
let Inst{13-12} = off2;
3071+
let Inst{11-5} = opc;
3072+
let Inst{4-0} = Zt;
3073+
}
3074+
3075+
multiclass sme2_movt_zt_to_zt<string mnemonic, bits<7> opc> {
3076+
def NAME : sme2_movt_zt_to_zt<mnemonic, opc>;
3077+
def : InstAlias<mnemonic # "\t$ZTt, $Zt",
3078+
(!cast<Instruction>(NAME) ZTR:$ZTt, 0, ZPRAny:$Zt), 1>;
3079+
}
3080+
30623081
//===----------------------------------------------------------------------===//
30633082
// SME2 lookup table expand one register
30643083
class sme2_luti_vector_index<bits<2> sz, bits<7> opc, RegisterOperand vector_ty,
@@ -4713,3 +4732,36 @@ class sme2p1_luti4_vector_vg4_index<bits<2> sz, RegisterOperand vector_ty,
47134732
multiclass sme2p1_luti4_vector_vg4_index<string mnemonic> {
47144733
def _H: sme2p1_luti4_vector_vg4_index<0b01, ZZZZ_h_strided, VectorIndexD, mnemonic>;
47154734
}
4735+
4736+
// SME2 lookup table two source registers expand to four contiguous destination registers
4737+
class sme2_luti4_vector_vg4<bits<2> sz, bits<2> op, string mnemonic>
4738+
: I<(outs ZZZZ_b_mul_r:$Zd), (ins ZTR:$ZTt, ZZ_mul_r:$Zn),
4739+
mnemonic, "\t$Zd, $ZTt, $Zn",
4740+
"", []>, Sched<[]> {
4741+
bits<4> Zn;
4742+
bits<3> Zd;
4743+
let Inst{31-14} = 0b110000001000101100;
4744+
let Inst{13-12} = sz;
4745+
let Inst{11-10} = op;
4746+
let Inst{9-6} = Zn;
4747+
let Inst{5} = 0b0;
4748+
let Inst{4-2} = Zd;
4749+
let Inst{1-0} = 0b00;
4750+
}
4751+
4752+
// SME2 lookup table two source registers expand to four non-contiguous destination registers
4753+
class sme2_luti4_vector_vg4_strided<bits<2> sz, bits<2> op, string mnemonic>
4754+
: I<(outs ZZZZ_b_strided:$Zd), (ins ZTR:$ZTt, ZZ_mul_r:$Zn),
4755+
mnemonic, "\t$Zd, $ZTt, $Zn",
4756+
"", []>, Sched<[]> {
4757+
bits<4> Zn;
4758+
bits<3> Zd;
4759+
let Inst{31-14} = 0b110000001001101100;
4760+
let Inst{13-12} = sz;
4761+
let Inst{11-10} = op;
4762+
let Inst{9-6} = Zn;
4763+
let Inst{5} = 0b0;
4764+
let Inst{4} = Zd{2};
4765+
let Inst{3-2} = 0b00;
4766+
let Inst{1-0} = Zd{1-0};
4767+
}

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10203,3 +10203,55 @@ multiclass sve2_fp8_dot_indexed<string mnemonic>{
1020310203
let Inst{10} = 0b1;
1020410204
}
1020510205
}
10206+
10207+
// FP8 Look up table
10208+
class sve2_lut_vector_index<ZPRRegOp zd_ty, RegisterOperand zn_ty,
10209+
Operand idx_ty, bits<4>opc, string mnemonic>
10210+
: I<(outs zd_ty:$Zd), (ins zn_ty:$Zn, ZPRAny:$Zm, idx_ty:$idx),
10211+
mnemonic, "\t$Zd, $Zn, $Zm$idx",
10212+
"", []>, Sched<[]> {
10213+
bits<5> Zd;
10214+
bits<5> Zn;
10215+
bits<5> Zm;
10216+
let Inst{31-24} = 0b01000101;
10217+
let Inst{22} = opc{3};
10218+
let Inst{21} = 0b1;
10219+
let Inst{20-16} = Zm;
10220+
let Inst{15-13} = 0b101;
10221+
let Inst{12-10} = opc{2-0};
10222+
let Inst{9-5} = Zn;
10223+
let Inst{4-0} = Zd;
10224+
}
10225+
10226+
// FP8 Look up table read with 2-bit indices
10227+
multiclass sve2_luti2_vector_index<string mnemonic> {
10228+
def _B : sve2_lut_vector_index<ZPR8, Z_b, VectorIndexS32b, {?, 0b100}, mnemonic> {
10229+
bits<2> idx;
10230+
let Inst{23-22} = idx;
10231+
}
10232+
def _H : sve2_lut_vector_index<ZPR16, Z_h, VectorIndexH32b, {?,?,0b10}, mnemonic> {
10233+
bits<3> idx;
10234+
let Inst{23-22} = idx{2-1};
10235+
let Inst{12} = idx{0};
10236+
}
10237+
}
10238+
10239+
// FP8 Look up table read with 4-bit indices
10240+
multiclass sve2_luti4_vector_index<string mnemonic> {
10241+
def _B : sve2_lut_vector_index<ZPR8, Z_b, VectorIndexD32b, 0b1001, mnemonic> {
10242+
bit idx;
10243+
let Inst{23} = idx;
10244+
}
10245+
def _H : sve2_lut_vector_index<ZPR16, Z_h, VectorIndexS32b, {?, 0b111}, mnemonic> {
10246+
bits<2> idx;
10247+
let Inst{23-22} = idx;
10248+
}
10249+
}
10250+
10251+
// FP8 Look up table read with 4-bit indices (two contiguous registers)
10252+
multiclass sve2_luti4_vector_vg2_index<string mnemonic> {
10253+
def _H : sve2_lut_vector_index<ZPR16, ZZ_h, VectorIndexS32b, {?, 0b101}, mnemonic> {
10254+
bits<2> idx;
10255+
let Inst{23-22} = idx;
10256+
}
10257+
}

llvm/test/MC/AArch64/FP8/directive-arch-negative.s

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,21 @@ fdot v31.4h, v0.8b, v0.8b
3535
fdot v0.2s, v0.8b, v31.8b
3636
// CHECK: error: instruction requires: fp8dot4
3737
// CHECK: fdot v0.2s, v0.8b, v31.8b
38+
39+
.arch armv9-a+lut
40+
.arch armv9-a+nolut
41+
luti2 v30.8h, { v20.8h }, v31[7]
42+
// CHECK: error: instruction requires: lut
43+
// CHECK: luti2 v30.8h, { v20.8h }, v31[7]
44+
45+
.arch armv9-a+sve2+lut
46+
.arch armv9-a+nosve2+nolut
47+
luti2 z0.h, { z0.h }, z0[0]
48+
// CHECK: error: instruction requires: lut sve2 or sme2
49+
// CHECK: luti2 z0.h, { z0.h }, z0[0]
50+
51+
.arch armv9-a+sme-lutv2
52+
.arch armv9-a+nosme-lutv2
53+
luti4 { z0.b - z3.b }, zt0, { z0, z1 }
54+
// CHECK: error: instruction requires: sme2 sme-lutv2
55+
// CHECK: luti4 { z0.b - z3.b }, zt0, { z0, z1 }

llvm/test/MC/AArch64/FP8/directive-arch.s

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,18 @@ fdot v31.4h, v0.8b, v0.8b
2929
fdot v0.2s, v0.8b, v31.8b
3030
// CHECK: fdot v0.2s, v0.8b, v31.8b
3131
.arch armv9-a+nofp8dot4
32+
33+
.arch armv9-a+lut
34+
luti2 v30.8h, {v20.8h}, v31[7]
35+
// CHECK: luti2 v30.8h, { v20.8h }, v31[7]
36+
.arch armv9-a+nolut
37+
38+
.arch armv9-a+sve2+lut
39+
luti2 z0.h, {z0.h}, z0[0]
40+
// CHECK: luti2 z0.h, { z0.h }, z0[0]
41+
.arch armv9-a+nosve2+nolut
42+
43+
.arch armv9-a+sme2p1+sme-lutv2
44+
luti4 {z0.b-z3.b}, zt0, {z0-z1}
45+
// CHECK: luti4 { z0.b - z3.b }, zt0, { z0, z1 }
46+
.arch armv9-a+nosme2p1+nosme-lutv2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+lut 2>&1 < %s| FileCheck %s
2+
3+
// --------------------------------------------------------------------------//
4+
// Invalid lane indices
5+
6+
luti2 v2.16b, {v1.16b}, v0[-1]
7+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
8+
// CHECK-NEXT: luti2 v2.16b, {v1.16b}, v0[-1]
9+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10+
11+
luti2 v3.16b, {v2.16b}, v1[4]
12+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
13+
// CHECK-NEXT: luti2 v3.16b, {v2.16b}, v1[4]
14+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15+
16+
luti2 v30.8h, {v21.8h}, v20[-1]
17+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 7].
18+
// CHECK-NEXT: luti2 v30.8h, {v21.8h}, v20[-1]
19+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20+
21+
luti2 v31.8h, {v31.8h}, v31[8]
22+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 7].
23+
// CHECK-NEXT: luti2 v31.8h, {v31.8h}, v31[8]
24+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25+
26+
// --------------------------------------------------------------------------//
27+
// Invalid vector suffix
28+
29+
luti2 v2.8h, {v1.16b}, v0[3]
30+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
31+
// CHECK-NEXT: luti2 v2.8h, {v1.16b}, v0[3]
32+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33+
34+
luti2 v31.16b, {v31.8h}, v31[7]
35+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
36+
// CHECK-NEXT: luti2 v31.16b, {v31.8h}, v31[7]
37+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)