summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PPC/Ppr.hs
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2016-04-29 17:45:10 +0000
committerAustin Seipp <austin@well-typed.com>2016-04-29 17:45:31 +0000
commitb725fe0a8d2a2ee3e6d95bb0ec345ee532381ee2 (patch)
tree0295b03a07ba9cc7b0fc43d153f3097ad566c20b /compiler/nativeGen/PPC/Ppr.hs
parent00053ee6f450c4503c25ed9ba33089d991e2a04b (diff)
downloadhaskell-b725fe0a8d2a2ee3e6d95bb0ec345ee532381ee2.tar.gz
PPC NCG: Improve pointer de-tagging code
Generate a clrr[wd]i instruction to clear the tag bits in a pointer. This saves one instruction and one temporary register. Optimize signed comparison with zero after andi. operation This saves one instruction when comparing a pointer tag with zero. This reduces code size by 0.6 % in all nofib benchmarks. Test Plan: validate on AIX and 32-bit Linux Reviewed By: erikd, hvr Differential Revision: https://phabricator.haskell.org/D2093
Diffstat (limited to 'compiler/nativeGen/PPC/Ppr.hs')
-rw-r--r--compiler/nativeGen/PPC/Ppr.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs
index 59b0ad80d1..3e1fd078f3 100644
--- a/compiler/nativeGen/PPC/Ppr.hs
+++ b/compiler/nativeGen/PPC/Ppr.hs
@@ -791,6 +791,17 @@ pprInstr (RLWINM reg1 reg2 sh mb me) = hcat [
int me
]
+pprInstr (CLRRI fmt reg1 reg2 n) = hcat [
+ text "\tclrr",
+ pprFormat fmt,
+ text "i ",
+ pprReg reg1,
+ text ", ",
+ pprReg reg2,
+ text ", ",
+ int n
+ ]
+
pprInstr (FADD fmt reg1 reg2 reg3) = pprBinaryF (sLit "fadd") fmt reg1 reg2 reg3
pprInstr (FSUB fmt reg1 reg2 reg3) = pprBinaryF (sLit "fsub") fmt reg1 reg2 reg3
pprInstr (FMUL fmt reg1 reg2 reg3) = pprBinaryF (sLit "fmul") fmt reg1 reg2 reg3