[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp PPCISelLowering.h PPCInstr64Bit.td PPCInstrInfo.td
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Feb 27 05:01:36 PST 2007
Changes in directory llvm/lib/Target/PowerPC:
PPCISelLowering.cpp updated: 1.257 -> 1.258
PPCISelLowering.h updated: 1.59 -> 1.60
PPCInstr64Bit.td updated: 1.40 -> 1.41
PPCInstrInfo.td updated: 1.275 -> 1.276
---
Log message:
Differentiate between the MachO and the ELF ABI the CALL instruction.
---
Diffs of the changes: (+12 -12)
PPCISelLowering.cpp | 5 +++--
PPCISelLowering.h | 2 +-
PPCInstr64Bit.td | 5 ++---
PPCInstrInfo.td | 12 ++++++------
4 files changed, 12 insertions(+), 12 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.257 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.258
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.257 Mon Feb 26 13:44:02 2007
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Feb 27 07:01:19 2007
@@ -326,7 +326,8 @@
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 @@
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
Index: llvm/lib/Target/PowerPC/PPCISelLowering.h
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.h:1.59 llvm/lib/Target/PowerPC/PPCISelLowering.h:1.60
--- llvm/lib/Target/PowerPC/PPCISelLowering.h:1.59 Sat Feb 24 23:34:32 2007
+++ llvm/lib/Target/PowerPC/PPCISelLowering.h Tue Feb 27 07:01:19 2007
@@ -82,7 +82,7 @@
STD_32,
/// CALL - A direct function call.
- CALL,
+ CALL_Macho, CALL_ELF,
/// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a
/// MTCTR instruction.
Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td
diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.40 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.41
--- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.40 Sun Feb 25 13:20:53 2007
+++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Feb 27 07:01:19 2007
@@ -102,7 +102,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 @@
(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.
Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.275 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.276
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.275 Mon Feb 26 13:44:02 2007
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Feb 27 07:01:19 2007
@@ -81,9 +81,9 @@
[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 @@
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 @@
(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)>;
More information about the llvm-commits
mailing list