aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2007-02-27 13:01:19 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2007-02-27 13:01:19 +0000
commit63f8fb1993bf2b4286c5a6763e2eee414a751699 (patch)
tree2b6aee5cba5a8480023b71dd4b5438cf4d7dac71
parentd313a9b1484c52e3f784de5064ce86bdbd9b26dc (diff)
downloadexternal_llvm-63f8fb1993bf2b4286c5a6763e2eee414a751699.zip
external_llvm-63f8fb1993bf2b4286c5a6763e2eee414a751699.tar.gz
external_llvm-63f8fb1993bf2b4286c5a6763e2eee414a751699.tar.bz2
Differentiate between the MachO and the ELF ABI the CALL instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34667 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPCISelLowering.cpp5
-rw-r--r--lib/Target/PowerPC/PPCISelLowering.h2
-rw-r--r--lib/Target/PowerPC/PPCInstr64Bit.td5
-rw-r--r--lib/Target/PowerPC/PPCInstrInfo.td12
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index 13cdadc..c29364c 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -326,7 +326,8 @@ const char *PPCTargetLowering::getTargetNodeName(unsigned Opcode) const {
case PPCISD::SHL: return "PPCISD::SHL";
case PPCISD::EXTSW_32: return "PPCISD::EXTSW_32";
case PPCISD::STD_32: return "PPCISD::STD_32";
- case PPCISD::CALL: return "PPCISD::CALL";
+ case PPCISD::CALL_ELF: return "PPCISD::CALL_ELF";
+ case PPCISD::CALL_Macho: return "PPCISD::CALL_Macho";
case PPCISD::MTCTR: return "PPCISD::MTCTR";
case PPCISD::BCTRL_Macho: return "PPCISD::BCTRL_Macho";
case PPCISD::BCTRL_ELF: return "PPCISD::BCTRL_ELF";
@@ -1510,7 +1511,7 @@ static SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG,
NodeTys.push_back(MVT::Flag); // Returns a flag for retval copy to use.
SmallVector<SDOperand, 8> Ops;
- unsigned CallOpc = PPCISD::CALL;
+ unsigned CallOpc = isMachoABI? PPCISD::CALL_Macho : PPCISD::CALL_ELF;
// If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
// direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
diff --git a/lib/Target/PowerPC/PPCISelLowering.h b/lib/Target/PowerPC/PPCISelLowering.h
index 00e65f6..676e0bc 100644
--- a/lib/Target/PowerPC/PPCISelLowering.h
+++ b/lib/Target/PowerPC/PPCISelLowering.h
@@ -82,7 +82,7 @@ namespace llvm {
STD_32,
/// CALL - A direct function call.
- CALL,
+ CALL_Macho, CALL_ELF,
/// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a
/// MTCTR instruction.
diff --git a/lib/Target/PowerPC/PPCInstr64Bit.td b/lib/Target/PowerPC/PPCInstr64Bit.td
index 57bb9da..50c47fd 100644
--- a/lib/Target/PowerPC/PPCInstr64Bit.td
+++ b/lib/Target/PowerPC/PPCInstr64Bit.td
@@ -102,7 +102,7 @@ let isCall = 1, noResults = 1, PPC970_Unit = 7,
def BLA8_ELF : IForm<18, 1, 1,
(ops aaddr:$func, variable_ops),
- "bla $func", BrB, [/*(PPCcall_ELF (i64 imm:$func))*/]>;
+ "bla $func", BrB, [(PPCcall_ELF (i64 imm:$func))]>;
}
@@ -111,12 +111,11 @@ def : Pat<(PPCcall_Macho (i64 tglobaladdr:$dst)),
(BL8_Macho tglobaladdr:$dst)>;
def : Pat<(PPCcall_Macho (i64 texternalsym:$dst)),
(BL8_Macho texternalsym:$dst)>;
-/*
+
def : Pat<(PPCcall_ELF (i64 tglobaladdr:$dst)),
(BL8_ELF tglobaladdr:$dst)>;
def : Pat<(PPCcall_ELF (i64 texternalsym:$dst)),
(BL8_ELF texternalsym:$dst)>;
-*/
//===----------------------------------------------------------------------===//
// 64-bit SPR manipulation instrs.
diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td
index fee3e72..cfdb378 100644
--- a/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/lib/Target/PowerPC/PPCInstrInfo.td
@@ -81,9 +81,9 @@ def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeq,
[SDNPHasChain, SDNPOutFlag]>;
def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisInt<0>]>;
-def PPCcall_Macho : SDNode<"PPCISD::CALL", SDT_PPCCall,
+def PPCcall_Macho : SDNode<"PPCISD::CALL_Macho", SDT_PPCCall,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
-def PPCcall_ELF : SDNode<"PPCISD::CALL", SDT_PPCCall,
+def PPCcall_ELF : SDNode<"PPCISD::CALL_ELF", SDT_PPCCall,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
def PPCmtctr : SDNode<"PPCISD::MTCTR", SDT_PPCCall,
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
@@ -407,11 +407,11 @@ let isCall = 1, noResults = 1, PPC970_Unit = 7,
def BLA_ELF : IForm<18, 1, 1,
(ops aaddr:$func, variable_ops),
"bla $func", BrB,
- [/*(PPCcall_ELF (i32 imm:$func))*/]>;
+ [(PPCcall_ELF (i32 imm:$func))]>;
def BCTRL_ELF : XLForm_2_ext<19, 528, 20, 0, 1,
(ops variable_ops),
"bctrl", BrB,
- [/*(PPCbctrl_ELF)*/]>;
+ [(PPCbctrl_ELF)]>;
}
// DCB* instructions.
@@ -1101,10 +1101,10 @@ def : Pat<(PPCcall_Macho (i32 tglobaladdr:$dst)),
(BL_Macho tglobaladdr:$dst)>;
def : Pat<(PPCcall_Macho (i32 texternalsym:$dst)),
(BL_Macho texternalsym:$dst)>;
-/*def : Pat<(PPCcall_ELF (i32 tglobaladdr:$dst)),
+def : Pat<(PPCcall_ELF (i32 tglobaladdr:$dst)),
(BL_ELF tglobaladdr:$dst)>;
def : Pat<(PPCcall_ELF (i32 texternalsym:$dst)),
- (BL_ELF texternalsym:$dst)>;*/
+ (BL_ELF texternalsym:$dst)>;
// Hi and Lo for Darwin Global Addresses.
def : Pat<(PPChi tglobaladdr:$in, 0), (LIS tglobaladdr:$in)>;