Skip to content

Commit cde9365

Browse files
Pravin JagtapPravin Jagtap
authored andcommitted
AMDGPU: Fix regclass check for PackedF32InputMods in AsmParser.
1 parent 22f5268 commit cde9365

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ class AMDGPUOperand : public MCParsedAsmOperand {
337337
return isRegOrImmWithInputMods(AMDGPU::VS_32RegClassID, MVT::v2f16);
338338
}
339339

340-
bool isPackedFP32InputMods() const {
341-
return isRegOrImmWithInputMods(AMDGPU::VS_64RegClassID, MVT::v2f32);
340+
bool isPackedVGPRFP32InputMods() const {
341+
return isRegOrImmWithInputMods(AMDGPU::VReg_64RegClassID, MVT::v2f32);
342342
}
343343

344344
bool isVReg() const {

llvm/lib/Target/AMDGPU/SIInstrInfo.td

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,10 @@ class PackedFPInputModsMatchClass <int opSize> : AsmOperandClass {
15271527
let PredicateMethod = "isPackedFP"#opSize#"InputMods";
15281528
}
15291529

1530+
class PackedVGPRFPInputModsMatchClass <int opSize> : PackedFPInputModsMatchClass<opSize> {
1531+
let PredicateMethod = "isPackedVGPRFP"#opSize#"InputMods";
1532+
}
1533+
15301534
class PackedIntInputModsMatchClass <int opSize> : AsmOperandClass {
15311535
let Name = "PackedInt"#opSize#"InputMods";
15321536
let ParserMethod = "parseRegOrImm";
@@ -1536,7 +1540,7 @@ class PackedIntInputModsMatchClass <int opSize> : AsmOperandClass {
15361540

15371541
def PackedF16InputModsMatchClass : PackedFPInputModsMatchClass<16>;
15381542
def PackedI16InputModsMatchClass : PackedIntInputModsMatchClass<16>;
1539-
def PackedF32InputModsMatchClass : PackedFPInputModsMatchClass<32>;
1543+
def PackedVGPRF32InputModsMatchClass : PackedVGPRFPInputModsMatchClass<32>;
15401544

15411545
class PackedFPInputMods <PackedFPInputModsMatchClass matchClass> : InputMods <matchClass> {
15421546
let PrintMethod = "printOperandAndFPInputMods";
@@ -1548,7 +1552,7 @@ class PackedIntInputMods <PackedIntInputModsMatchClass matchClass> : InputMods <
15481552

15491553
def PackedF16InputMods : PackedFPInputMods<PackedF16InputModsMatchClass>;
15501554
def PackedI16InputMods : PackedIntInputMods<PackedI16InputModsMatchClass>;
1551-
def PackedF32InputMods : PackedFPInputMods<PackedF32InputModsMatchClass>;
1555+
def PackedVGPRF32InputMods : PackedFPInputMods<PackedVGPRF32InputModsMatchClass>;
15521556

15531557
def MFMALdScaleModifierOp : TImmLeaf<i32, [{
15541558
return isUInt<2>(Imm);

llvm/lib/Target/AMDGPU/VOP3Instructions.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ class VOP3_CVT_SCALE_SR_PK_F4_F32_TiedInput_Profile<VOPProfile P>
10571057

10581058
let Src0RC64 = !if(!gt(P.Src0VT.Size, 32), getVOP3VRegSrcForVT<P.Src0VT>.ret,
10591059
getVOP3SrcForVT<P.Src0VT>.ret);
1060-
let InsVOP3OpSel = (ins PackedF32InputMods: $src0_modifiers, Src0RC64:$src0,
1060+
let InsVOP3OpSel = (ins PackedVGPRF32InputMods: $src0_modifiers, Src0RC64:$src0,
10611061
Int32InputMods: $src1_modifiers, Src1RC64:$src1,
10621062
FP32InputMods: $src2_modifiers, Src2RC64:$src2,
10631063
VGPR_32:$vdst_in, op_sel0:$op_sel);

llvm/test/MC/AMDGPU/gfx950_err.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,5 +495,5 @@ v_cvt_scalef32_2xpk16_bf6_f32 v[0:5], s[0:15], v[6:21], v16
495495
// GFX950: :[[@LINE+1]]:{{[0-9]+}}: error: invalid operand for instruction
496496
v_cvt_scalef32_2xpk16_bf6_f32 v[0:5], v[6:21], s[0:15], v16
497497

498-
// GFX950: v_cvt_scalef32_sr_pk_fp4_f32 v0, s[2:3]/*Invalid register, operand has 'VReg_64' register class*/, v4, v5
498+
// GFX950: :[[@LINE+1]]:{{[0-9]+}}: error: invalid operand for instruction
499499
v_cvt_scalef32_sr_pk_fp4_f32 v0, s[2:3], v4, v5

0 commit comments

Comments
 (0)