summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-09-24 19:46:56 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-09-24 19:46:56 +0000
commit5e2bacd6be117b8bb859840eec1908e815f8db3c (patch)
tree48fd7d4636a6c97a09d778df84ee8c2dd132785e /llvm/lib/Target
parent783a4a9d86565b5993efbb86c401097579d04369 (diff)
downloadbcm5719-llvm-5e2bacd6be117b8bb859840eec1908e815f8db3c.tar.gz
bcm5719-llvm-5e2bacd6be117b8bb859840eec1908e815f8db3c.zip
Fix jump tables to match gcc (and the ABI and whatnot)
llvm-svn: 30594
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Alpha/AlphaISelLowering.cpp4
-rw-r--r--llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp2
-rw-r--r--llvm/lib/Target/Alpha/AlphaTargetMachine.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp
index bcd60ed7535..cbbad532855 100644
--- a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp
+++ b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp
@@ -129,6 +129,8 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
setOperationAction(ISD::RET, MVT::Other, Custom);
setOperationAction(ISD::JumpTable, MVT::i64, Custom);
+ setOperationAction(ISD::JumpTable, MVT::i32, Custom);
+ setOperationAction(ISD::JumpTableRelocBase, MVT::i64, Custom);
setStackPointerRegisterToSaveRestore(Alpha::R30);
@@ -412,6 +414,8 @@ SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
GP, RA);
case ISD::RET: return LowerRET(Op,DAG, getVRegRA());
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
+ case ISD::JumpTableRelocBase:
+ return DAG.getNode(AlphaISD::GlobalBaseReg, MVT::i64);
case ISD::SINT_TO_FP: {
assert(MVT::i64 == Op.getOperand(0).getValueType() &&
diff --git a/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp b/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
index fd77b87f2d9..ed8f6cbe4aa 100644
--- a/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
+++ b/llvm/lib/Target/Alpha/AlphaTargetAsmInfo.cpp
@@ -18,4 +18,6 @@ using namespace llvm;
AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) {
AlignmentIsInBytes = false;
PrivateGlobalPrefix = "$";
+ JumpTableDirective = ".gprel32";
+ JumpTableTextSection = "\t.section .rodata\n";
}
diff --git a/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp b/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
index 6204998b240..a1aab94d9a9 100644
--- a/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
+++ b/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
@@ -59,6 +59,7 @@ AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
Subtarget(M, FS) {
+ setRelocationModel(Reloc::PIC_);
}
OpenPOWER on IntegriCloud