mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
fix divide and remainder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24628 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
85961d5ec1
commit
bbe1225bf4
@ -339,19 +339,17 @@ SDOperand AlphaDAGToDAGISel::Select(SDOperand Op) {
|
||||
}
|
||||
SDOperand Tmp1 = Select(N->getOperand(0)),
|
||||
Tmp2 = Select(N->getOperand(1)),
|
||||
Addr = CurDAG->getExternalSymbol(opstr, AlphaLowering.getPointerTy());
|
||||
SDOperand Tmp3 = Select(Addr);
|
||||
SDOperand Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R24,
|
||||
Tmp1, SDOperand());
|
||||
Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R25,
|
||||
Tmp2, Chain.getValue(1));
|
||||
Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R27,
|
||||
Tmp3, Chain.getValue(1));
|
||||
Chain = CurDAG->getTargetNode(Alpha::JSRs, MVT::i64, MVT::Flag,
|
||||
CurDAG->getRegister(Alpha::R27, MVT::i64),
|
||||
getI64Imm(0));
|
||||
return CurDAG->getCopyFromReg(Chain.getValue(1), Alpha::R27, MVT::i64,
|
||||
Chain.getValue(1));
|
||||
Addr = Select(CurDAG->getExternalSymbol(opstr,
|
||||
AlphaLowering.getPointerTy()));
|
||||
SDOperand Chain;
|
||||
Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), Alpha::R24, Tmp1,
|
||||
SDOperand(0,0));
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, Tmp2, Chain.getValue(1));
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr, Chain.getValue(1));
|
||||
Chain = CurDAG->getTargetNode(Alpha::JSRsDAG, MVT::Other, MVT::Flag,
|
||||
Chain, Chain.getValue(1));
|
||||
return CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64,
|
||||
Chain.getValue(1));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -429,6 +429,9 @@ let isCall = 1,
|
||||
let isCall = 1, Defs = [R24, R25, R27, R28], Uses = [R24, R25] in
|
||||
def JSRs : MbrForm< 0x1A, 0x01, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr $RD,($RS),$DISP">; //Jump to div or rem
|
||||
|
||||
let isCall = 1, Defs = [R23, R24, R25, R27, R28], Uses = [R24, R25, R27] in
|
||||
def JSRsDAG : MbrForm< 0x1A, 0x01, (ops ), "jsr $$23,($$27),0">; //Jump to div or rem
|
||||
|
||||
def JSR_COROUTINE : MbrForm< 0x1A, 0x03, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr_coroutine $RD,($RS),$DISP">; //Jump to subroutine return
|
||||
def BR : BForm<0x30, "br $RA,$DISP">; //Branch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user