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/Machregs.v | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ia32/Machregs.v') diff --git a/ia32/Machregs.v b/ia32/Machregs.v index a9383d18..034fa4bb 100644 --- a/ia32/Machregs.v +++ b/ia32/Machregs.v @@ -133,6 +133,8 @@ Definition destroyed_by_op (op: operation): list mreg := | Omod => AX :: DX :: nil | Omodu => AX :: DX :: nil | Oshrximm _ => CX :: nil + | Omullhs => AX :: DX :: nil + | Omullhu => AX :: DX :: nil | Odivl => AX :: DX :: nil | Odivlu => AX :: DX :: nil | Omodl => AX :: DX :: nil @@ -211,6 +213,8 @@ Definition mregs_for_operation (op: operation): list (option mreg) * option mreg | Oshr => (None :: Some CX :: nil, None) | Oshru => (None :: Some CX :: nil, None) | Oshrximm _ => (Some AX :: nil, Some AX) + | Omullhs => (Some AX :: None :: nil, Some DX) + | Omullhu => (Some AX :: None :: nil, Some DX) | Odivl => (Some AX :: Some CX :: nil, Some AX) | Odivlu => (Some AX :: Some CX :: nil, Some AX) | Omodl => (Some AX :: Some CX :: nil, Some DX) @@ -300,6 +304,8 @@ Definition two_address_op (op: operation) : bool := | Osubl => true | Omull => true | Omullimm _ => true + | Omullhs => false + | Omullhu => false | Odivl => false | Odivlu => false | Omodl => false -- cgit