mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fix wrong usages of CTR/MCTR where CTR8/MCTR8 was meant.
- Check for MTCTR8 in addition to MTCTR when looking up a hazard. - When lowering an indirect call use CTR8 when targeting 64bit. - Introduce BCTR8 that uses CTR8 and use it on 64bit when expanding ISD::BRIND. The last change fixes PR8487. With those changes, we are able to compile a running "ls" and "sh" on FreeBSD/PowerPC64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132552 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1057,9 +1057,10 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
||||
SDValue Chain = N->getOperand(0);
|
||||
SDValue Target = N->getOperand(1);
|
||||
unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8;
|
||||
unsigned Reg = Target.getValueType() == MVT::i32 ? PPC::BCTR : PPC::BCTR8;
|
||||
Chain = SDValue(CurDAG->getMachineNode(Opc, dl, MVT::Other, Target,
|
||||
Chain), 0);
|
||||
return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain);
|
||||
return CurDAG->SelectNodeTo(N, Reg, MVT::Other, Chain);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user