diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-29 12:10:11 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-29 12:10:11 +0000 |
commit | 41b7ecb127b93b1aecc29a298ec21dc94603e6fa (patch) | |
tree | 287ce1cbf88caf973534715c7816d57b9089b265 /ia32/Asmgen.v | |
parent | 4bf8b331372388dc9cb39154c986c918df9e071c (diff) | |
download | compcert-41b7ecb127b93b1aecc29a298ec21dc94603e6fa.tar.gz compcert-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 'ia32/Asmgen.v')
-rw-r--r-- | ia32/Asmgen.v | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ia32/Asmgen.v b/ia32/Asmgen.v index 4543ac9b..04100574 100644 --- a/ia32/Asmgen.v +++ b/ia32/Asmgen.v @@ -311,6 +311,14 @@ Definition transl_op | Omulimm n, a1 :: nil => assertion (mreg_eq a1 res); do r <- ireg_of res; OK (Pimul_ri r n :: k) + | Omulhs, a1 :: a2 :: nil => + assertion (mreg_eq a1 AX); + assertion (mreg_eq res DX); + do r2 <- ireg_of a2; OK (Pimul_r r2 :: k) + | Omulhu, a1 :: a2 :: nil => + assertion (mreg_eq a1 AX); + assertion (mreg_eq res DX); + do r2 <- ireg_of a2; OK (Pmul_r r2 :: k) | Odiv, a1 :: a2 :: nil => assertion (mreg_eq a1 AX); assertion (mreg_eq a2 CX); |