mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Don't add a default STACK_ALIGN (use the generic ABI alignment)
Implement calls to functions with byval arguments on X86 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
66018ea1b2
commit
a37ac9ff53
@ -182,7 +182,6 @@ void TargetData::init(const std::string &TargetDescription) {
|
|||||||
setAlignment(VECTOR_ALIGN, 8, 8, 64); // v2i32
|
setAlignment(VECTOR_ALIGN, 8, 8, 64); // v2i32
|
||||||
setAlignment(VECTOR_ALIGN, 16, 16, 128); // v16i8, v8i16, v4i32, ...
|
setAlignment(VECTOR_ALIGN, 16, 16, 128); // v16i8, v8i16, v4i32, ...
|
||||||
setAlignment(AGGREGATE_ALIGN, 0, 8, 0); // struct, union, class, ...
|
setAlignment(AGGREGATE_ALIGN, 0, 8, 0); // struct, union, class, ...
|
||||||
setAlignment(STACK_ALIGN, 0, 8, 0); // objects on the stack
|
|
||||||
|
|
||||||
while (!temp.empty()) {
|
while (!temp.empty()) {
|
||||||
std::string token = getToken(temp, "-");
|
std::string token = getToken(temp, "-");
|
||||||
|
@ -859,9 +859,9 @@ SDOperand X86TargetLowering::LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG,
|
|||||||
assert(VA.isMemLoc());
|
assert(VA.isMemLoc());
|
||||||
if (StackPtr.Val == 0)
|
if (StackPtr.Val == 0)
|
||||||
StackPtr = DAG.getRegister(getStackPtrReg(), getPointerTy());
|
StackPtr = DAG.getRegister(getStackPtrReg(), getPointerTy());
|
||||||
SDOperand PtrOff = DAG.getConstant(VA.getLocMemOffset(), getPointerTy());
|
|
||||||
PtrOff = DAG.getNode(ISD::ADD, getPointerTy(), StackPtr, PtrOff);
|
MemOpChains.push_back(LowerMemOpCallTo(Op, DAG, StackPtr, VA, Chain,
|
||||||
MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
|
Arg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1064,7 +1064,6 @@ X86TargetLowering::LowerMemOpCallTo(SDOperand Op, SelectionDAG &DAG,
|
|||||||
unsigned Align = 1 << ((Flags & ISD::ParamFlags::ByValAlign) >>
|
unsigned Align = 1 << ((Flags & ISD::ParamFlags::ByValAlign) >>
|
||||||
ISD::ParamFlags::ByValAlignOffs);
|
ISD::ParamFlags::ByValAlignOffs);
|
||||||
|
|
||||||
assert (Align >= 8);
|
|
||||||
unsigned Size = (Flags & ISD::ParamFlags::ByValSize) >>
|
unsigned Size = (Flags & ISD::ParamFlags::ByValSize) >>
|
||||||
ISD::ParamFlags::ByValSizeOffs;
|
ISD::ParamFlags::ByValSizeOffs;
|
||||||
|
|
||||||
@ -1133,9 +1132,9 @@ SDOperand X86TargetLowering::LowerFastCCCallTo(SDOperand Op, SelectionDAG &DAG,
|
|||||||
assert(VA.isMemLoc());
|
assert(VA.isMemLoc());
|
||||||
if (StackPtr.Val == 0)
|
if (StackPtr.Val == 0)
|
||||||
StackPtr = DAG.getRegister(getStackPtrReg(), getPointerTy());
|
StackPtr = DAG.getRegister(getStackPtrReg(), getPointerTy());
|
||||||
SDOperand PtrOff = DAG.getConstant(VA.getLocMemOffset(), getPointerTy());
|
|
||||||
PtrOff = DAG.getNode(ISD::ADD, getPointerTy(), StackPtr, PtrOff);
|
MemOpChains.push_back(LowerMemOpCallTo(Op, DAG, StackPtr, VA, Chain,
|
||||||
MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
|
Arg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsl | count 2
|
; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsl | count 2
|
||||||
|
; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2
|
||||||
|
|
||||||
%struct.s = type { i64, i64, i64 }
|
%struct.s = type { i64, i64, i64 }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user