aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCInstrInfo.td
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-17 07:30:41 +0000
committerChris Lattner <sabre@nondot.org>2005-11-17 07:30:41 +0000
commit860e8862c1fbd3b261da4a64a8c0096f9f373681 (patch)
treeba95a7260d5d7f0c2ef8f5f3f64c65d2d8c86718 /lib/Target/PowerPC/PPCInstrInfo.td
parentdb40dc2d631faa52f4fbe655c5d7677d9b2ede8c (diff)
downloadexternal_llvm-860e8862c1fbd3b261da4a64a8c0096f9f373681.zip
external_llvm-860e8862c1fbd3b261da4a64a8c0096f9f373681.tar.gz
external_llvm-860e8862c1fbd3b261da4a64a8c0096f9f373681.tar.bz2
Add an initial hack at legalizing GlobalAddress into the appropriate nodes
on Darwin to remove smarts from the isel. This is currently disabled by default (uncomment setOperationAction(ISD::GlobalAddress to enable it). tblgen needs to become smarter about tglobaladdr nodes and bigger patterns needed to be added to the .td file. However, we can currently emit stuff like this: :) li r2, lo16(L_x$non_lazy_ptr) lis r3, ha16(L_x$non_lazy_ptr) lwzx r2, r3, r2 The obvious improvements will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.td')
-rw-r--r--lib/Target/PowerPC/PPCInstrInfo.td8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td
index 54acd9b..c549fdd 100644
--- a/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/lib/Target/PowerPC/PPCInstrInfo.td
@@ -27,6 +27,9 @@ def PPCfsel : SDNode<"PPCISD::FSEL",
SDTypeProfile<1, 3, [SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>,
SDTCisFP<0>, SDTCisVT<1, f64>]>, []>;
+def PPChi : SDNode<"PPCISD::Hi", SDTIntBinOp, []>;
+def PPClo : SDNode<"PPCISD::Lo", SDTIntBinOp, []>;
+
//===----------------------------------------------------------------------===//
// PowerPC specific transformation functions and pattern fragments.
//
@@ -782,6 +785,11 @@ def : Pat<(srl GPRC:$in, imm:$imm),
def : Pat<(srl G8RC:$in, imm:$imm),
(RLDICL G8RC:$in, (SRL64 imm:$imm), imm:$imm)>;
+// Hi and Lo for Darwin Global Addresses.
+def : Pat<(PPChi tglobaladdr:$in, (i32 0)), (LIS node:$in)>;
+def : Pat<(PPClo tglobaladdr:$in, (i32 0)), (LI node:$in)>;
+
+
// Same as above, but using a temporary. FIXME: implement temporaries :)
/*
def : Pattern<(xor GPRC:$in, imm:$imm),