Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit b870822

Browse files
R600/SI: add shl pattern
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177275 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2d054cb commit b870822

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

lib/Target/R600/SIISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ EVT SITargetLowering::getSetCCResultType(EVT VT) const {
229229
return MVT::i1;
230230
}
231231

232+
MVT SITargetLowering::getScalarShiftAmountTy(EVT VT) const {
233+
return MVT::i32;
234+
}
235+
232236
//===----------------------------------------------------------------------===//
233237
// Custom DAG Lowering Operations
234238
//===----------------------------------------------------------------------===//

lib/Target/R600/SIISelLowering.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class SITargetLowering : public AMDGPUTargetLowering {
4848
virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr * MI,
4949
MachineBasicBlock * BB) const;
5050
virtual EVT getSetCCResultType(EVT VT) const;
51+
virtual MVT getScalarShiftAmountTy(EVT VT) const;
5152
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
5253
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
5354
virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const;

lib/Target/R600/SIInstructions.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,9 @@ defm V_LSHR_B32 : VOP2_32 <0x00000015, "V_LSHR_B32", []>;
854854
defm V_LSHRREV_B32 : VOP2_32 <0x00000016, "V_LSHRREV_B32", []>;
855855
defm V_ASHR_I32 : VOP2_32 <0x00000017, "V_ASHR_I32", []>;
856856
defm V_ASHRREV_I32 : VOP2_32 <0x00000018, "V_ASHRREV_I32", []>;
857-
defm V_LSHL_B32 : VOP2_32 <0x00000019, "V_LSHL_B32", []>;
857+
defm V_LSHL_B32 : VOP2_32 <0x00000019, "V_LSHL_B32",
858+
[(set VReg_32:$dst, (shl VSrc_32:$src0, (i32 VReg_32:$src1)))]
859+
>;
858860
defm V_LSHLREV_B32 : VOP2_32 <0x0000001a, "V_LSHLREV_B32", []>;
859861

860862
let isCommutable = 1 in {

0 commit comments

Comments
 (0)