Skip to content

Commit

Permalink
[AMDGPU] Add v2i32 to the VS_64 types. NFCI. (llvm#88318)
Browse files Browse the repository at this point in the history
I am trying to use VOP3Inst with intrinsic taking v2i32 operand and it
fails to create patterm without it.
  • Loading branch information
rampitec committed Apr 10, 2024
1 parent af7c196 commit 2fdfea0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions llvm/lib/Target/AMDGPU/SIInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,7 @@ def : GCNPat <
def : GCNPat <
(DivergentUnaryFrag<fneg> (v2f32 VReg_64:$src)),
(V_PK_ADD_F32 11 /* OP_SEL_1 | NEG_LO | HEG_HI */, VReg_64:$src,
11 /* OP_SEL_1 | NEG_LO | HEG_HI */, 0,
11 /* OP_SEL_1 | NEG_LO | HEG_HI */, (i64 0),
0, 0, 0, 0, 0)
> {
let SubtargetPredicate = HasPackedFP32Ops;
Expand Down Expand Up @@ -2999,15 +2999,15 @@ def : GCNPat<
let SubtargetPredicate = HasPackedFP32Ops in {
def : GCNPat<
(fcanonicalize (v2f32 (VOP3PMods v2f32:$src, i32:$src_mods))),
(V_PK_MUL_F32 0, CONST.FP32_ONE, $src_mods, $src)
(V_PK_MUL_F32 0, (i64 CONST.FP32_ONE), $src_mods, $src)
>;
}

// TODO: Handle fneg like other types.
let SubtargetPredicate = isNotGFX12Plus in {
def : GCNPat<
(fcanonicalize (f64 (VOP3Mods f64:$src, i32:$src_mods))),
(V_MUL_F64_e64 0, CONST.FP64_ONE, $src_mods, $src)
(V_MUL_F64_e64 0, (i64 CONST.FP64_ONE), $src_mods, $src)
>;
}
} // End AddedComplexity = -5
Expand Down Expand Up @@ -3369,7 +3369,7 @@ def : GCNPat <
SRCMODS.NONE,
(V_FRACT_F64_e64 $mods, $x),
SRCMODS.NONE,
(V_MOV_B64_PSEUDO 0x3fefffffffffffff)),
(V_MOV_B64_PSEUDO (i64 0x3fefffffffffffff))),
$x,
(V_CMP_CLASS_F64_e64 SRCMODS.NONE, $x, (i32 3 /*NaN*/))))
>;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SIRegisterInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def VS_32_Lo128 : SIRegisterClass<"AMDGPU", [i32, f32, i16, f16, bf16, v2i16, v2
let HasSGPR = 1;
}

def VS_64 : SIRegisterClass<"AMDGPU", [i64, f64, v2f32], 32, (add VReg_64, SReg_64)> {
def VS_64 : SIRegisterClass<"AMDGPU", VReg_64.RegTypes, 32, (add VReg_64, SReg_64)> {
let isAllocatable = 0;
let HasVGPR = 1;
let HasSGPR = 1;
Expand Down

0 comments on commit 2fdfea0

Please sign in to comment.