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 --- 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 528e9ed0..826dadf0 100644 --- a/ia32/Machregs.v +++ b/ia32/Machregs.v @@ -75,6 +75,8 @@ Definition destroyed_by_op (op: operation): list mreg := match op with | Omove => FP0 :: nil | Ocast8signed | Ocast8unsigned | Ocast16signed | Ocast16unsigned => AX :: nil + | Omulhs => AX :: DX :: nil + | Omulhu => AX :: DX :: nil | Odiv => AX :: DX :: nil | Odivu => AX :: DX :: nil | Omod => AX :: DX :: nil @@ -136,6 +138,8 @@ Definition temp_for_parent_frame: mreg := Definition mregs_for_operation (op: operation): list (option mreg) * option mreg := match op with + | Omulhs => (Some AX :: None :: nil, Some DX) + | Omulhu => (Some AX :: None :: nil, Some DX) | Odiv => (Some AX :: Some CX :: nil, Some AX) | Odivu => (Some AX :: Some CX :: nil, Some AX) | Omod => (Some AX :: Some CX :: nil, Some DX) @@ -192,6 +196,8 @@ Definition two_address_op (op: operation) : bool := | Osub => true | Omul => true | Omulimm _ => true + | Omulhs => false + | Omulhu => false | Odiv => false | Odivu => false | Omod => false -- cgit