From d2af79a77ed2936ff0ed90cadf8e48637d774d4c Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 4 Oct 2016 15:52:16 +0200 Subject: Turn 64-bit integer division and modulus by constants into multiply-high This trick was already implemented for 32-bit integer division and modulus. Here we extend it to the 64-bit case. For 32-bit target processors, the runtime library must implement 64-bit multiply-high (signed and unsigned). Tentative implementations are provided for IA32 and PowerPC, but need testing. --- ia32/ValueAOp.v | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ia32/ValueAOp.v') diff --git a/ia32/ValueAOp.v b/ia32/ValueAOp.v index c8b3278e..98f0dbb1 100644 --- a/ia32/ValueAOp.v +++ b/ia32/ValueAOp.v @@ -117,6 +117,8 @@ Definition eval_static_operation (op: operation) (vl: list aval): aval := | Osubl, v1::v2::nil => subl v1 v2 | Omull, v1::v2::nil => mull v1 v2 | Omullimm n, v1::nil => mull v1 (L n) + | Omullhs, v1::v2::nil => mullhs v1 v2 + | Omullhu, v1::v2::nil => mullhu v1 v2 | Odivl, v1::v2::nil => divls v1 v2 | Odivlu, v1::v2::nil => divlu v1 v2 | Omodl, v1::v2::nil => modls v1 v2 -- cgit