mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
Fix pifft by correcting the case when a i64/f64 straddles O5 and memory:
we were storing into [FP+88] instead of [FP+92]. Improve codegen by emitting [FP+92], instead of emitting a copy of FP into another GPR which wouldn't be coallesced because FP isn't register allocated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -456,6 +456,8 @@ SparcV8TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
|
|||||||
|
|
||||||
if (RegValuesToPass.size() >= 6) {
|
if (RegValuesToPass.size() >= 6) {
|
||||||
ValToStore = Lo;
|
ValToStore = Lo;
|
||||||
|
ArgOffset += 4;
|
||||||
|
ObjSize = 4;
|
||||||
} else {
|
} else {
|
||||||
RegValuesToPass.push_back(Lo);
|
RegValuesToPass.push_back(Lo);
|
||||||
}
|
}
|
||||||
@@ -464,7 +466,7 @@ SparcV8TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
|
|||||||
|
|
||||||
if (ValToStore.Val) {
|
if (ValToStore.Val) {
|
||||||
if (!StackPtr.Val) {
|
if (!StackPtr.Val) {
|
||||||
StackPtr = DAG.getCopyFromReg(DAG.getEntryNode(), V8::O6, MVT::i32);
|
StackPtr = DAG.getRegister(V8::O6, MVT::i32);
|
||||||
NullSV = DAG.getSrcValue(NULL);
|
NullSV = DAG.getSrcValue(NULL);
|
||||||
}
|
}
|
||||||
SDOperand PtrOff = DAG.getConstant(ArgOffset, getPointerTy());
|
SDOperand PtrOff = DAG.getConstant(ArgOffset, getPointerTy());
|
||||||
@@ -893,6 +895,7 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
|
|||||||
|
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
|
case ISD::Register: return Op;
|
||||||
case ISD::FrameIndex: {
|
case ISD::FrameIndex: {
|
||||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||||
if (N->hasOneUse())
|
if (N->hasOneUse())
|
||||||
|
@@ -456,6 +456,8 @@ SparcV8TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
|
|||||||
|
|
||||||
if (RegValuesToPass.size() >= 6) {
|
if (RegValuesToPass.size() >= 6) {
|
||||||
ValToStore = Lo;
|
ValToStore = Lo;
|
||||||
|
ArgOffset += 4;
|
||||||
|
ObjSize = 4;
|
||||||
} else {
|
} else {
|
||||||
RegValuesToPass.push_back(Lo);
|
RegValuesToPass.push_back(Lo);
|
||||||
}
|
}
|
||||||
@@ -464,7 +466,7 @@ SparcV8TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
|
|||||||
|
|
||||||
if (ValToStore.Val) {
|
if (ValToStore.Val) {
|
||||||
if (!StackPtr.Val) {
|
if (!StackPtr.Val) {
|
||||||
StackPtr = DAG.getCopyFromReg(DAG.getEntryNode(), V8::O6, MVT::i32);
|
StackPtr = DAG.getRegister(V8::O6, MVT::i32);
|
||||||
NullSV = DAG.getSrcValue(NULL);
|
NullSV = DAG.getSrcValue(NULL);
|
||||||
}
|
}
|
||||||
SDOperand PtrOff = DAG.getConstant(ArgOffset, getPointerTy());
|
SDOperand PtrOff = DAG.getConstant(ArgOffset, getPointerTy());
|
||||||
@@ -893,6 +895,7 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
|
|||||||
|
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
|
case ISD::Register: return Op;
|
||||||
case ISD::FrameIndex: {
|
case ISD::FrameIndex: {
|
||||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||||
if (N->hasOneUse())
|
if (N->hasOneUse())
|
||||||
|
Reference in New Issue
Block a user