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 --- arm/ConstpropOp.vp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arm/ConstpropOp.vp') diff --git a/arm/ConstpropOp.vp b/arm/ConstpropOp.vp index 9bf066b2..caf0da66 100644 --- a/arm/ConstpropOp.vp +++ b/arm/ConstpropOp.vp @@ -112,6 +112,9 @@ Nondetfunction eval_static_operation (op: operation) (vl: list approx) := | Orsubshift s, I n1 :: I n2 :: nil => I(Int.sub (eval_static_shift s n2) n1) | Orsubimm n, I n1 :: nil => I (Int.sub n n1) | Omul, I n1 :: I n2 :: nil => I(Int.mul n1 n2) + | Omla, I n1 :: I n2 :: I n3 :: nil => I(Int.add (Int.mul n1 n2) n3) + | Omulhs, I n1 :: I n2 :: nil => I(Int.mulhs n1 n2) + | Omulhu, I n1 :: I n2 :: nil => I(Int.mulhu n1 n2) | Odiv, I n1 :: I n2 :: nil => if Int.eq n2 Int.zero then Unknown else if Int.eq n1 (Int.repr Int.min_signed) && Int.eq n2 Int.mone then Unknown -- cgit