From 41b7ecb127b93b1aecc29a298ec21dc94603e6fa Mon Sep 17 00:00:00 2001 From: xleroy Date: Mon, 29 Jul 2013 12:10:11 +0000 Subject: 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 --- powerpc/Asmgen.v | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'powerpc/Asmgen.v') 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) -- cgit