summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCInstr64Bit.td
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-25 05:34:32 +0000
committerChris Lattner <sabre@nondot.org>2007-02-25 05:34:32 +0000
commit9f0bc659c8d2f1e401a9690e4900b0fd2a70bdfe (patch)
tree4e65cf82f1e9e276a5f2194e53b67e1e78d018c0 /lib/Target/PowerPC/PPCInstr64Bit.td
parenteb95d41cd364f3526d1c39455a0131185495c51a (diff)
downloadllvm-9f0bc659c8d2f1e401a9690e4900b0fd2a70bdfe.tar.gz
llvm-9f0bc659c8d2f1e401a9690e4900b0fd2a70bdfe.tar.bz2
llvm-9f0bc659c8d2f1e401a9690e4900b0fd2a70bdfe.tar.xz
implement support for the linux/ppc function call ABI. Patch by
Nicolas Geoffray! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34574 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstr64Bit.td')
-rw-r--r--lib/Target/PowerPC/PPCInstr64Bit.td44
1 files changed, 36 insertions, 8 deletions
diff --git a/lib/Target/PowerPC/PPCInstr64Bit.td b/lib/Target/PowerPC/PPCInstr64Bit.td
index 56d02cc146..89e883a696 100644
--- a/lib/Target/PowerPC/PPCInstr64Bit.td
+++ b/lib/Target/PowerPC/PPCInstr64Bit.td
@@ -69,6 +69,7 @@ let Defs = [LR8] in
def MovePCtoLR8 : Pseudo<(ops piclabel:$label), "bl $label", []>,
PPC970_Unit_BRU;
+// Macho ABI Calls.
let isCall = 1, noResults = 1, PPC970_Unit = 7,
// All calls clobber the PPC64 non-callee saved registers.
Defs = [X0,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,
@@ -77,18 +78,45 @@ let isCall = 1, noResults = 1, PPC970_Unit = 7,
LR8,CTR8,
CR0,CR1,CR5,CR6,CR7] in {
// Convenient aliases for call instructions
- def BL8 : IForm<18, 0, 1, (ops calltarget:$func, variable_ops),
- "bl $func", BrB, []>; // See Pat patterns below.
+ def BL8_Macho : IForm<18, 0, 1,
+ (ops calltarget:$func, variable_ops),
+ "bl $func", BrB, []>; // See Pat patterns below.
- def BLA8 : IForm<18, 1, 1, (ops aaddr:$func, variable_ops),
- "bla $func", BrB, [(PPCcall (i64 imm:$func))]>;
+ def BLA8_Macho : IForm<18, 1, 1,
+ (ops aaddr:$func, variable_ops),
+ "bla $func", BrB, [(PPCcall_Macho (i64 imm:$func))]>;
}
+// ELF ABI Calls.
+let isCall = 1, noResults = 1, PPC970_Unit = 7,
+ // All calls clobber the PPC64 non-callee saved registers.
+ Defs = [X0,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,
+ F0,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,
+ V0,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16,V17,V18,V19,
+ LR8,CTR8,
+ CR0,CR1,CR5,CR6,CR7] in {
+ // Convenient aliases for call instructions
+ def BL8_ELF : IForm<18, 0, 1,
+ (ops calltarget:$func, variable_ops),
+ "bl $func", BrB, []>; // See Pat patterns below.
+
+ def BLA8_ELF : IForm<18, 1, 1,
+ (ops aaddr:$func, variable_ops),
+ "bla $func", BrB, [(PPCcall_ELF (i64 imm:$func))]>;
+}
+
+
// Calls
-def : Pat<(PPCcall (i64 tglobaladdr:$dst)),
- (BL8 tglobaladdr:$dst)>;
-def : Pat<(PPCcall (i64 texternalsym:$dst)),
- (BL8 texternalsym:$dst)>;
+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.