aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmgen.v
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-07-29 12:10:11 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-07-29 12:10:11 +0000
commit41b7ecb127b93b1aecc29a298ec21dc94603e6fa (patch)
tree287ce1cbf88caf973534715c7816d57b9089b265 /powerpc/Asmgen.v
parent4bf8b331372388dc9cb39154c986c918df9e071c (diff)
downloadcompcert-kvx-41b7ecb127b93b1aecc29a298ec21dc94603e6fa.tar.gz
compcert-kvx-41b7ecb127b93b1aecc29a298ec21dc94603e6fa.zip
Optimize integer divisions by positive constants, turning them into
multiply-high and shifts. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2300 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'powerpc/Asmgen.v')
-rw-r--r--powerpc/Asmgen.v6
1 files changed, 6 insertions, 0 deletions
diff --git a/powerpc/Asmgen.v b/powerpc/Asmgen.v
index 2b6d80df..cc9a51cb 100644
--- a/powerpc/Asmgen.v
+++ b/powerpc/Asmgen.v
@@ -371,6 +371,12 @@ Definition transl_op
Pmulli r r1 (Cint n) :: k
else
loadimm GPR0 n (Pmullw r r1 GPR0 :: k))
+ | Omulhs, a1 :: a2 :: nil =>
+ do r1 <- ireg_of a1; do r2 <- ireg_of a2; do r <- ireg_of res;
+ OK (Pmulhw r r1 r2 :: k)
+ | Omulhu, a1 :: a2 :: nil =>
+ do r1 <- ireg_of a1; do r2 <- ireg_of a2; do r <- ireg_of res;
+ OK (Pmulhwu r r1 r2 :: k)
| Odiv, a1 :: a2 :: nil =>
do r1 <- ireg_of a1; do r2 <- ireg_of a2; do r <- ireg_of res;
OK (Pdivw r r1 r2 :: k)