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 @@ -190,14 +190,14 @@ class VUnitStrideLoad : RVInstVLU<0b000, width.Value{3}, LUMOPUnitStride, width.Value{2-0}, (outs VR:$vd), - (ins GPRMem:$rs1, VMaskOp:$vm), opcodestr, "$vd, (${rs1})$vm">; + (ins GPRMemZeroOffset:$rs1, VMaskOp:$vm), opcodestr, "$vd, ${rs1}$vm">; let vm = 1, RVVConstraint = NoConstraint in { // unit-stride whole register load vlr.v vd, (rs1) class VWholeLoad nf, RISCVWidth width, string opcodestr, RegisterClass VRC> : RVInstVLU { + width.Value{2-0}, (outs VRC:$vd), (ins GPRMemZeroOffset:$rs1), + opcodestr, "$vd, $rs1"> { let Uses = []; } @@ -205,110 +205,110 @@ class VUnitStrideLoadMask : RVInstVLU<0b000, LSWidth8.Value{3}, LUMOPUnitStrideMask, LSWidth8.Value{2-0}, (outs VR:$vd), - (ins GPRMem:$rs1), opcodestr, "$vd, (${rs1})">; + (ins GPRMemZeroOffset:$rs1), opcodestr, "$vd, $rs1">; } // vm = 1, RVVConstraint = NoConstraint // unit-stride fault-only-first load vd, (rs1), vm class VUnitStrideLoadFF : RVInstVLU<0b000, width.Value{3}, LUMOPUnitStrideFF, width.Value{2-0}, (outs VR:$vd), - (ins GPRMem:$rs1, VMaskOp:$vm), opcodestr, "$vd, (${rs1})$vm">; + (ins GPRMemZeroOffset:$rs1, VMaskOp:$vm), opcodestr, "$vd, ${rs1}$vm">; // strided load vd, (rs1), rs2, vm class VStridedLoad : RVInstVLS<0b000, width.Value{3}, width.Value{2-0}, (outs VR:$vd), - (ins GPRMem:$rs1, GPR:$rs2, VMaskOp:$vm), opcodestr, - "$vd, (${rs1}), $rs2$vm">; + (ins GPRMemZeroOffset:$rs1, GPR:$rs2, VMaskOp:$vm), opcodestr, + "$vd, $rs1, $rs2$vm">; // indexed load vd, (rs1), vs2, vm class VIndexedLoad : RVInstVLX<0b000, width.Value{3}, mop, width.Value{2-0}, (outs VR:$vd), - (ins GPRMem:$rs1, VR:$vs2, VMaskOp:$vm), opcodestr, - "$vd, (${rs1}), $vs2$vm">; + (ins GPRMemZeroOffset:$rs1, VR:$vs2, VMaskOp:$vm), opcodestr, + "$vd, $rs1, $vs2$vm">; // unit-stride segment load vd, (rs1), vm class VUnitStrideSegmentLoad nf, RISCVWidth width, string opcodestr> : RVInstVLU; + (ins GPRMemZeroOffset:$rs1, VMaskOp:$vm), opcodestr, "$vd, ${rs1}$vm">; // segment fault-only-first load vd, (rs1), vm class VUnitStrideSegmentLoadFF nf, RISCVWidth width, string opcodestr> : RVInstVLU; + (ins GPRMemZeroOffset:$rs1, VMaskOp:$vm), opcodestr, "$vd, ${rs1}$vm">; // strided segment load vd, (rs1), rs2, vm class VStridedSegmentLoad nf, RISCVWidth width, string opcodestr> : RVInstVLS; + (ins GPRMemZeroOffset:$rs1, GPR:$rs2, VMaskOp:$vm), opcodestr, + "$vd, $rs1, $rs2$vm">; // indexed segment load vd, (rs1), vs2, vm class VIndexedSegmentLoad nf, RISCVMOP mop, RISCVWidth width, string opcodestr> : RVInstVLX; + (ins GPRMemZeroOffset:$rs1, VR:$vs2, VMaskOp:$vm), opcodestr, + "$vd, $rs1, $vs2$vm">; } // hasSideEffects = 0, mayLoad = 1, mayStore = 0 let hasSideEffects = 0, mayLoad = 0, mayStore = 1 in { // unit-stride store vd, vs3, (rs1), vm class VUnitStrideStore : RVInstVSU<0b000, width.Value{3}, SUMOPUnitStride, width.Value{2-0}, - (outs), (ins VR:$vs3, GPRMem:$rs1, VMaskOp:$vm), opcodestr, - "$vs3, (${rs1})$vm">; + (outs), (ins VR:$vs3, GPRMemZeroOffset:$rs1, VMaskOp:$vm), opcodestr, + "$vs3, ${rs1}$vm">; let vm = 1 in { // vsr.v vd, (rs1) class VWholeStore nf, string opcodestr, RegisterClass VRC> : RVInstVSU { + 0b000, (outs), (ins VRC:$vs3, GPRMemZeroOffset:$rs1), + opcodestr, "$vs3, $rs1"> { let Uses = []; } // unit-stride mask store vd, vs3, (rs1) class VUnitStrideStoreMask : RVInstVSU<0b000, LSWidth8.Value{3}, SUMOPUnitStrideMask, LSWidth8.Value{2-0}, - (outs), (ins VR:$vs3, GPRMem:$rs1), opcodestr, - "$vs3, (${rs1})">; + (outs), (ins VR:$vs3, GPRMemZeroOffset:$rs1), opcodestr, + "$vs3, $rs1">; } // vm = 1 // strided store vd, vs3, (rs1), rs2, vm class VStridedStore : RVInstVSS<0b000, width.Value{3}, width.Value{2-0}, (outs), - (ins VR:$vs3, GPRMem:$rs1, GPR:$rs2, VMaskOp:$vm), - opcodestr, "$vs3, (${rs1}), $rs2$vm">; + (ins VR:$vs3, GPRMemZeroOffset:$rs1, GPR:$rs2, VMaskOp:$vm), + opcodestr, "$vs3, $rs1, $rs2$vm">; // indexed store vd, vs3, (rs1), vs2, vm class VIndexedStore : RVInstVSX<0b000, width.Value{3}, mop, width.Value{2-0}, (outs), - (ins VR:$vs3, GPRMem:$rs1, VR:$vs2, VMaskOp:$vm), - opcodestr, "$vs3, (${rs1}), $vs2$vm">; + (ins VR:$vs3, GPRMemZeroOffset:$rs1, VR:$vs2, VMaskOp:$vm), + opcodestr, "$vs3, $rs1, $vs2$vm">; // segment store vd, vs3, (rs1), vm class VUnitStrideSegmentStore nf, RISCVWidth width, string opcodestr> : RVInstVSU; + (outs), (ins VR:$vs3, GPRMemZeroOffset:$rs1, VMaskOp:$vm), opcodestr, + "$vs3, ${rs1}$vm">; // segment store vd, vs3, (rs1), rs2, vm class VStridedSegmentStore nf, RISCVWidth width, string opcodestr> : RVInstVSS; + (ins VR:$vs3, GPRMemZeroOffset:$rs1, GPR:$rs2, VMaskOp:$vm), + opcodestr, "$vs3, $rs1, $rs2$vm">; // segment store vd, vs3, (rs1), vs2, vm class VIndexedSegmentStore nf, RISCVMOP mop, RISCVWidth width, string opcodestr> : RVInstVSX; + (ins VR:$vs3, GPRMemZeroOffset:$rs1, VR:$vs2, VMaskOp:$vm), + opcodestr, "$vs3, $rs1, $vs2$vm">; } // hasSideEffects = 0, mayLoad = 0, mayStore = 1 let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in { 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 @@ -355,3 +355,39 @@ # CHECK-ENCODING: [0x07,0x74,0x85,0xe2] # CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors) or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} # CHECK-UNKNOWN: 07 74 85 e2 + +vlm.v v0, 0(a0) +# CHECK-INST: vlm.v v0, (a0) +# CHECK-ENCODING: [0x07,0x00,0xb5,0x02] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 00 b5 02 + +vle8.v v8, 0(a0) +# CHECK-INST: vle8.v v8, (a0) +# CHECK-ENCODING: [0x07,0x04,0x05,0x02] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 04 05 02 + +vle8ff.v v8, 0(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 Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 04 05 01 + +vlse16.v v8, 0(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 Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 54 b5 08 + +vluxei32.v v8, 0(a0), v4 +# CHECK-INST: vluxei32.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x64,0x45,0x06] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 64 45 06 + +vloxei64.v v8, 0(a0), v4 +# CHECK-INST: vloxei64.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x74,0x45,0x0e] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors) or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 74 45 0e 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 @@ -229,3 +229,33 @@ # CHECK-ENCODING: [0x27,0x0c,0x85,0xe2] # CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} # CHECK-UNKNOWN: 27 0c 85 e2 + +vsm.v v24, 0(a0) +# CHECK-INST: vsm.v v24, (a0) +# CHECK-ENCODING: [0x27,0x0c,0xb5,0x02] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 0c b5 02 + +vse8.v v24, 0(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 Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 0c 05 00 + +vsse16.v v24, 0(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 Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 5c b5 08 + +vsuxei8.v v24, 0(a0), v4, v0.t +# CHECK-INST: vsuxei8.v v24, (a0), v4, v0.t +# CHECK-ENCODING: [0x27,0x0c,0x45,0x04] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 0c 45 04 + +vsoxei32.v v24, 0(a0), v4, v0.t +# CHECK-INST: vsoxei32.v v24, (a0), v4, v0.t +# CHECK-ENCODING: [0x27,0x6c,0x45,0x0c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 6c 45 0c diff --git a/llvm/test/MC/RISCV/rvv/zvlsseg.s b/llvm/test/MC/RISCV/rvv/zvlsseg.s --- a/llvm/test/MC/RISCV/rvv/zvlsseg.s +++ b/llvm/test/MC/RISCV/rvv/zvlsseg.s @@ -3032,3 +3032,57 @@ # CHECK-ENCODING: [0x27,0x7c,0x45,0xee] # CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors) or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} # CHECK-UNKNOWN: 27 7c 45 ee + +vlseg2e8.v v8, 0(a0), v0.t +# CHECK-INST: vlseg2e8.v v8, (a0), v0.t +# CHECK-ENCODING: [0x07,0x04,0x05,0x20] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 04 05 20 + +vlseg2e16ff.v v8, 0(a0) +# CHECK-INST: vlseg2e16ff.v v8, (a0) +# CHECK-ENCODING: [0x07,0x54,0x05,0x23] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 54 05 23 + +vlsseg2e8.v v8, 0(a0), a1 +# CHECK-INST: vlsseg2e8.v v8, (a0), a1 +# CHECK-ENCODING: [0x07,0x04,0xb5,0x2a] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 04 b5 2a + +vluxseg3ei16.v v8, 0(a0), v4 +# CHECK-INST: vluxseg3ei16.v v8, (a0), v4 +# CHECK-ENCODING: [0x07,0x54,0x45,0x46] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 54 45 46 + +vloxseg4ei64.v v8, 0(a0), v4, v0.t +# CHECK-INST: vloxseg4ei64.v v8, (a0), v4, v0.t +# CHECK-ENCODING: [0x07,0x74,0x45,0x6c] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors) or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 07 74 45 6c + +vsseg5e32.v v24, 0(a0), v0.t +# CHECK-INST: vsseg5e32.v v24, (a0), v0.t +# CHECK-ENCODING: [0x27,0x6c,0x05,0x80] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 6c 05 80 + +vssseg2e8.v v24, 0(a0), a1, v0.t +# CHECK-INST: vssseg2e8.v v24, (a0), a1, v0.t +# CHECK-ENCODING: [0x27,0x0c,0xb5,0x28] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 0c b5 28 + +vsoxseg7ei16.v v24, 0(a0), v4 +# CHECK-INST: vsoxseg7ei16.v v24, (a0), v4 +# CHECK-ENCODING: [0x27,0x5c,0x45,0xce] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 5c 45 ce + +vsuxseg6ei32.v v24, 0(a0), v4, v0.t +# CHECK-INST: vsuxseg6ei32.v v24, (a0), v4, v0.t +# CHECK-ENCODING: [0x27,0x6c,0x45,0xa4] +# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}} +# CHECK-UNKNOWN: 27 6c 45 a4