mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-12 23:37:33 +00:00
Move scalar immediate shift lowering into a dedicated func
- no functionality change git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e170935f41
commit
4b7ab12d93
@ -11491,16 +11491,13 @@ SDValue X86TargetLowering::LowerSDIV(SDValue Op, SelectionDAG &DAG) const {
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
SDValue X86TargetLowering::LowerShift(SDValue Op, SelectionDAG &DAG) const {
|
||||
|
||||
static SDValue LowerScalarImmediateShift(SDValue Op, SelectionDAG &DAG,
|
||||
const X86Subtarget *Subtarget) {
|
||||
EVT VT = Op.getValueType();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
SDValue R = Op.getOperand(0);
|
||||
SDValue Amt = Op.getOperand(1);
|
||||
|
||||
if (!Subtarget->hasSSE2())
|
||||
return SDValue();
|
||||
|
||||
// Optimize shl/srl/sra with constant shift amount.
|
||||
if (isSplatVector(Amt.getNode())) {
|
||||
SDValue SclrAmt = Amt->getOperand(0);
|
||||
@ -11611,6 +11608,24 @@ SDValue X86TargetLowering::LowerShift(SDValue Op, SelectionDAG &DAG) const {
|
||||
}
|
||||
}
|
||||
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
SDValue X86TargetLowering::LowerShift(SDValue Op, SelectionDAG &DAG) const {
|
||||
|
||||
EVT VT = Op.getValueType();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
SDValue R = Op.getOperand(0);
|
||||
SDValue Amt = Op.getOperand(1);
|
||||
SDValue V;
|
||||
|
||||
if (!Subtarget->hasSSE2())
|
||||
return SDValue();
|
||||
|
||||
V = LowerScalarImmediateShift(Op, DAG, Subtarget);
|
||||
if (V.getNode())
|
||||
return V;
|
||||
|
||||
// Lower SHL with variable shift amount.
|
||||
if (VT == MVT::v4i32 && Op->getOpcode() == ISD::SHL) {
|
||||
Op = DAG.getNode(ISD::SHL, dl, VT, Amt, DAG.getConstant(23, VT));
|
||||
|
Loading…
x
Reference in New Issue
Block a user