mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
"on the rare occasion the SPU BE produces illegal assembly - it tries to emit an add instruction of the form 'a reg, reg, imm'."
Patch by Kalle Raiskila! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103021 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -941,13 +941,21 @@ SPUDAGToDAGISel::Select(SDNode *N) {
|
||||
&& ((RN = dyn_cast<RegisterSDNode>(Op0.getNode())) != 0
|
||||
&& RN->getReg() != SPU::R1))) {
|
||||
NewOpc = SPU::Ar32;
|
||||
Ops[1] = Op1;
|
||||
if (Op1.getOpcode() == ISD::Constant) {
|
||||
ConstantSDNode *CN = cast<ConstantSDNode>(Op1);
|
||||
Op1 = CurDAG->getTargetConstant(CN->getSExtValue(), VT);
|
||||
NewOpc = (isI32IntS10Immediate(CN) ? SPU::AIr32 : SPU::Ar32);
|
||||
if (isInt<10>(CN->getSExtValue())) {
|
||||
NewOpc = SPU::AIr32;
|
||||
Ops[1] = Op1;
|
||||
} else {
|
||||
Ops[1] = SDValue(CurDAG->getMachineNode(SPU::ILr32, dl,
|
||||
N->getValueType(0),
|
||||
Op1),
|
||||
0);
|
||||
}
|
||||
}
|
||||
Ops[0] = Op0;
|
||||
Ops[1] = Op1;
|
||||
n_ops = 2;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user