mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Generate a libcall for i8 multiply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77179 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bf36cafb8c
commit
8e14eab07e
@ -928,6 +928,19 @@ SDValue PIC16TargetLowering::LowerShift(SDValue Op, SelectionDAG &DAG) {
|
||||
return Call;
|
||||
}
|
||||
|
||||
SDValue PIC16TargetLowering::LowerMUL(SDValue Op, SelectionDAG &DAG) {
|
||||
// We should have handled larger operands in type legalizer itself.
|
||||
assert (Op.getValueType() == MVT::i8 && "illegal multiply to lower");
|
||||
|
||||
SDNode *N = Op.getNode();
|
||||
SmallVector<SDValue, 2> Ops(2);
|
||||
Ops[0] = N->getOperand(0);
|
||||
Ops[1] = N->getOperand(1);
|
||||
SDValue Call = MakePIC16Libcall(PIC16ISD::MUL_I8, N->getValueType(0),
|
||||
&Ops[0], 2, true, DAG, N->getDebugLoc());
|
||||
return Call;
|
||||
}
|
||||
|
||||
void
|
||||
PIC16TargetLowering::LowerOperationWrapper(SDNode *N,
|
||||
SmallVectorImpl<SDValue>&Results,
|
||||
@ -975,6 +988,8 @@ SDValue PIC16TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) {
|
||||
return ExpandLoad(Op.getNode(), DAG);
|
||||
case ISD::STORE:
|
||||
return ExpandStore(Op.getNode(), DAG);
|
||||
case ISD::MUL:
|
||||
return LowerMUL(Op, DAG);
|
||||
case ISD::SHL:
|
||||
case ISD::SRA:
|
||||
case ISD::SRL:
|
||||
|
@ -84,6 +84,7 @@ namespace llvm {
|
||||
virtual MVT getSetCCResultType(MVT ValType) const;
|
||||
SDValue LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG);
|
||||
SDValue LowerShift(SDValue Op, SelectionDAG &DAG);
|
||||
SDValue LowerMUL(SDValue Op, SelectionDAG &DAG);
|
||||
SDValue LowerADD(SDValue Op, SelectionDAG &DAG);
|
||||
SDValue LowerSUB(SDValue Op, SelectionDAG &DAG);
|
||||
SDValue LowerBinOp(SDValue Op, SelectionDAG &DAG);
|
||||
|
Loading…
Reference in New Issue
Block a user