mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Fix jump tables to match gcc (and the ABI and whatnot)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -129,6 +129,8 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
|
|||||||
setOperationAction(ISD::RET, MVT::Other, Custom);
|
setOperationAction(ISD::RET, MVT::Other, Custom);
|
||||||
|
|
||||||
setOperationAction(ISD::JumpTable, MVT::i64, Custom);
|
setOperationAction(ISD::JumpTable, MVT::i64, Custom);
|
||||||
|
setOperationAction(ISD::JumpTable, MVT::i32, Custom);
|
||||||
|
setOperationAction(ISD::JumpTableRelocBase, MVT::i64, Custom);
|
||||||
|
|
||||||
setStackPointerRegisterToSaveRestore(Alpha::R30);
|
setStackPointerRegisterToSaveRestore(Alpha::R30);
|
||||||
|
|
||||||
@@ -412,6 +414,8 @@ SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
|||||||
GP, RA);
|
GP, RA);
|
||||||
case ISD::RET: return LowerRET(Op,DAG, getVRegRA());
|
case ISD::RET: return LowerRET(Op,DAG, getVRegRA());
|
||||||
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
|
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
|
||||||
|
case ISD::JumpTableRelocBase:
|
||||||
|
return DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64);
|
||||||
|
|
||||||
case ISD::SINT_TO_FP: {
|
case ISD::SINT_TO_FP: {
|
||||||
assert(MVT::i64 == Op.getOperand(0).getValueType() &&
|
assert(MVT::i64 == Op.getOperand(0).getValueType() &&
|
||||||
|
@@ -18,4 +18,6 @@ using namespace llvm;
|
|||||||
AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) {
|
AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) {
|
||||||
AlignmentIsInBytes = false;
|
AlignmentIsInBytes = false;
|
||||||
PrivateGlobalPrefix = "$";
|
PrivateGlobalPrefix = "$";
|
||||||
|
JumpTableDirective = ".gprel32";
|
||||||
|
JumpTableTextSection = "\t.section .rodata\n";
|
||||||
}
|
}
|
||||||
|
@@ -59,6 +59,7 @@ AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
|
|||||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
||||||
JITInfo(*this),
|
JITInfo(*this),
|
||||||
Subtarget(M, FS) {
|
Subtarget(M, FS) {
|
||||||
|
setRelocationModel(Reloc::PIC_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user