aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCInstrInfo.td
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-17 17:52:01 +0000
committerChris Lattner <sabre@nondot.org>2005-11-17 17:52:01 +0000
commit490ad0809767499519602d4aaf6ba5548bbef215 (patch)
tree866711cc9bc036b813d9f28acd274d636139b995 /lib/Target/PowerPC/PPCInstrInfo.td
parent1566613ca4aecaf0143b41c97ae3b3be80660c56 (diff)
downloadexternal_llvm-490ad0809767499519602d4aaf6ba5548bbef215.zip
external_llvm-490ad0809767499519602d4aaf6ba5548bbef215.tar.gz
external_llvm-490ad0809767499519602d4aaf6ba5548bbef215.tar.bz2
Generate LA and ADDIS when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.td')
-rw-r--r--lib/Target/PowerPC/PPCInstrInfo.td10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td
index c549fdd..0b79cda 100644
--- a/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/lib/Target/PowerPC/PPCInstrInfo.td
@@ -256,7 +256,8 @@ def ADDIS : DForm_2<15, (ops GPRC:$rD, GPRC:$rA, symbolHi:$imm),
[(set GPRC:$rD, (add GPRC:$rA, imm16Shifted:$imm))]>;
def LA : DForm_2<14, (ops GPRC:$rD, GPRC:$rA, symbolLo:$sym),
"la $rD, $sym($rA)", IntGeneral,
- []>;
+ [(set GPRC:$rD, (add GPRC:$rA,
+ (PPClo tglobaladdr:$sym, 0)))]>;
def MULLI : DForm_2< 7, (ops GPRC:$rD, GPRC:$rA, s16imm:$imm),
"mulli $rD, $rA, $imm", IntMulLI,
[(set GPRC:$rD, (mul GPRC:$rA, immSExt16:$imm))]>;
@@ -786,9 +787,10 @@ 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)>;
-
+def : Pat<(PPChi tglobaladdr:$in, (i32 0)), (LIS tglobaladdr:$in)>;
+def : Pat<(PPClo tglobaladdr:$in, (i32 0)), (LI tglobaladdr:$in)>;
+def : Pat<(add GPRC:$in, (PPChi tglobaladdr:$g, 0)),
+ (ADDIS GPRC:$in, tglobaladdr:$g)>;
// Same as above, but using a temporary. FIXME: implement temporaries :)
/*