diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp --- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp @@ -63,7 +63,7 @@ Ext == "zbs" || Ext == "zbt" || Ext == "zbproposedc") return RISCVExtensionVersion{"0", "92"}; if (Ext == "v") - return RISCVExtensionVersion{"0", "8"}; + return RISCVExtensionVersion{"0", "9"}; return None; } diff --git a/clang/test/Driver/riscv-arch.c b/clang/test/Driver/riscv-arch.c --- a/clang/test/Driver/riscv-arch.c +++ b/clang/test/Driver/riscv-arch.c @@ -376,6 +376,6 @@ // RV32-EXPERIMENTAL-V-BADVERS: error: invalid arch name 'rv32iv0p1' // RV32-EXPERIMENTAL-V-BADVERS: unsupported version number 0.1 for experimental extension -// RUN: %clang -target riscv32-unknown-elf -march=rv32iv0p8 -menable-experimental-extensions -### %s \ +// RUN: %clang -target riscv32-unknown-elf -march=rv32iv0p9 -menable-experimental-extensions -### %s \ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-V-GOODVERS %s // RV32-EXPERIMENTAL-V-GOODVERS: "-target-feature" "+experimental-v" diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp --- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp +++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp @@ -288,11 +288,21 @@ SEW_1024, }; - enum class VLMUL { LMUL_1 = 0, LMUL_2, LMUL_4, LMUL_8 }; + enum class VLMUL { + LMUL_1 = 0, + LMUL_2, + LMUL_4, + LMUL_8, + LMUL_F8 = 5, + LMUL_F4 = 6, + LMUL_F2 = 7 + }; struct VTypeOp { VSEW Sew; VLMUL Lmul; + bool TailAgnostic; + bool MaskedoffAgnostic; unsigned Encoding; }; @@ -775,6 +785,12 @@ return "m4"; case VLMUL::LMUL_8: return "m8"; + case VLMUL::LMUL_F2: + return "mf2"; + case VLMUL::LMUL_F4: + return "mf4"; + case VLMUL::LMUL_F8: + return "mf8"; } } @@ -850,15 +866,31 @@ return Op; } - static std::unique_ptr createVType(APInt Sew, APInt Lmul, - SMLoc S, bool IsRV64) { + static std::unique_ptr + createVType(APInt Sew, APInt Lmul, bool Fractional, bool TailAgnostic, + bool MaskedoffAgnostic, SMLoc S, bool IsRV64) { auto Op = std::make_unique(KindTy::VType); Sew.ashrInPlace(3); unsigned SewLog2 = Sew.logBase2(); unsigned LmulLog2 = Lmul.logBase2(); Op->VType.Sew = static_cast(SewLog2); - Op->VType.Lmul = static_cast(LmulLog2); - Op->VType.Encoding = (SewLog2 << 2) | LmulLog2; + if (Fractional) { + unsigned Flmul = 8 - LmulLog2; + Op->VType.Lmul = static_cast(Flmul); + Op->VType.Encoding = + ((Flmul & 0x4) << 3) | ((SewLog2 & 0x7) << 2) | (Flmul & 0x3); + } else { + Op->VType.Lmul = static_cast(LmulLog2); + Op->VType.Encoding = (SewLog2 << 2) | LmulLog2; + } + if (TailAgnostic) { + Op->VType.Encoding |= 0x40; + } + if (MaskedoffAgnostic) { + Op->VType.Encoding |= 0x80; + } + Op->VType.TailAgnostic = TailAgnostic; + Op->VType.MaskedoffAgnostic = MaskedoffAgnostic; Op->StartLoc = S; Op->IsRV64 = IsRV64; return Op; @@ -1178,8 +1210,10 @@ } case Match_InvalidVTypeI: { SMLoc ErrorLoc = ((RISCVOperand &)*Operands[ErrorInfo]).getStartLoc(); - return Error(ErrorLoc, - "operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8]"); + return Error( + ErrorLoc, + "operand must be " + "e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu]"); } case Match_InvalidVMaskRegister: { SMLoc ErrorLoc = ((RISCVOperand &)*Operands[ErrorInfo]).getStartLoc(); @@ -1557,8 +1591,8 @@ getLexer().Lex(); if (getLexer().getKind() == AsmToken::EndOfStatement) { - Operands.push_back( - RISCVOperand::createVType(Sew, APInt(16, 1), S, isRV64())); + Operands.push_back(RISCVOperand::createVType(Sew, APInt(16, 1), false, + false, false, S, isRV64())); return MatchOperand_Success; } @@ -1570,15 +1604,63 @@ Name = getLexer().getTok().getIdentifier(); if (!Name.consume_front("m")) return MatchOperand_NoMatch; + // "m" or "mf" + bool Fractional = false; + if (Name.consume_front("f")) { + Fractional = true; + } APInt Lmul(16, Name, 10); if (Lmul != 1 && Lmul != 2 && Lmul != 4 && Lmul != 8) return MatchOperand_NoMatch; getLexer().Lex(); + if (getLexer().getKind() == AsmToken::EndOfStatement) { + Operands.push_back(RISCVOperand::createVType(Sew, Lmul, Fractional, false, + false, S, isRV64())); + return MatchOperand_Success; + } + + if (!getLexer().is(AsmToken::Comma)) + return MatchOperand_NoMatch; + getLexer().Lex(); + + Name = getLexer().getTok().getIdentifier(); + // ta or tu + bool TailAgnostic = false; + if (Name.consume_front("ta")) + TailAgnostic = true; + else if (Name.consume_front("tu")) + TailAgnostic = false; + else + return MatchOperand_NoMatch; + getLexer().Lex(); + + if (getLexer().getKind() == AsmToken::EndOfStatement) { + Operands.push_back(RISCVOperand::createVType( + Sew, Lmul, Fractional, TailAgnostic, false, S, isRV64())); + return MatchOperand_Success; + } + + if (!getLexer().is(AsmToken::Comma)) + return MatchOperand_NoMatch; + getLexer().Lex(); + + Name = getLexer().getTok().getIdentifier(); + // ma or mu + bool MaskedoffAgnostic = false; + if (Name.consume_front("ma")) + MaskedoffAgnostic = true; + else if (Name.consume_front("mu")) + MaskedoffAgnostic = false; + else + return MatchOperand_NoMatch; + getLexer().Lex(); + if (getLexer().getKind() != AsmToken::EndOfStatement) return MatchOperand_NoMatch; - Operands.push_back(RISCVOperand::createVType(Sew, Lmul, S, isRV64())); + Operands.push_back(RISCVOperand::createVType( + Sew, Lmul, Fractional, TailAgnostic, MaskedoffAgnostic, S, isRV64())); return MatchOperand_Success; } @@ -2288,26 +2370,12 @@ if (DestReg == Src2Reg) return Error(Loc, "The destination vector register group cannot overlap" " the source vector register group."); - if (TargetFlags == RISCV::WidenV) { - // Assume DestReg LMUL is 2 at least for widening/narrowing operations. - if (DestReg + 1 == Src2Reg) - return Error(Loc, - "The destination vector register group cannot overlap" - " the source vector register group."); - } } if (Inst.getOperand(2).isReg()) { unsigned Src1Reg = Inst.getOperand(2).getReg(); if (DestReg == Src1Reg) return Error(Loc, "The destination vector register group cannot overlap" " the source vector register group."); - if (TargetFlags == RISCV::WidenV || TargetFlags == RISCV::WidenW) { - // Assume DestReg LMUL is 2 at least for widening/narrowing operations. - if (DestReg + 1 == Src1Reg) - return Error(Loc, - "The destination vector register group cannot overlap" - " the source vector register group."); - } } if (Inst.getNumOperands() == 4) { unsigned MaskReg = Inst.getOperand(3).getReg(); @@ -2321,28 +2389,12 @@ if (DestReg == Src2Reg) return Error(Loc, "The destination vector register group cannot overlap" " the source vector register group."); - // Assume Src2Reg LMUL is 2 at least for widening/narrowing operations. - if (DestReg == Src2Reg + 1) - return Error(Loc, "The destination vector register group cannot overlap" - " the source vector register group."); } else if (TargetFlags == RISCV::WidenCvt || TargetFlags == RISCV::NarrowCvt || TargetFlags == RISCV::Iota) { unsigned Src2Reg = Inst.getOperand(1).getReg(); if (DestReg == Src2Reg) return Error(Loc, "The destination vector register group cannot overlap" " the source vector register group."); - if (TargetFlags == RISCV::WidenCvt) { - // Assume DestReg LMUL is 2 at least for widening/narrowing operations. - if (DestReg + 1 == Src2Reg) - return Error(Loc, "The destination vector register group cannot overlap" - " the source vector register group."); - } - if (TargetFlags == RISCV::NarrowCvt) { - // Assume Src2Reg LMUL is 2 at least for widening/narrowing operations. - if (DestReg == Src2Reg + 1) - return Error(Loc, "The destination vector register group cannot overlap" - " the source vector register group."); - } if (Inst.getNumOperands() == 3) { unsigned MaskReg = Inst.getOperand(2).getReg(); diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp @@ -155,10 +155,30 @@ unsigned Imm = MI->getOperand(OpNo).getImm(); unsigned Sew = (Imm >> 2) & 0x7; unsigned Lmul = Imm & 0x3; + bool Fractional = (Imm >> 5) & 0x1; - Lmul = 0x1 << Lmul; Sew = 0x1 << (Sew + 3); - O << "e" << Sew << ",m" << Lmul; + O << "e" << Sew; + if (Fractional) { + Lmul = 4 - Lmul; + Lmul = 0x1 << Lmul; + O << ",mf" << Lmul; + } else { + Lmul = 0x1 << Lmul; + O << ",m" << Lmul; + } + bool TailAgnostic = Imm & 0x40; + bool MaskedoffAgnostic = Imm & 0x80; + if (TailAgnostic || MaskedoffAgnostic) { + if (TailAgnostic) + O << ",ta"; + else + O << ",tu"; + if (MaskedoffAgnostic) + O << ",ma"; + else + O << ",mu"; + } } void RISCVInstPrinter::printVMaskReg(const MCInst *MI, unsigned OpNo, diff --git a/llvm/lib/Target/RISCV/RISCVInstrFormatsV.td b/llvm/lib/Target/RISCV/RISCVInstrFormatsV.td --- a/llvm/lib/Target/RISCV/RISCVInstrFormatsV.td +++ b/llvm/lib/Target/RISCV/RISCVInstrFormatsV.td @@ -21,20 +21,17 @@ def OPFVF : RISCVVFormat<0b101>; def OPMVX : RISCVVFormat<0b110>; -class RISCVMOP val> { - bits<3> Value = val; +class RISCVMOP val> { + bits<2> Value = val; } -def MOPLDUnitStrideU : RISCVMOP<0b000>; -def MOPLDStridedU : RISCVMOP<0b010>; -def MOPLDIndexedU : RISCVMOP<0b011>; -def MOPLDUnitStrideS : RISCVMOP<0b100>; -def MOPLDStridedS : RISCVMOP<0b110>; -def MOPLDIndexedS : RISCVMOP<0b111>; - -def MOPSTUnitStride : RISCVMOP<0b000>; -def MOPSTStrided : RISCVMOP<0b010>; -def MOPSTIndexedOrder: RISCVMOP<0b011>; -def MOPSTIndexedUnOrd: RISCVMOP<0b111>; +def MOPLDUnitStride : RISCVMOP<0b00>; +def MOPLDStrided : RISCVMOP<0b10>; +def MOPLDIndexed : RISCVMOP<0b11>; + +def MOPSTUnitStride : RISCVMOP<0b00>; +def MOPSTIndexedUnord : RISCVMOP<0b01>; +def MOPSTStrided : RISCVMOP<0b10>; +def MOPSTIndexedOrder : RISCVMOP<0b11>; class RISCVLSUMOP val> { bits<5> Value = val; @@ -45,13 +42,17 @@ def SUMOPUnitStride : RISCVLSUMOP<0b00000>; def SUMOPUnitStrideWholeReg : RISCVLSUMOP<0b01000>; -class RISCVWidth val> { - bits<3> Value = val; +class RISCVWidth val> { + bits<4> Value = val; } -def LSWidthVByte : RISCVWidth<0b000>; -def LSWidthVHalf : RISCVWidth<0b101>; -def LSWidthVWord : RISCVWidth<0b110>; -def LSWidthVSEW : RISCVWidth<0b111>; +def LSWidth8 : RISCVWidth<0b0000>; +def LSWidth16 : RISCVWidth<0b0101>; +def LSWidth32 : RISCVWidth<0b0110>; +def LSWidth64 : RISCVWidth<0b0111>; +def LSWidth128 : RISCVWidth<0b1000>; +def LSWidth256 : RISCVWidth<0b1101>; +def LSWidth512 : RISCVWidth<0b1110>; +def LSWidth1024 : RISCVWidth<0b1111>; class RVInstSetVLi : RVInst { @@ -179,8 +180,8 @@ let Uses = [VTYPE, VL]; } -class RVInstVLU nf, RISCVMOP mop, RISCVLSUMOP lumop, - RISCVWidth width, dag outs, dag ins, string opcodestr, +class RVInstVLU nf, bit mew, RISCVMOP mop, RISCVLSUMOP lumop, + bits<3> width, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> rs1; @@ -188,18 +189,19 @@ bit vm; let Inst{31-29} = nf; - let Inst{28-26} = mop.Value; + let Inst{28} = mew; + let Inst{27-26} = mop.Value; let Inst{25} = vm; let Inst{24-20} = lumop.Value; let Inst{19-15} = rs1; - let Inst{14-12} = width.Value; + let Inst{14-12} = width; let Inst{11-7} = vd; let Opcode = OPC_LOAD_FP.Value; let Uses = [VTYPE, VL]; } -class RVInstVLS nf, RISCVMOP mop, RISCVWidth width, +class RVInstVLS nf, bit mew, RISCVMOP mop, bits<3> width, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> rs2; @@ -208,18 +210,19 @@ bit vm; let Inst{31-29} = nf; - let Inst{28-26} = mop.Value; + let Inst{28} = mew; + let Inst{27-26} = mop.Value; let Inst{25} = vm; let Inst{24-20} = rs2; let Inst{19-15} = rs1; - let Inst{14-12} = width.Value; + let Inst{14-12} = width; let Inst{11-7} = vd; let Opcode = OPC_LOAD_FP.Value; let Uses = [VTYPE, VL]; } -class RVInstVLX nf, RISCVMOP mop, RISCVWidth width, +class RVInstVLX nf, bit mew, RISCVMOP mop, bits<3> width, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> vs2; @@ -228,19 +231,20 @@ bit vm; let Inst{31-29} = nf; - let Inst{28-26} = mop.Value; + let Inst{28} = mew; + let Inst{27-26} = mop.Value; let Inst{25} = vm; let Inst{24-20} = vs2; let Inst{19-15} = rs1; - let Inst{14-12} = width.Value; + let Inst{14-12} = width; let Inst{11-7} = vd; let Opcode = OPC_LOAD_FP.Value; let Uses = [VTYPE, VL]; } -class RVInstVSU nf, RISCVMOP mop, RISCVLSUMOP sumop, - RISCVWidth width, dag outs, dag ins, string opcodestr, +class RVInstVSU nf, bit mew, RISCVMOP mop, RISCVLSUMOP sumop, + bits<3> width, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> rs1; @@ -248,18 +252,19 @@ bit vm; let Inst{31-29} = nf; - let Inst{28-26} = mop.Value; + let Inst{28} = mew; + let Inst{27-26} = mop.Value; let Inst{25} = vm; let Inst{24-20} = sumop.Value; let Inst{19-15} = rs1; - let Inst{14-12} = width.Value; + let Inst{14-12} = width; let Inst{11-7} = vs3; let Opcode = OPC_STORE_FP.Value; let Uses = [VTYPE, VL]; } -class RVInstVSS nf, RISCVMOP mop, RISCVWidth width, +class RVInstVSS nf, bit mew, RISCVMOP mop, bits<3> width, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> rs2; @@ -268,18 +273,19 @@ bit vm; let Inst{31-29} = nf; - let Inst{28-26} = mop.Value; + let Inst{28} = mew; + let Inst{27-26} = mop.Value; let Inst{25} = vm; let Inst{24-20} = rs2; let Inst{19-15} = rs1; - let Inst{14-12} = width.Value; + let Inst{14-12} = width; let Inst{11-7} = vs3; let Opcode = OPC_STORE_FP.Value; let Uses = [VTYPE, VL]; } -class RVInstVSX nf, RISCVMOP mop, RISCVWidth width, +class RVInstVSX nf, bit mew, RISCVMOP mop, bits<3> width, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> vs2; @@ -288,11 +294,12 @@ bit vm; let Inst{31-29} = nf; - let Inst{28-26} = mop.Value; + let Inst{28} = mew; + let Inst{27-26} = mop.Value; let Inst{25} = vm; let Inst{24-20} = vs2; let Inst{19-15} = rs1; - let Inst{14-12} = width.Value; + let Inst{14-12} = width; let Inst{11-7} = vs3; let Opcode = OPC_STORE_FP.Value; diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td @@ -96,25 +96,26 @@ // load vd, (rs1), vm class VUnitStrideLoad - : RVInstVLU<0b000, mop, lumop, width, (outs VRegOp:$vd), + : RVInstVLU<0b000, width.Value{3}, mop, lumop, width.Value{2-0}, + (outs VRegOp:$vd), (ins GPR:$rs1, VMaskOp:$vm), opcodestr, "$vd, (${rs1})$vm">; // load vd, (rs1), rs2, vm class VStridedLoad - : RVInstVLS<0b000, mop, width, (outs VRegOp:$vd), + : RVInstVLS<0b000, width.Value{3}, mop, width.Value{2-0}, (outs VRegOp:$vd), (ins GPR:$rs1, GPR:$rs2, VMaskOp:$vm), opcodestr, "$vd, (${rs1}), $rs2$vm">; // load vd, (rs1), vs2, vm class VIndexedLoad - : RVInstVLX<0b000, mop, width, (outs VRegOp:$vd), + : RVInstVLX<0b000, width.Value{3}, mop, width.Value{2-0}, (outs VRegOp:$vd), (ins GPR:$rs1, VRegOp:$vs2, VMaskOp:$vm), opcodestr, "$vd, (${rs1}), $vs2$vm">; // vlr.v vd, (rs1) class VWholeLoad nf, string opcodestr> - : RVInstVLU { let vm = 1; let Uses = []; @@ -125,26 +126,26 @@ // store vd, vs3, (rs1), vm class VUnitStrideStore - : RVInstVSU<0b000, mop, sumop, width, (outs), + : RVInstVSU<0b000, width.Value{3}, mop, sumop, width.Value{2-0}, (outs), (ins VRegOp:$vs3, GPR:$rs1, VMaskOp:$vm), opcodestr, "$vs3, (${rs1})$vm">; // store vd, vs3, (rs1), rs2, vm class VStridedStore - : RVInstVSS<0b000, mop, width, (outs), + : RVInstVSS<0b000, width.Value{3}, mop, width.Value{2-0}, (outs), (ins VRegOp:$vs3, GPR:$rs1, GPR:$rs2, VMaskOp:$vm), opcodestr, "$vs3, (${rs1}), $rs2$vm">; // store vd, vs3, (rs1), vs2, vm class VIndexedStore - : RVInstVSX<0b000, mop, width, (outs), + : RVInstVSX<0b000, width.Value{3}, mop, width.Value{2-0}, (outs), (ins VRegOp:$vs3, GPR:$rs1, VRegOp:$vs2, VMaskOp:$vm), opcodestr, "$vs3, (${rs1}), $vs2$vm">; // vsr.v vd, (rs1) class VWholeStore nf, string opcodestr> - : RVInstVSU { let vm = 1; let Uses = []; @@ -370,68 +371,79 @@ } // hasSideEffects = 1, mayLoad = 0, mayStore = 0 // Vector Unit-Stride Instructions -def VLB_V : VUnitStrideLoad; -def VLH_V : VUnitStrideLoad; -def VLW_V : VUnitStrideLoad; - -def VLBU_V : VUnitStrideLoad; -def VLHU_V : VUnitStrideLoad; -def VLWU_V : VUnitStrideLoad; - -def VLE_V : VUnitStrideLoad; - -def VLBFF_V : VUnitStrideLoad; -def VLHFF_V : VUnitStrideLoad; -def VLWFF_V : VUnitStrideLoad; - -def VLBUFF_V : VUnitStrideLoad; -def VLHUFF_V : VUnitStrideLoad; -def VLWUFF_V : VUnitStrideLoad; - -def VLEFF_V : VUnitStrideLoad; - -def VSB_V : VUnitStrideStore; -def VSH_V : VUnitStrideStore; -def VSW_V : VUnitStrideStore; - -def VSE_V : VUnitStrideStore; +def VLE8_V : VUnitStrideLoad; +def VLE16_V : VUnitStrideLoad; +def VLE32_V : VUnitStrideLoad; +def VLE64_V : VUnitStrideLoad; +def VLE128_V : VUnitStrideLoad; +def VLE256_V : VUnitStrideLoad; +def VLE512_V : VUnitStrideLoad; +def VLE1024_V : VUnitStrideLoad; + +def VLE8FF_V : VUnitStrideLoad; +def VLE16FF_V : VUnitStrideLoad; +def VLE32FF_V : VUnitStrideLoad; +def VLE64FF_V : VUnitStrideLoad; +def VLE128FF_V : VUnitStrideLoad; +def VLE256FF_V : VUnitStrideLoad; +def VLE512FF_V : VUnitStrideLoad; +def VLE1024FF_V : VUnitStrideLoad; + +def VSE8_V : VUnitStrideStore; +def VSE16_V : VUnitStrideStore; +def VSE32_V : VUnitStrideStore; +def VSE64_V : VUnitStrideStore; +def VSE128_V : VUnitStrideStore; +def VSE256_V : VUnitStrideStore; +def VSE512_V : VUnitStrideStore; +def VSE1024_V : VUnitStrideStore; // Vector Strided Instructions -def VLSB_V : VStridedLoad; -def VLSH_V : VStridedLoad; -def VLSW_V : VStridedLoad; - -def VLSBU_V : VStridedLoad; -def VLSHU_V : VStridedLoad; -def VLSWU_V : VStridedLoad; - -def VLSE_V : VStridedLoad; - -def VSSB_V : VStridedStore; -def VSSH_V : VStridedStore; -def VSSW_V : VStridedStore; -def VSSE_V : VStridedStore; +def VLSE8_V : VStridedLoad; +def VLSE16_V : VStridedLoad; +def VLSE32_V : VStridedLoad; +def VLSE64_V : VStridedLoad; +def VLSE128_V : VStridedLoad; +def VLSE256_V : VStridedLoad; +def VLSE512_V : VStridedLoad; +def VLSE1024_V : VStridedLoad; + +def VSSE8_V : VStridedStore; +def VSSE16_V : VStridedStore; +def VSSE32_V : VStridedStore; +def VSSE64_V : VStridedStore; +def VSSE128_V : VStridedStore; +def VSSE256_V : VStridedStore; +def VSSE512_V : VStridedStore; +def VSSE1024_V : VStridedStore; // Vector Indexed Instructions -def VLXB_V : VIndexedLoad; -def VLXH_V : VIndexedLoad; -def VLXW_V : VIndexedLoad; - -def VLXBU_V : VIndexedLoad; -def VLXHU_V : VIndexedLoad; -def VLXWU_V : VIndexedLoad; - -def VLXE_V : VIndexedLoad; - -def VSXB_V : VIndexedStore; -def VSXH_V : VIndexedStore; -def VSXW_V : VIndexedStore; -def VSXE_V : VIndexedStore; - -def VSUXB_V : VIndexedStore; -def VSUXH_V : VIndexedStore; -def VSUXW_V : VIndexedStore; -def VSUXE_V : VIndexedStore; +def VLXEI8_V : VIndexedLoad; +def VLXEI16_V : VIndexedLoad; +def VLXEI32_V : VIndexedLoad; +def VLXEI64_V : VIndexedLoad; +def VLXEI128_V : VIndexedLoad; +def VLXEI256_V : VIndexedLoad; +def VLXEI512_V : VIndexedLoad; +def VLXEI1024_V : VIndexedLoad; + +def VSXEI8_V : VIndexedStore; +def VSXEI16_V : VIndexedStore; +def VSXEI32_V : VIndexedStore; +def VSXEI64_V : VIndexedStore; +def VSXEI128_V : VIndexedStore; +def VSXEI256_V : VIndexedStore; +def VSXEI512_V : VIndexedStore; +def VSXEI1024_V : VIndexedStore; + +def VSUXEI8_V : VIndexedStore; +def VSUXEI16_V : VIndexedStore; +def VSUXEI32_V : VIndexedStore; +def VSUXEI64_V : VIndexedStore; +def VSUXEI128_V : VIndexedStore; +def VSUXEI256_V : VIndexedStore; +def VSUXEI512_V : VIndexedStore; +def VSUXEI1024_V : VIndexedStore; def VL1R_V : VWholeLoad<0, "vl1r.v">; def VS1R_V : VWholeStore<0, "vs1r.v">; @@ -470,6 +482,14 @@ def : InstAlias<"vwcvtu.x.x.v $vd, $vs$vm", (VWADDU_VX VRegOp:$vd, VRegOp:$vs, X0, VMaskOp:$vm)>; +// Vector Integer Extension +defm VZEXT_VF8 : VALU_MV_VS2<"vzext.vf8", 0b010010, 0b00010>; +defm VSEXT_VF8 : VALU_MV_VS2<"vsext.vf8", 0b010010, 0b00011>; +defm VZEXT_VF4 : VALU_MV_VS2<"vzext.vf4", 0b010010, 0b00100>; +defm VSEXT_VF4 : VALU_MV_VS2<"vsext.vf4", 0b010010, 0b00101>; +defm VZEXT_VF2 : VALU_MV_VS2<"vzext.vf2", 0b010010, 0b00110>; +defm VSEXT_VF2 : VALU_MV_VS2<"vsext.vf2", 0b010010, 0b00111>; + // Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions defm VADC_V : VALUm_IV_V_X_I<"vadc", 0b010000>; defm VMADC_V : VALUm_IV_V_X_I<"vmadc", 0b010001>; @@ -662,7 +682,7 @@ } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenV // Vector Floating-Point Square-Root Instruction -defm VFSQRT_V : VALU_FV_VS2<"vfsqrt.v", 0b100011, 0b00000>; +defm VFSQRT_V : VALU_FV_VS2<"vfsqrt.v", 0b010011, 0b00000>; // Vector Floating-Point MIN/MAX Instructions defm VFMIN_V : VALU_FV_V_F<"vfmin", 0b000100>; @@ -687,7 +707,7 @@ (VMFLE_VV VRegOp:$vd, VRegOp:$vb, VRegOp:$va, VMaskOp:$vm), 0>; // Vector Floating-Point Classify Instruction -defm VFCLASS_V : VALU_FV_VS2<"vfclass.v", 0b100011, 0b10000>; +defm VFCLASS_V : VALU_FV_VS2<"vfclass.v", 0b010011, 0b10000>; let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in { // Vector Floating-Point Merge Instruction @@ -706,28 +726,34 @@ } // hasSideEffects = 0, mayLoad = 0, mayStore = 0 // Single-Width Floating-Point/Integer Type-Convert Instructions -defm VFCVT_XU_F_V : VALU_FV_VS2<"vfcvt.xu.f.v", 0b100010, 0b00000>; -defm VFCVT_X_F_V : VALU_FV_VS2<"vfcvt.x.f.v", 0b100010, 0b00001>; -defm VFCVT_F_XU_V : VALU_FV_VS2<"vfcvt.f.xu.v", 0b100010, 0b00010>; -defm VFCVT_F_X_V : VALU_FV_VS2<"vfcvt.f.x.v", 0b100010, 0b00011>; +defm VFCVT_XU_F_V : VALU_FV_VS2<"vfcvt.xu.f.v", 0b010010, 0b00000>; +defm VFCVT_X_F_V : VALU_FV_VS2<"vfcvt.x.f.v", 0b010010, 0b00001>; +defm VFCVT_RTZ_XU_F_V : VALU_FV_VS2<"vfcvt.rtz.xu.f.v", 0b010010, 0b00110>; +defm VFCVT_RTZ_X_F_V : VALU_FV_VS2<"vfcvt.rtz.x.f.v", 0b010010, 0b00111>; +defm VFCVT_F_XU_V : VALU_FV_VS2<"vfcvt.f.xu.v", 0b010010, 0b00010>; +defm VFCVT_F_X_V : VALU_FV_VS2<"vfcvt.f.x.v", 0b010010, 0b00011>; // Widening Floating-Point/Integer Type-Convert Instructions let Constraints = "@earlyclobber $vd", RVVConstraint = WidenCvt in { -defm VFWCVT_XU_F_V : VALU_FV_VS2<"vfwcvt.xu.f.v", 0b100010, 0b01000>; -defm VFWCVT_X_F_V : VALU_FV_VS2<"vfwcvt.x.f.v", 0b100010, 0b01001>; -defm VFWCVT_F_XU_V : VALU_FV_VS2<"vfwcvt.f.xu.v", 0b100010, 0b01010>; -defm VFWCVT_F_X_V : VALU_FV_VS2<"vfwcvt.f.x.v", 0b100010, 0b01011>; -defm VFWCVT_F_F_V : VALU_FV_VS2<"vfwcvt.f.f.v", 0b100010, 0b01100>; +defm VFWCVT_XU_F_V : VALU_FV_VS2<"vfwcvt.xu.f.v", 0b010010, 0b01000>; +defm VFWCVT_X_F_V : VALU_FV_VS2<"vfwcvt.x.f.v", 0b010010, 0b01001>; +defm VFWCVT_RTZ_XU_F_V : VALU_FV_VS2<"vfwcvt.rtz.xu.f.v", 0b010010, 0b01110>; +defm VFWCVT_RTZ_X_F_V : VALU_FV_VS2<"vfwcvt.rtz.x.f.v", 0b010010, 0b01111>; +defm VFWCVT_F_XU_V : VALU_FV_VS2<"vfwcvt.f.xu.v", 0b010010, 0b01010>; +defm VFWCVT_F_X_V : VALU_FV_VS2<"vfwcvt.f.x.v", 0b010010, 0b01011>; +defm VFWCVT_F_F_V : VALU_FV_VS2<"vfwcvt.f.f.v", 0b010010, 0b01100>; } // Constraints = "@earlyclobber $vd", RVVConstraint = WidenCvt // Narrowing Floating-Point/Integer Type-Convert Instructions let Constraints = "@earlyclobber $vd", RVVConstraint = NarrowCvt in { -defm VFNCVT_XU_F_W : VALU_FV_VS2<"vfncvt.xu.f.w", 0b100010, 0b10000>; -defm VFNCVT_X_F_W : VALU_FV_VS2<"vfncvt.x.f.w", 0b100010, 0b10001>; -defm VFNCVT_F_XU_W : VALU_FV_VS2<"vfncvt.f.xu.w", 0b100010, 0b10010>; -defm VFNCVT_F_X_W : VALU_FV_VS2<"vfncvt.f.x.w", 0b100010, 0b10011>; -defm VFNCVT_F_F_W : VALU_FV_VS2<"vfncvt.f.f.w", 0b100010, 0b10100>; -defm VFNCVT_ROD_F_F_W : VALU_FV_VS2<"vfncvt.rod.f.f.w", 0b100010, 0b10101>; +defm VFNCVT_XU_F_W : VALU_FV_VS2<"vfncvt.xu.f.w", 0b010010, 0b10000>; +defm VFNCVT_X_F_W : VALU_FV_VS2<"vfncvt.x.f.w", 0b010010, 0b10001>; +defm VFNCVT_RTZ_XU_F_W : VALU_FV_VS2<"vfncvt.rtz.xu.f.w", 0b010010, 0b10110>; +defm VFNCVT_RTZ_X_F_W : VALU_FV_VS2<"vfncvt.rtz.x.f.w", 0b010010, 0b10111>; +defm VFNCVT_F_XU_W : VALU_FV_VS2<"vfncvt.f.xu.w", 0b010010, 0b10010>; +defm VFNCVT_F_X_W : VALU_FV_VS2<"vfncvt.f.x.w", 0b010010, 0b10011>; +defm VFNCVT_F_F_W : VALU_FV_VS2<"vfncvt.f.f.w", 0b010010, 0b10100>; +defm VFNCVT_ROD_F_F_W : VALU_FV_VS2<"vfncvt.rod.f.f.w", 0b010010, 0b10101>; } // Constraints = "@earlyclobber $vd", RVVConstraint = NarrowCvt // Vector Single-Width Integer Reduction Instructions @@ -776,7 +802,7 @@ defm VMORNOT_M : VALU_MV_Mask<"vmornot", 0b011100, "m">; defm VMXNOR_M : VALU_MV_Mask<"vmxnor", 0b011111, "m">; -def : InstAlias<"vmcpy.m $vd, $vs", +def : InstAlias<"vmmv.m $vd, $vs", (VMAND_MM VRegOp:$vd, VRegOp:$vs, VRegOp:$vs)>; def : InstAlias<"vmclr.m $vd", (VMXOR_MM VRegOp:$vd, VRegOp:$vd, VRegOp:$vd)>; @@ -845,8 +871,10 @@ let Constraints = "@earlyclobber $vd", RVVConstraint = SlideUp in { defm VSLIDE1UP_V : VALU_MV_X<"vslide1up", 0b001110>; +defm VFSLIDE1UP_V : VALU_FV_F<"vfslide1up", 0b001110>; } // Constraints = "@earlyclobber $vd", RVVConstraint = SlideUp defm VSLIDE1DOWN_V : VALU_MV_X<"vslide1down", 0b001111>; +defm VFSLIDE1DOWN_V : VALU_FV_F<"vfslide1down", 0b001111>; // Vector Register Gather Instruction let Constraints = "@earlyclobber $vd", RVVConstraint = Vrgather in { diff --git a/llvm/test/MC/RISCV/rvv/convert.s b/llvm/test/MC/RISCV/rvv/convert.s --- a/llvm/test/MC/RISCV/rvv/convert.s +++ b/llvm/test/MC/RISCV/rvv/convert.s @@ -10,180 +10,252 @@ vfcvt.xu.f.v v8, v4, v0.t # CHECK-INST: vfcvt.xu.f.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x40,0x88] +# CHECK-ENCODING: [0x57,0x14,0x40,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 40 88 +# CHECK-UNKNOWN: 57 14 40 48 vfcvt.xu.f.v v8, v4 # CHECK-INST: vfcvt.xu.f.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x40,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x40,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 40 8a +# CHECK-UNKNOWN: 57 14 40 4a vfcvt.x.f.v v8, v4, v0.t # CHECK-INST: vfcvt.x.f.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x40,0x88] +# CHECK-ENCODING: [0x57,0x94,0x40,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 40 88 +# CHECK-UNKNOWN: 57 94 40 48 vfcvt.x.f.v v8, v4 # CHECK-INST: vfcvt.x.f.v v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x40,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x40,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 40 8a +# CHECK-UNKNOWN: 57 94 40 4a vfcvt.f.xu.v v8, v4, v0.t # CHECK-INST: vfcvt.f.xu.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x41,0x88] +# CHECK-ENCODING: [0x57,0x14,0x41,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 41 88 +# CHECK-UNKNOWN: 57 14 41 48 vfcvt.f.xu.v v8, v4 # CHECK-INST: vfcvt.f.xu.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x41,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x41,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 41 8a +# CHECK-UNKNOWN: 57 14 41 4a vfcvt.f.x.v v8, v4, v0.t # CHECK-INST: vfcvt.f.x.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x41,0x88] +# CHECK-ENCODING: [0x57,0x94,0x41,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 41 88 +# CHECK-UNKNOWN: 57 94 41 48 vfcvt.f.x.v v8, v4 # CHECK-INST: vfcvt.f.x.v v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x41,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x41,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 41 8a +# CHECK-UNKNOWN: 57 94 41 4a + +vfcvt.rtz.xu.f.v v8, v4, v0.t +# CHECK-INST: vfcvt.rtz.xu.f.v v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x14,0x43,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 14 43 48 + +vfcvt.rtz.xu.f.v v8, v4 +# CHECK-INST: vfcvt.rtz.xu.f.v v8, v4 +# CHECK-ENCODING: [0x57,0x14,0x43,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 14 43 4a + +vfcvt.rtz.x.f.v v8, v4, v0.t +# CHECK-INST: vfcvt.rtz.x.f.v v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x94,0x43,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 94 43 48 + +vfcvt.rtz.x.f.v v8, v4 +# CHECK-INST: vfcvt.rtz.x.f.v v8, v4 +# CHECK-ENCODING: [0x57,0x94,0x43,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 94 43 4a vfwcvt.xu.f.v v8, v4, v0.t # CHECK-INST: vfwcvt.xu.f.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x44,0x88] +# CHECK-ENCODING: [0x57,0x14,0x44,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 44 88 +# CHECK-UNKNOWN: 57 14 44 48 vfwcvt.xu.f.v v8, v4 # CHECK-INST: vfwcvt.xu.f.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x44,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x44,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 44 8a +# CHECK-UNKNOWN: 57 14 44 4a vfwcvt.x.f.v v8, v4, v0.t # CHECK-INST: vfwcvt.x.f.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x44,0x88] +# CHECK-ENCODING: [0x57,0x94,0x44,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 44 88 +# CHECK-UNKNOWN: 57 94 44 48 vfwcvt.x.f.v v8, v4 # CHECK-INST: vfwcvt.x.f.v v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x44,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x44,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 44 8a +# CHECK-UNKNOWN: 57 94 44 4a vfwcvt.f.xu.v v8, v4, v0.t # CHECK-INST: vfwcvt.f.xu.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x45,0x88] +# CHECK-ENCODING: [0x57,0x14,0x45,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 45 88 +# CHECK-UNKNOWN: 57 14 45 48 vfwcvt.f.xu.v v8, v4 # CHECK-INST: vfwcvt.f.xu.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x45,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x45,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 45 8a +# CHECK-UNKNOWN: 57 14 45 4a vfwcvt.f.x.v v8, v4, v0.t # CHECK-INST: vfwcvt.f.x.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x45,0x88] +# CHECK-ENCODING: [0x57,0x94,0x45,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 45 88 +# CHECK-UNKNOWN: 57 94 45 48 vfwcvt.f.x.v v8, v4 # CHECK-INST: vfwcvt.f.x.v v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x45,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x45,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 45 8a +# CHECK-UNKNOWN: 57 94 45 4a vfwcvt.f.f.v v8, v4, v0.t # CHECK-INST: vfwcvt.f.f.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x46,0x88] +# CHECK-ENCODING: [0x57,0x14,0x46,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 46 88 +# CHECK-UNKNOWN: 57 14 46 48 vfwcvt.f.f.v v8, v4 # CHECK-INST: vfwcvt.f.f.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x46,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x46,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 14 46 4a + +vfwcvt.rtz.xu.f.v v8, v4, v0.t +# CHECK-INST: vfwcvt.rtz.xu.f.v v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x14,0x47,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 14 47 48 + +vfwcvt.rtz.xu.f.v v8, v4 +# CHECK-INST: vfwcvt.rtz.xu.f.v v8, v4 +# CHECK-ENCODING: [0x57,0x14,0x47,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 46 8a +# CHECK-UNKNOWN: 57 14 47 4a + +vfwcvt.rtz.x.f.v v8, v4, v0.t +# CHECK-INST: vfwcvt.rtz.x.f.v v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x94,0x47,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 94 47 48 + +vfwcvt.rtz.x.f.v v8, v4 +# CHECK-INST: vfwcvt.rtz.x.f.v v8, v4 +# CHECK-ENCODING: [0x57,0x94,0x47,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 94 47 4a vfncvt.xu.f.w v8, v4, v0.t # CHECK-INST: vfncvt.xu.f.w v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x48,0x88] +# CHECK-ENCODING: [0x57,0x14,0x48,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 48 88 +# CHECK-UNKNOWN: 57 14 48 48 vfncvt.xu.f.w v8, v4 # CHECK-INST: vfncvt.xu.f.w v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x48,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x48,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 48 8a +# CHECK-UNKNOWN: 57 14 48 4a vfncvt.x.f.w v8, v4, v0.t # CHECK-INST: vfncvt.x.f.w v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x48,0x88] +# CHECK-ENCODING: [0x57,0x94,0x48,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 48 88 +# CHECK-UNKNOWN: 57 94 48 48 vfncvt.x.f.w v8, v4 # CHECK-INST: vfncvt.x.f.w v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x48,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x48,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 48 8a +# CHECK-UNKNOWN: 57 94 48 4a vfncvt.f.xu.w v8, v4, v0.t # CHECK-INST: vfncvt.f.xu.w v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x49,0x88] +# CHECK-ENCODING: [0x57,0x14,0x49,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 49 88 +# CHECK-UNKNOWN: 57 14 49 48 vfncvt.f.xu.w v8, v4 # CHECK-INST: vfncvt.f.xu.w v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x49,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x49,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 49 8a +# CHECK-UNKNOWN: 57 14 49 4a vfncvt.f.x.w v8, v4, v0.t # CHECK-INST: vfncvt.f.x.w v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x49,0x88] +# CHECK-ENCODING: [0x57,0x94,0x49,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 49 88 +# CHECK-UNKNOWN: 57 94 49 48 vfncvt.f.x.w v8, v4 # CHECK-INST: vfncvt.f.x.w v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x49,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x49,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 49 8a +# CHECK-UNKNOWN: 57 94 49 4a vfncvt.f.f.w v8, v4, v0.t # CHECK-INST: vfncvt.f.f.w v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x4a,0x88] +# CHECK-ENCODING: [0x57,0x14,0x4a,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 4a 88 +# CHECK-UNKNOWN: 57 14 4a 48 vfncvt.f.f.w v8, v4 # CHECK-INST: vfncvt.f.f.w v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x4a,0x8a] +# CHECK-ENCODING: [0x57,0x14,0x4a,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 4a 8a +# CHECK-UNKNOWN: 57 14 4a 4a vfncvt.rod.f.f.w v8, v4, v0.t # CHECK-INST: vfncvt.rod.f.f.w v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x94,0x4a,0x88] +# CHECK-ENCODING: [0x57,0x94,0x4a,0x48] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 4a 88 +# CHECK-UNKNOWN: 57 94 4a 48 vfncvt.rod.f.f.w v8, v4 # CHECK-INST: vfncvt.rod.f.f.w v8, v4 -# CHECK-ENCODING: [0x57,0x94,0x4a,0x8a] +# CHECK-ENCODING: [0x57,0x94,0x4a,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 94 4a 4a + +vfncvt.rtz.xu.f.w v8, v4, v0.t +# CHECK-INST: vfncvt.rtz.xu.f.w v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x14,0x4b,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 14 4b 48 + +vfncvt.rtz.xu.f.w v8, v4 +# CHECK-INST: vfncvt.rtz.xu.f.w v8, v4 +# CHECK-ENCODING: [0x57,0x14,0x4b,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 14 4b 4a + +vfncvt.rtz.x.f.w v8, v4, v0.t +# CHECK-INST: vfncvt.rtz.x.f.w v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x94,0x4b,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 94 4b 48 + +vfncvt.rtz.x.f.w v8, v4 +# CHECK-INST: vfncvt.rtz.x.f.w v8, v4 +# CHECK-ENCODING: [0x57,0x94,0x4b,0x4a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 94 4a 8a +# CHECK-UNKNOWN: 57 94 4b 4a diff --git a/llvm/test/MC/RISCV/rvv/ext.s b/llvm/test/MC/RISCV/rvv/ext.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/RISCV/rvv/ext.s @@ -0,0 +1,81 @@ +# RUN: llvm-mc -triple=riscv64 -show-encoding --mattr=+experimental-v < %s \ +# RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +# RUN: not llvm-mc -triple=riscv64 -show-encoding < %s 2>&1 \ +# RUN: | FileCheck %s --check-prefix=CHECK-ERROR +# RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+experimental-v < %s \ +# RUN: | llvm-objdump -d --mattr=+experimental-v - \ +# RUN: | FileCheck %s --check-prefix=CHECK-INST +# RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+experimental-v < %s \ +# RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +vzext.vf2 v8, v4, v0.t +# CHECK-INST: vzext.vf2 v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x24,0x43,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 24 43 48 + +vzext.vf2 v8, v4 +# CHECK-INST: vzext.vf2 v8, v4 +# CHECK-ENCODING: [0x57,0x24,0x43,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 24 43 4a + +vsext.vf2 v8, v4, v0.t +# CHECK-INST: vsext.vf2 v8, v4, v0.t +# CHECK-ENCODING: [0x57,0xa4,0x43,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 a4 43 48 + +vsext.vf2 v8, v4 +# CHECK-INST: vsext.vf2 v8, v4 +# CHECK-ENCODING: [0x57,0xa4,0x43,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 a4 43 4a + +vzext.vf4 v8, v4, v0.t +# CHECK-INST: vzext.vf4 v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x24,0x42,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 24 42 48 + +vzext.vf4 v8, v4 +# CHECK-INST: vzext.vf4 v8, v4 +# CHECK-ENCODING: [0x57,0x24,0x42,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 24 42 4a + +vsext.vf4 v8, v4, v0.t +# CHECK-INST: vsext.vf4 v8, v4, v0.t +# CHECK-ENCODING: [0x57,0xa4,0x42,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 a4 42 48 + +vsext.vf4 v8, v4 +# CHECK-INST: vsext.vf4 v8, v4 +# CHECK-ENCODING: [0x57,0xa4,0x42,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 a4 42 4a + +vzext.vf8 v8, v4, v0.t +# CHECK-INST: vzext.vf8 v8, v4, v0.t +# CHECK-ENCODING: [0x57,0x24,0x41,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 24 41 48 + +vzext.vf8 v8, v4 +# CHECK-INST: vzext.vf8 v8, v4 +# CHECK-ENCODING: [0x57,0x24,0x41,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 24 41 4a + +vsext.vf8 v8, v4, v0.t +# CHECK-INST: vsext.vf8 v8, v4, v0.t +# CHECK-ENCODING: [0x57,0xa4,0x41,0x48] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 a4 41 48 + +vsext.vf8 v8, v4 +# CHECK-INST: vsext.vf8 v8, v4 +# CHECK-ENCODING: [0x57,0xa4,0x41,0x4a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 a4 41 4a diff --git a/llvm/test/MC/RISCV/rvv/fothers.s b/llvm/test/MC/RISCV/rvv/fothers.s --- a/llvm/test/MC/RISCV/rvv/fothers.s +++ b/llvm/test/MC/RISCV/rvv/fothers.s @@ -10,30 +10,54 @@ vfsqrt.v v8, v4, v0.t # CHECK-INST: vfsqrt.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x40,0x8c] +# CHECK-ENCODING: [0x57,0x14,0x40,0x4c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 40 8c +# CHECK-UNKNOWN: 57 14 40 4c vfsqrt.v v8, v4 # CHECK-INST: vfsqrt.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x40,0x8e] +# CHECK-ENCODING: [0x57,0x14,0x40,0x4e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 40 8e +# CHECK-UNKNOWN: 57 14 40 4e vfclass.v v8, v4, v0.t # CHECK-INST: vfclass.v v8, v4, v0.t -# CHECK-ENCODING: [0x57,0x14,0x48,0x8c] +# CHECK-ENCODING: [0x57,0x14,0x48,0x4c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 48 8c +# CHECK-UNKNOWN: 57 14 48 4c vfclass.v v8, v4 # CHECK-INST: vfclass.v v8, v4 -# CHECK-ENCODING: [0x57,0x14,0x48,0x8e] +# CHECK-ENCODING: [0x57,0x14,0x48,0x4e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 57 14 48 8e +# CHECK-UNKNOWN: 57 14 48 4e vfmerge.vfm v8, v4, fa0, v0 # CHECK-INST: vfmerge.vfm v8, v4, fa0, v0 # CHECK-ENCODING: [0x57,0x54,0x45,0x5c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 57 54 45 5c + +vfslide1up.vf v8, v4, fa0, v0.t +# CHECK-INST: vfslide1up.vf v8, v4, fa0, v0.t +# CHECK-ENCODING: [0x57,0x54,0x45,0x38] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 54 45 38 + +vfslide1up.vf v8, v4, fa0 +# CHECK-INST: vfslide1up.vf v8, v4, fa0 +# CHECK-ENCODING: [0x57,0x54,0x45,0x3a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 54 45 3a + +vfslide1down.vf v8, v4, fa0, v0.t +# CHECK-INST: vfslide1down.vf v8, v4, fa0, v0.t +# CHECK-ENCODING: [0x57,0x54,0x45,0x3c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 54 45 3c + +vfslide1down.vf v8, v4, fa0 +# CHECK-INST: vfslide1down.vf v8, v4, fa0 +# CHECK-ENCODING: [0x57,0x54,0x45,0x3e] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 54 45 3e diff --git a/llvm/test/MC/RISCV/rvv/invalid.s b/llvm/test/MC/RISCV/rvv/invalid.s --- a/llvm/test/MC/RISCV/rvv/invalid.s +++ b/llvm/test/MC/RISCV/rvv/invalid.s @@ -2,22 +2,34 @@ # RUN: | FileCheck %s --check-prefix=CHECK-ERROR vsetvli a2, a0, e31 -# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8] +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] vsetvli a2, a0, e32,m3 -# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8] +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] vsetvli a2, a0, m1,e32 -# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8] +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] vsetvli a2, a0, e32,m16 -# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8] +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] vsetvli a2, a0, e2048,m8 -# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8] +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] vsetvli a2, a0, e1,m8 -# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8] +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli a2, a0, e8,m1,tx +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli a2, a0, e8,m1,ta,mx +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli a2, a0, e8,m1,ma +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] + +vsetvli a2, a0, e8,m1,mu +# CHECK-ERROR: operand must be e[8|16|32|64|128|256|512|1024],m[1|2|4|8|f2|f4|f8],[ta|tu],[ma|mu] vadd.vv v1, v3, v2, v4.t # CHECK-ERROR: operand must be v0.t diff --git a/llvm/test/MC/RISCV/rvv/load.s b/llvm/test/MC/RISCV/rvv/load.s --- a/llvm/test/MC/RISCV/rvv/load.s +++ b/llvm/test/MC/RISCV/rvv/load.s @@ -8,332 +8,392 @@ # RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+experimental-v < %s \ # RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN -vlb.v v8, (a0), v0.t -# CHECK-INST: vlb.v v8, (a0), v0.t -# CHECK-ENCODING: [0x07,0x04,0x05,0x10] -# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 05 10 - -vlb.v v8, (a0) -# CHECK-INST: vlb.v v8, (a0) -# CHECK-ENCODING: [0x07,0x04,0x05,0x12] -# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 05 12 - -vlh.v v8, (a0), v0.t -# CHECK-INST: vlh.v v8, (a0), v0.t -# CHECK-ENCODING: [0x07,0x54,0x05,0x10] -# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 05 10 - -vlh.v v8, (a0) -# CHECK-INST: vlh.v v8, (a0) -# CHECK-ENCODING: [0x07,0x54,0x05,0x12] -# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 05 12 - -vlw.v v8, (a0), v0.t -# CHECK-INST: vlw.v v8, (a0), v0.t -# CHECK-ENCODING: [0x07,0x64,0x05,0x10] -# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 05 10 - -vlw.v v8, (a0) -# CHECK-INST: vlw.v v8, (a0) -# CHECK-ENCODING: [0x07,0x64,0x05,0x12] -# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 05 12 - -vlbu.v v8, (a0), v0.t -# CHECK-INST: vlbu.v v8, (a0), v0.t +vle8.v v8, (a0), v0.t +# CHECK-INST: vle8.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x04,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 05 00 -vlbu.v v8, (a0) -# CHECK-INST: vlbu.v v8, (a0) +vle8.v v8, (a0) +# CHECK-INST: vle8.v v8, (a0) # CHECK-ENCODING: [0x07,0x04,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 05 02 -vlhu.v v8, (a0), v0.t -# CHECK-INST: vlhu.v v8, (a0), v0.t +vle16.v v8, (a0), v0.t +# CHECK-INST: vle16.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x54,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 05 00 -vlhu.v v8, (a0) -# CHECK-INST: vlhu.v v8, (a0) +vle16.v v8, (a0) +# CHECK-INST: vle16.v v8, (a0) # CHECK-ENCODING: [0x07,0x54,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 05 02 -vlwu.v v8, (a0), v0.t -# CHECK-INST: vlwu.v v8, (a0), v0.t +vle32.v v8, (a0), v0.t +# CHECK-INST: vle32.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x64,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 05 00 -vlwu.v v8, (a0) -# CHECK-INST: vlwu.v v8, (a0) +vle32.v v8, (a0) +# CHECK-INST: vle32.v v8, (a0) # CHECK-ENCODING: [0x07,0x64,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 05 02 -vlbff.v v8, (a0), v0.t -# CHECK-INST: vlbff.v v8, (a0), v0.t -# CHECK-ENCODING: [0x07,0x04,0x05,0x11] +vle64.v v8, (a0), v0.t +# CHECK-INST: vle64.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x74,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 05 11 +# CHECK-UNKNOWN: 07 74 05 00 -vlbff.v v8, (a0) -# CHECK-INST: vlbff.v v8, (a0) -# CHECK-ENCODING: [0x07,0x04,0x05,0x13] +vle64.v v8, (a0) +# CHECK-INST: vle64.v v8, (a0) +# CHECK-ENCODING: [0x07,0x74,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 05 13 +# CHECK-UNKNOWN: 07 74 05 02 -vlhff.v v8, (a0), v0.t -# CHECK-INST: vlhff.v v8, (a0), v0.t -# CHECK-ENCODING: [0x07,0x54,0x05,0x11] +vle128.v v8, (a0), v0.t +# CHECK-INST: vle128.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x04,0x05,0x10] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 05 11 +# CHECK-UNKNOWN: 07 04 05 10 -vlhff.v v8, (a0) -# CHECK-INST: vlhff.v v8, (a0) -# CHECK-ENCODING: [0x07,0x54,0x05,0x13] +vle128.v v8, (a0) +# CHECK-INST: vle128.v v8, (a0) +# CHECK-ENCODING: [0x07,0x04,0x05,0x12] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 05 13 +# CHECK-UNKNOWN: 07 04 05 12 -vlwff.v v8, (a0), v0.t -# CHECK-INST: vlwff.v v8, (a0), v0.t -# CHECK-ENCODING: [0x07,0x64,0x05,0x11] +vle256.v v8, (a0), v0.t +# CHECK-INST: vle256.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x54,0x05,0x10] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 05 11 +# CHECK-UNKNOWN: 07 54 05 10 -vlwff.v v8, (a0) -# CHECK-INST: vlwff.v v8, (a0) -# CHECK-ENCODING: [0x07,0x64,0x05,0x13] +vle256.v v8, (a0) +# CHECK-INST: vle256.v v8, (a0) +# CHECK-ENCODING: [0x07,0x54,0x05,0x12] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 05 13 +# CHECK-UNKNOWN: 07 54 05 12 -vlbuff.v v8, (a0), v0.t -# CHECK-INST: vlbuff.v v8, (a0), v0.t +vle512.v v8, (a0), v0.t +# CHECK-INST: vle512.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x64,0x05,0x10] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 64 05 10 + +vle512.v v8, (a0) +# CHECK-INST: vle512.v v8, (a0) +# CHECK-ENCODING: [0x07,0x64,0x05,0x12] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 64 05 12 + +vle1024.v v8, (a0), v0.t +# CHECK-INST: vle1024.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x74,0x05,0x10] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 05 10 + +vle1024.v v8, (a0) +# CHECK-INST: vle1024.v v8, (a0) +# CHECK-ENCODING: [0x07,0x74,0x05,0x12] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 05 12 + +vle8ff.v v8, (a0), v0.t +# CHECK-INST: vle8ff.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x04,0x05,0x01] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 05 01 -vlbuff.v v8, (a0) -# CHECK-INST: vlbuff.v v8, (a0) +vle8ff.v v8, (a0) +# CHECK-INST: vle8ff.v v8, (a0) # CHECK-ENCODING: [0x07,0x04,0x05,0x03] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 05 03 -vlhuff.v v8, (a0), v0.t -# CHECK-INST: vlhuff.v v8, (a0), v0.t +vle16ff.v v8, (a0), v0.t +# CHECK-INST: vle16ff.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x54,0x05,0x01] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 05 01 -vlhuff.v v8, (a0) -# CHECK-INST: vlhuff.v v8, (a0) +vle16ff.v v8, (a0) +# CHECK-INST: vle16ff.v v8, (a0) # CHECK-ENCODING: [0x07,0x54,0x05,0x03] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 05 03 -vlwuff.v v8, (a0), v0.t -# CHECK-INST: vlwuff.v v8, (a0), v0.t +vle32ff.v v8, (a0), v0.t +# CHECK-INST: vle32ff.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x64,0x05,0x01] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 05 01 -vlwuff.v v8, (a0) -# CHECK-INST: vlwuff.v v8, (a0) +vle32ff.v v8, (a0) +# CHECK-INST: vle32ff.v v8, (a0) # CHECK-ENCODING: [0x07,0x64,0x05,0x03] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 05 03 -vleff.v v8, (a0), v0.t -# CHECK-INST: vleff.v v8, (a0), v0.t +vle64ff.v v8, (a0), v0.t +# CHECK-INST: vle64ff.v v8, (a0), v0.t # CHECK-ENCODING: [0x07,0x74,0x05,0x01] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 74 05 01 -vleff.v v8, (a0) -# CHECK-INST: vleff.v v8, (a0) +vle64ff.v v8, (a0) +# CHECK-INST: vle64ff.v v8, (a0) # CHECK-ENCODING: [0x07,0x74,0x05,0x03] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 74 05 03 -vlsb.v v8, (a0), a1, v0.t -# CHECK-INST: vlsb.v v8, (a0), a1, v0.t -# CHECK-ENCODING: [0x07,0x04,0xb5,0x18] +vle128ff.v v8, (a0), v0.t +# CHECK-INST: vle128ff.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x04,0x05,0x11] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 b5 18 +# CHECK-UNKNOWN: 07 04 05 11 -vlsb.v v8, (a0), a1 -# CHECK-INST: vlsb.v v8, (a0), a1 -# CHECK-ENCODING: [0x07,0x04,0xb5,0x1a] +vle128ff.v v8, (a0) +# CHECK-INST: vle128ff.v v8, (a0) +# CHECK-ENCODING: [0x07,0x04,0x05,0x13] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 b5 1a +# CHECK-UNKNOWN: 07 04 05 13 -vlsh.v v8, (a0), a1, v0.t -# CHECK-INST: vlsh.v v8, (a0), a1, v0.t -# CHECK-ENCODING: [0x07,0x54,0xb5,0x18] +vle256ff.v v8, (a0), v0.t +# CHECK-INST: vle256ff.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x54,0x05,0x11] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 b5 18 +# CHECK-UNKNOWN: 07 54 05 11 -vlsh.v v8, (a0), a1 -# CHECK-INST: vlsh.v v8, (a0), a1 -# CHECK-ENCODING: [0x07,0x54,0xb5,0x1a] +vle256ff.v v8, (a0) +# CHECK-INST: vle256ff.v v8, (a0) +# CHECK-ENCODING: [0x07,0x54,0x05,0x13] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 b5 1a +# CHECK-UNKNOWN: 07 54 05 13 -vlsw.v v8, (a0), a1, v0.t -# CHECK-INST: vlsw.v v8, (a0), a1, v0.t -# CHECK-ENCODING: [0x07,0x64,0xb5,0x18] +vle512ff.v v8, (a0), v0.t +# CHECK-INST: vle512ff.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x64,0x05,0x11] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 b5 18 +# CHECK-UNKNOWN: 07 64 05 11 -vlsw.v v8, (a0), a1 -# CHECK-INST: vlsw.v v8, (a0), a1 -# CHECK-ENCODING: [0x07,0x64,0xb5,0x1a] +vle512ff.v v8, (a0) +# CHECK-INST: vle512ff.v v8, (a0) +# CHECK-ENCODING: [0x07,0x64,0x05,0x13] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 b5 1a +# CHECK-UNKNOWN: 07 64 05 13 + +vle1024ff.v v8, (a0), v0.t +# CHECK-INST: vle1024ff.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x74,0x05,0x11] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 05 11 + +vle1024ff.v v8, (a0) +# CHECK-INST: vle1024ff.v v8, (a0) +# CHECK-ENCODING: [0x07,0x74,0x05,0x13] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 05 13 -vlsbu.v v8, (a0), a1, v0.t -# CHECK-INST: vlsbu.v v8, (a0), a1, v0.t +vlse8.v v8, (a0), a1, v0.t +# CHECK-INST: vlse8.v v8, (a0), a1, v0.t # CHECK-ENCODING: [0x07,0x04,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 b5 08 -vlsbu.v v8, (a0), a1 -# CHECK-INST: vlsbu.v v8, (a0), a1 +vlse8.v v8, (a0), a1 +# CHECK-INST: vlse8.v v8, (a0), a1 # CHECK-ENCODING: [0x07,0x04,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 b5 0a -vlshu.v v8, (a0), a1, v0.t -# CHECK-INST: vlshu.v v8, (a0), a1, v0.t +vlse16.v v8, (a0), a1, v0.t +# CHECK-INST: vlse16.v v8, (a0), a1, v0.t # CHECK-ENCODING: [0x07,0x54,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 b5 08 -vlshu.v v8, (a0), a1 -# CHECK-INST: vlshu.v v8, (a0), a1 +vlse16.v v8, (a0), a1 +# CHECK-INST: vlse16.v v8, (a0), a1 # CHECK-ENCODING: [0x07,0x54,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 b5 0a -vlswu.v v8, (a0), a1, v0.t -# CHECK-INST: vlswu.v v8, (a0), a1, v0.t +vlse32.v v8, (a0), a1, v0.t +# CHECK-INST: vlse32.v v8, (a0), a1, v0.t # CHECK-ENCODING: [0x07,0x64,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 b5 08 -vlswu.v v8, (a0), a1 -# CHECK-INST: vlswu.v v8, (a0), a1 +vlse32.v v8, (a0), a1 +# CHECK-INST: vlse32.v v8, (a0), a1 # CHECK-ENCODING: [0x07,0x64,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 b5 0a -vlse.v v8, (a0), a1, v0.t -# CHECK-INST: vlse.v v8, (a0), a1, v0.t +vlse64.v v8, (a0), a1, v0.t +# CHECK-INST: vlse64.v v8, (a0), a1, v0.t # CHECK-ENCODING: [0x07,0x74,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 74 b5 08 -vlse.v v8, (a0), a1 -# CHECK-INST: vlse.v v8, (a0), a1 +vlse64.v v8, (a0), a1 +# CHECK-INST: vlse64.v v8, (a0), a1 # CHECK-ENCODING: [0x07,0x74,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 74 b5 0a -vlxb.v v8, (a0), v4, v0.t -# CHECK-INST: vlxb.v v8, (a0), v4, v0.t -# CHECK-ENCODING: [0x07,0x04,0x45,0x1c] +vlse128.v v8, (a0), a1, v0.t +# CHECK-INST: vlse128.v v8, (a0), a1, v0.t +# CHECK-ENCODING: [0x07,0x04,0xb5,0x18] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 45 1c +# CHECK-UNKNOWN: 07 04 b5 18 -vlxb.v v8, (a0), v4 -# CHECK-INST: vlxb.v v8, (a0), v4 -# CHECK-ENCODING: [0x07,0x04,0x45,0x1e] +vlse128.v v8, (a0), a1 +# CHECK-INST: vlse128.v v8, (a0), a1 +# CHECK-ENCODING: [0x07,0x04,0xb5,0x1a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 04 45 1e +# CHECK-UNKNOWN: 07 04 b5 1a -vlxh.v v8, (a0), v4, v0.t -# CHECK-INST: vlxh.v v8, (a0), v4, v0.t -# CHECK-ENCODING: [0x07,0x54,0x45,0x1c] +vlse256.v v8, (a0), a1, v0.t +# CHECK-INST: vlse256.v v8, (a0), a1, v0.t +# CHECK-ENCODING: [0x07,0x54,0xb5,0x18] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 45 1c +# CHECK-UNKNOWN: 07 54 b5 18 -vlxh.v v8, (a0), v4 -# CHECK-INST: vlxh.v v8, (a0), v4 -# CHECK-ENCODING: [0x07,0x54,0x45,0x1e] +vlse256.v v8, (a0), a1 +# CHECK-INST: vlse256.v v8, (a0), a1 +# CHECK-ENCODING: [0x07,0x54,0xb5,0x1a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 54 45 1e +# CHECK-UNKNOWN: 07 54 b5 1a -vlxw.v v8, (a0), v4, v0.t -# CHECK-INST: vlxw.v v8, (a0), v4, v0.t -# CHECK-ENCODING: [0x07,0x64,0x45,0x1c] +vlse512.v v8, (a0), a1, v0.t +# CHECK-INST: vlse512.v v8, (a0), a1, v0.t +# CHECK-ENCODING: [0x07,0x64,0xb5,0x18] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 45 1c +# CHECK-UNKNOWN: 07 64 b5 18 -vlxw.v v8, (a0), v4 -# CHECK-INST: vlxw.v v8, (a0), v4 -# CHECK-ENCODING: [0x07,0x64,0x45,0x1e] +vlse512.v v8, (a0), a1 +# CHECK-INST: vlse512.v v8, (a0), a1 +# CHECK-ENCODING: [0x07,0x64,0xb5,0x1a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 64 45 1e +# CHECK-UNKNOWN: 07 64 b5 1a + +vlse1024.v v8, (a0), a1, v0.t +# CHECK-INST: vlse1024.v v8, (a0), a1, v0.t +# CHECK-ENCODING: [0x07,0x74,0xb5,0x18] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 b5 18 -vlxbu.v v8, (a0), v4, v0.t -# CHECK-INST: vlxbu.v v8, (a0), v4, v0.t +vlse1024.v v8, (a0), a1 +# CHECK-INST: vlse1024.v v8, (a0), a1 +# CHECK-ENCODING: [0x07,0x74,0xb5,0x1a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 b5 1a + +vlxei8.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei8.v v8, (a0), v4, v0.t # CHECK-ENCODING: [0x07,0x04,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 45 0c -vlxbu.v v8, (a0), v4 -# CHECK-INST: vlxbu.v v8, (a0), v4 +vlxei8.v v8, (a0), v4 +# CHECK-INST: vlxei8.v v8, (a0), v4 # CHECK-ENCODING: [0x07,0x04,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 04 45 0e -vlxhu.v v8, (a0), v4, v0.t -# CHECK-INST: vlxhu.v v8, (a0), v4, v0.t +vlxei16.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei16.v v8, (a0), v4, v0.t # CHECK-ENCODING: [0x07,0x54,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 45 0c -vlxhu.v v8, (a0), v4 -# CHECK-INST: vlxhu.v v8, (a0), v4 +vlxei16.v v8, (a0), v4 +# CHECK-INST: vlxei16.v v8, (a0), v4 # CHECK-ENCODING: [0x07,0x54,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 54 45 0e -vlxwu.v v8, (a0), v4, v0.t -# CHECK-INST: vlxwu.v v8, (a0), v4, v0.t +vlxei32.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei32.v v8, (a0), v4, v0.t # CHECK-ENCODING: [0x07,0x64,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 45 0c -vlxwu.v v8, (a0), v4 -# CHECK-INST: vlxwu.v v8, (a0), v4 +vlxei32.v v8, (a0), v4 +# CHECK-INST: vlxei32.v v8, (a0), v4 # CHECK-ENCODING: [0x07,0x64,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 64 45 0e -vlxe.v v8, (a0), v4, v0.t -# CHECK-INST: vlxe.v v8, (a0), v4, v0.t +vlxei64.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei64.v v8, (a0), v4, v0.t # CHECK-ENCODING: [0x07,0x74,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 74 45 0c -vlxe.v v8, (a0), v4 -# CHECK-INST: vlxe.v v8, (a0), v4 +vlxei64.v v8, (a0), v4 +# CHECK-INST: vlxei64.v v8, (a0), v4 # CHECK-ENCODING: [0x07,0x74,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 07 74 45 0e +vlxei128.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei128.v v8, (a0), v4, v0.t +# CHECK-ENCODING: [0x07,0x04,0x45,0x1c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 04 45 1c + +vlxei128.v v8, (a0), v4 +# CHECK-INST: vlxei128.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x04,0x45,0x1e] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 04 45 1e + +vlxei256.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei256.v v8, (a0), v4, v0.t +# CHECK-ENCODING: [0x07,0x54,0x45,0x1c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 54 45 1c + +vlxei256.v v8, (a0), v4 +# CHECK-INST: vlxei256.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x54,0x45,0x1e] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 54 45 1e + +vlxei512.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei512.v v8, (a0), v4, v0.t +# CHECK-ENCODING: [0x07,0x64,0x45,0x1c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 64 45 1c + +vlxei512.v v8, (a0), v4 +# CHECK-INST: vlxei512.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x64,0x45,0x1e] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 64 45 1e + +vlxei1024.v v8, (a0), v4, v0.t +# CHECK-INST: vlxei1024.v v8, (a0), v4, v0.t +# CHECK-ENCODING: [0x07,0x74,0x45,0x1c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 45 1c + +vlxei1024.v v8, (a0), v4 +# CHECK-INST: vlxei1024.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x74,0x45,0x1e] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 07 74 45 1e + vl1r.v v8, (a0) # CHECK-INST: vl1r.v v8, (a0) -# CHECK-ENCODING: [0x07,0x74,0x85,0x02] +# CHECK-ENCODING: [0x07,0x04,0x85,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 07 74 85 02 +# CHECK-UNKNOWN: 07 04 85 02 diff --git a/llvm/test/MC/RISCV/rvv/mask.s b/llvm/test/MC/RISCV/rvv/mask.s --- a/llvm/test/MC/RISCV/rvv/mask.s +++ b/llvm/test/MC/RISCV/rvv/mask.s @@ -140,8 +140,8 @@ # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 57 a4 08 52 -vmcpy.m v8, v4 -# CHECK-INST: vmcpy.m v8, v4 +vmmv.m v8, v4 +# CHECK-INST: vmmv.m v8, v4 # CHECK-ENCODING: [0x57,0x24,0x42,0x66] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 57 24 42 66 diff --git a/llvm/test/MC/RISCV/rvv/snippet.s b/llvm/test/MC/RISCV/rvv/snippet.s --- a/llvm/test/MC/RISCV/rvv/snippet.s +++ b/llvm/test/MC/RISCV/rvv/snippet.s @@ -7,8 +7,8 @@ loop: vsetvli a3, a0, e16,m4 # vtype = 16-bit integer vectors # CHECK-INST: d7 76 65 00 vsetvli a3, a0, e16,m4 - vlh.v v4, (a1) # Get 16b vector -# CHECK-INST: 07 d2 05 12 vlh.v v4, (a1) + vle16.v v4, (a1) # Get 16b vector +# CHECK-INST: 07 d2 05 02 vle16.v v4, (a1) slli t1, a3, 1 # Multiply length by two bytes/element # CHECK-INST: 13 93 16 00 slli t1, a3, 1 add a1, a1, t1 # Bump pointer @@ -20,8 +20,8 @@ # CHECK-INST: 57 70 b5 00 vsetvli zero, a0, e32,m8 vsrl.vi v8, v8, 3 # CHECK-INST: 57 b4 81 a2 vsrl.vi v8, v8, 3 - vsw.v v8, (a2) # Store vector of 32b -# CHECK-INST: 27 64 06 02 vsw.v v8, (a2) + vse32.v v8, (a2) # Store vector of 32b +# CHECK-INST: 27 64 06 02 vse32.v v8, (a2) slli t1, a3, 2 # Multiply length by four bytes/element # CHECK-INST: 13 93 26 00 slli t1, a3, 2 add a2, a2, t1 # Bump pointer diff --git a/llvm/test/MC/RISCV/rvv/store.s b/llvm/test/MC/RISCV/rvv/store.s --- a/llvm/test/MC/RISCV/rvv/store.s +++ b/llvm/test/MC/RISCV/rvv/store.s @@ -8,200 +8,296 @@ # RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+experimental-v < %s \ # RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN -vsb.v v24, (a0), v0.t -# CHECK-INST: vsb.v v24, (a0), v0.t +vse8.v v24, (a0), v0.t +# CHECK-INST: vse8.v v24, (a0), v0.t # CHECK-ENCODING: [0x27,0x0c,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c 05 00 -vsb.v v24, (a0) -# CHECK-INST: vsb.v v24, (a0) +vse8.v v24, (a0) +# CHECK-INST: vse8.v v24, (a0) # CHECK-ENCODING: [0x27,0x0c,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c 05 02 -vsh.v v24, (a0), v0.t -# CHECK-INST: vsh.v v24, (a0), v0.t +vse16.v v24, (a0), v0.t +# CHECK-INST: vse16.v v24, (a0), v0.t # CHECK-ENCODING: [0x27,0x5c,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c 05 00 -vsh.v v24, (a0) -# CHECK-INST: vsh.v v24, (a0) +vse16.v v24, (a0) +# CHECK-INST: vse16.v v24, (a0) # CHECK-ENCODING: [0x27,0x5c,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c 05 02 -vsw.v v24, (a0), v0.t -# CHECK-INST: vsw.v v24, (a0), v0.t +vse32.v v24, (a0), v0.t +# CHECK-INST: vse32.v v24, (a0), v0.t # CHECK-ENCODING: [0x27,0x6c,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c 05 00 -vsw.v v24, (a0) -# CHECK-INST: vsw.v v24, (a0) +vse32.v v24, (a0) +# CHECK-INST: vse32.v v24, (a0) # CHECK-ENCODING: [0x27,0x6c,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c 05 02 -vse.v v24, (a0), v0.t -# CHECK-INST: vse.v v24, (a0), v0.t +vse64.v v24, (a0), v0.t +# CHECK-INST: vse64.v v24, (a0), v0.t # CHECK-ENCODING: [0x27,0x7c,0x05,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c 05 00 -vse.v v24, (a0) -# CHECK-INST: vse.v v24, (a0) +vse64.v v24, (a0) +# CHECK-INST: vse64.v v24, (a0) # CHECK-ENCODING: [0x27,0x7c,0x05,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c 05 02 -vssb.v v24, (a0), a1, v0.t -# CHECK-INST: vssb.v v24, (a0), a1, v0.t +vse128.v v24, (a0), v0.t +# CHECK-INST: vse128.v v24, (a0), v0.t +# CHECK-ENCODING: [0x27,0x0c,0x05,0x10] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 0c 05 10 + +vse128.v v24, (a0) +# CHECK-INST: vse128.v v24, (a0) +# CHECK-ENCODING: [0x27,0x0c,0x05,0x12] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 0c 05 12 + +vse256.v v24, (a0), v0.t +# CHECK-INST: vse256.v v24, (a0), v0.t +# CHECK-ENCODING: [0x27,0x5c,0x05,0x10] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 5c 05 10 + +vse256.v v24, (a0) +# CHECK-INST: vse256.v v24, (a0) +# CHECK-ENCODING: [0x27,0x5c,0x05,0x12] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 5c 05 12 + +vse512.v v24, (a0), v0.t +# CHECK-INST: vse512.v v24, (a0), v0.t +# CHECK-ENCODING: [0x27,0x6c,0x05,0x10] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 6c 05 10 + +vse512.v v24, (a0) +# CHECK-INST: vse512.v v24, (a0) +# CHECK-ENCODING: [0x27,0x6c,0x05,0x12] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 6c 05 12 + +vse1024.v v24, (a0), v0.t +# CHECK-INST: vse1024.v v24, (a0), v0.t +# CHECK-ENCODING: [0x27,0x7c,0x05,0x10] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 7c 05 10 + +vse1024.v v24, (a0) +# CHECK-INST: vse1024.v v24, (a0) +# CHECK-ENCODING: [0x27,0x7c,0x05,0x12] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 7c 05 12 + +vsse8.v v24, (a0), a1, v0.t +# CHECK-INST: vsse8.v v24, (a0), a1, v0.t # CHECK-ENCODING: [0x27,0x0c,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c b5 08 -vssb.v v24, (a0), a1 -# CHECK-INST: vssb.v v24, (a0), a1 +vsse8.v v24, (a0), a1 +# CHECK-INST: vsse8.v v24, (a0), a1 # CHECK-ENCODING: [0x27,0x0c,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c b5 0a -vssh.v v24, (a0), a1, v0.t -# CHECK-INST: vssh.v v24, (a0), a1, v0.t +vsse16.v v24, (a0), a1, v0.t +# CHECK-INST: vsse16.v v24, (a0), a1, v0.t # CHECK-ENCODING: [0x27,0x5c,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c b5 08 -vssh.v v24, (a0), a1 -# CHECK-INST: vssh.v v24, (a0), a1 +vsse16.v v24, (a0), a1 +# CHECK-INST: vsse16.v v24, (a0), a1 # CHECK-ENCODING: [0x27,0x5c,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c b5 0a -vssw.v v24, (a0), a1, v0.t -# CHECK-INST: vssw.v v24, (a0), a1, v0.t +vsse32.v v24, (a0), a1, v0.t +# CHECK-INST: vsse32.v v24, (a0), a1, v0.t # CHECK-ENCODING: [0x27,0x6c,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c b5 08 -vssw.v v24, (a0), a1 -# CHECK-INST: vssw.v v24, (a0), a1 +vsse32.v v24, (a0), a1 +# CHECK-INST: vsse32.v v24, (a0), a1 # CHECK-ENCODING: [0x27,0x6c,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c b5 0a -vsse.v v24, (a0), a1, v0.t -# CHECK-INST: vsse.v v24, (a0), a1, v0.t +vsse64.v v24, (a0), a1, v0.t +# CHECK-INST: vsse64.v v24, (a0), a1, v0.t # CHECK-ENCODING: [0x27,0x7c,0xb5,0x08] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c b5 08 -vsse.v v24, (a0), a1 -# CHECK-INST: vsse.v v24, (a0), a1 +vsse64.v v24, (a0), a1 +# CHECK-INST: vsse64.v v24, (a0), a1 # CHECK-ENCODING: [0x27,0x7c,0xb5,0x0a] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c b5 0a -vsxb.v v24, (a0), v4, v0.t -# CHECK-INST: vsxb.v v24, (a0), v4, v0.t +vsse128.v v24, (a0), a1, v0.t +# CHECK-INST: vsse128.v v24, (a0), a1, v0.t +# CHECK-ENCODING: [0x27,0x0c,0xb5,0x18] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 0c b5 18 + +vsse128.v v24, (a0), a1 +# CHECK-INST: vsse128.v v24, (a0), a1 +# CHECK-ENCODING: [0x27,0x0c,0xb5,0x1a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 0c b5 1a + +vsse256.v v24, (a0), a1, v0.t +# CHECK-INST: vsse256.v v24, (a0), a1, v0.t +# CHECK-ENCODING: [0x27,0x5c,0xb5,0x18] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 5c b5 18 + +vsse256.v v24, (a0), a1 +# CHECK-INST: vsse256.v v24, (a0), a1 +# CHECK-ENCODING: [0x27,0x5c,0xb5,0x1a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 5c b5 1a + +vsse512.v v24, (a0), a1, v0.t +# CHECK-INST: vsse512.v v24, (a0), a1, v0.t +# CHECK-ENCODING: [0x27,0x6c,0xb5,0x18] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 6c b5 18 + +vsse512.v v24, (a0), a1 +# CHECK-INST: vsse512.v v24, (a0), a1 +# CHECK-ENCODING: [0x27,0x6c,0xb5,0x1a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 6c b5 1a + +vsse1024.v v24, (a0), a1, v0.t +# CHECK-INST: vsse1024.v v24, (a0), a1, v0.t +# CHECK-ENCODING: [0x27,0x7c,0xb5,0x18] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 7c b5 18 + +vsse1024.v v24, (a0), a1 +# CHECK-INST: vsse1024.v v24, (a0), a1 +# CHECK-ENCODING: [0x27,0x7c,0xb5,0x1a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 27 7c b5 1a + +vsxei8.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei8.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x0c,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c 45 0c -vsxb.v v24, (a0), v4 -# CHECK-INST: vsxb.v v24, (a0), v4 +vsxei8.v v24, (a0), v4 +# CHECK-INST: vsxei8.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x0c,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c 45 0e -vsxh.v v24, (a0), v4, v0.t -# CHECK-INST: vsxh.v v24, (a0), v4, v0.t +vsxei16.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei16.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x5c,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c 45 0c -vsxh.v v24, (a0), v4 -# CHECK-INST: vsxh.v v24, (a0), v4 +vsxei16.v v24, (a0), v4 +# CHECK-INST: vsxei16.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x5c,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c 45 0e -vsxw.v v24, (a0), v4, v0.t -# CHECK-INST: vsxw.v v24, (a0), v4, v0.t +vsxei32.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei32.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x6c,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c 45 0c -vsxw.v v24, (a0), v4 -# CHECK-INST: vsxw.v v24, (a0), v4 +vsxei32.v v24, (a0), v4 +# CHECK-INST: vsxei32.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x6c,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c 45 0e -vsxe.v v24, (a0), v4, v0.t -# CHECK-INST: vsxe.v v24, (a0), v4, v0.t +vsxei64.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei64.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x7c,0x45,0x0c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c 45 0c -vsxe.v v24, (a0), v4 -# CHECK-INST: vsxe.v v24, (a0), v4 +vsxei64.v v24, (a0), v4 +# CHECK-INST: vsxei64.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x7c,0x45,0x0e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c 45 0e -vsuxb.v v24, (a0), v4, v0.t -# CHECK-INST: vsuxb.v v24, (a0), v4, v0.t +vsxei128.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei128.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x0c,0x45,0x1c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c 45 1c -vsuxb.v v24, (a0), v4 -# CHECK-INST: vsuxb.v v24, (a0), v4 +vsxei128.v v24, (a0), v4 +# CHECK-INST: vsxei128.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x0c,0x45,0x1e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 0c 45 1e -vsuxh.v v24, (a0), v4, v0.t -# CHECK-INST: vsuxh.v v24, (a0), v4, v0.t +vsxei256.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei256.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x5c,0x45,0x1c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c 45 1c -vsuxh.v v24, (a0), v4 -# CHECK-INST: vsuxh.v v24, (a0), v4 +vsxei256.v v24, (a0), v4 +# CHECK-INST: vsxei256.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x5c,0x45,0x1e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 5c 45 1e -vsuxw.v v24, (a0), v4, v0.t -# CHECK-INST: vsuxw.v v24, (a0), v4, v0.t +vsxei512.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei512.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x6c,0x45,0x1c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c 45 1c -vsuxw.v v24, (a0), v4 -# CHECK-INST: vsuxw.v v24, (a0), v4 +vsxei512.v v24, (a0), v4 +# CHECK-INST: vsxei512.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x6c,0x45,0x1e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 6c 45 1e -vsuxe.v v24, (a0), v4, v0.t -# CHECK-INST: vsuxe.v v24, (a0), v4, v0.t +vsxei1024.v v24, (a0), v4, v0.t +# CHECK-INST: vsxei1024.v v24, (a0), v4, v0.t # CHECK-ENCODING: [0x27,0x7c,0x45,0x1c] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c 45 1c -vsuxe.v v24, (a0), v4 -# CHECK-INST: vsuxe.v v24, (a0), v4 +vsxei1024.v v24, (a0), v4 +# CHECK-INST: vsxei1024.v v24, (a0), v4 # CHECK-ENCODING: [0x27,0x7c,0x45,0x1e] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 27 7c 45 1e vs1r.v v24, (a0) # CHECK-INST: vs1r.v v24, (a0) -# CHECK-ENCODING: [0x27,0x7c,0x85,0x02] +# CHECK-ENCODING: [0x27,0x0c,0x85,0x02] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) -# CHECK-UNKNOWN: 27 7c 85 02 +# CHECK-UNKNOWN: 27 0c 85 02 diff --git a/llvm/test/MC/RISCV/rvv/vsetvl.s b/llvm/test/MC/RISCV/rvv/vsetvl.s --- a/llvm/test/MC/RISCV/rvv/vsetvl.s +++ b/llvm/test/MC/RISCV/rvv/vsetvl.s @@ -8,12 +8,72 @@ # RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+experimental-v < %s \ # RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN +vsetvli a2, a0, e32,m1 +# CHECK-INST: vsetvli a2, a0, e32,m1 +# CHECK-ENCODING: [0x57,0x76,0x85,0x00] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 85 00 + +vsetvli a2, a0, e32,m2 +# CHECK-INST: vsetvli a2, a0, e32,m2 +# CHECK-ENCODING: [0x57,0x76,0x95,0x00] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 95 00 + vsetvli a2, a0, e32,m4 # CHECK-INST: vsetvli a2, a0, e32,m4 # CHECK-ENCODING: [0x57,0x76,0xa5,0x00] # CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) # CHECK-UNKNOWN: 57 76 a5 00 +vsetvli a2, a0, e32,m8 +# CHECK-INST: vsetvli a2, a0, e32,m8 +# CHECK-ENCODING: [0x57,0x76,0xb5,0x00] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 b5 00 + +vsetvli a2, a0, e32,mf2 +# CHECK-INST: vsetvli a2, a0, e32,mf2 +# CHECK-ENCODING: [0x57,0x76,0xb5,0x02] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 b5 02 + +vsetvli a2, a0, e32,mf4 +# CHECK-INST: vsetvli a2, a0, e32,mf4 +# CHECK-ENCODING: [0x57,0x76,0xa5,0x02] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 a5 02 + +vsetvli a2, a0, e32,mf8 +# CHECK-INST: vsetvli a2, a0, e32,mf8 +# CHECK-ENCODING: [0x57,0x76,0x95,0x02] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 95 02 + +vsetvli a2, a0, e32,m1,ta,ma +# CHECK-INST: vsetvli a2, a0, e32,m1,ta,ma +# CHECK-ENCODING: [0x57,0x76,0x85,0x0c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 85 0c + +vsetvli a2, a0, e32,m1,tu,ma +# CHECK-INST: vsetvli a2, a0, e32,m1,tu,ma +# CHECK-ENCODING: [0x57,0x76,0x85,0x08] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 85 08 + +vsetvli a2, a0, e32,m1,ta,mu +# CHECK-INST: vsetvli a2, a0, e32,m1,ta,mu +# CHECK-ENCODING: [0x57,0x76,0x85,0x04] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 85 04 + +vsetvli a2, a0, e32,m1,tu,mu +# CHECK-INST: vsetvli a2, a0, e32,m1 +# CHECK-ENCODING: [0x57,0x76,0x85,0x00] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Instructions) +# CHECK-UNKNOWN: 57 76 85 00 + vsetvl a2, a0, a1 # CHECK-INST: vsetvl a2, a0, a1 # CHECK-ENCODING: [0x57,0x76,0xb5,0x80]