mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
47a7e2681e
commit
6b5578f052
@ -2331,14 +2331,13 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TargetLowering::Expand:
|
case TargetLowering::Expand:
|
||||||
unsigned DivOpc= (Node->getOpcode() == ISD::UREM) ? ISD::UDIV : ISD::SREM;
|
unsigned DivOpc= (Node->getOpcode() == ISD::UREM) ? ISD::UDIV : ISD::SDIV;
|
||||||
if (MVT::isInteger(Node->getValueType(0))) {
|
if (MVT::isInteger(Node->getValueType(0))) {
|
||||||
if (TLI.getOperationAction(DivOpc, Node->getValueType(0)) ==
|
if (TLI.getOperationAction(DivOpc, Node->getValueType(0)) ==
|
||||||
TargetLowering::Legal) {
|
TargetLowering::Legal) {
|
||||||
// X % Y -> X-X/Y*Y
|
// X % Y -> X-X/Y*Y
|
||||||
MVT::ValueType VT = Node->getValueType(0);
|
MVT::ValueType VT = Node->getValueType(0);
|
||||||
unsigned Opc = Node->getOpcode() == ISD::UREM ? ISD::UDIV : ISD::SDIV;
|
Result = DAG.getNode(DivOpc, VT, Tmp1, Tmp2);
|
||||||
Result = DAG.getNode(Opc, VT, Tmp1, Tmp2);
|
|
||||||
Result = DAG.getNode(ISD::MUL, VT, Result, Tmp2);
|
Result = DAG.getNode(ISD::MUL, VT, Result, Tmp2);
|
||||||
Result = DAG.getNode(ISD::SUB, VT, Tmp1, Result);
|
Result = DAG.getNode(ISD::SUB, VT, Tmp1, Result);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user