add -n => sub n quand c'est profitable

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1683 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1997-07-31 03:50:32 +00:00
parent bbe71afd4f
commit b2465b0dee
1 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,8 @@ method select_operation op args =
(Ispecific(if shift = 2 then Isub4 else Isub8), [arg1; arg2])
| (Csubi, [Cop(Cmuli, [Cconst_int(4|8 as mult); arg1]); arg2]) ->
(Ispecific(if mult = 4 then Isub4 else Isub8), [arg1; arg2])
| ((Caddi|Cadda), [arg1; Cconst_int n]) when self#is_immediate (-n) ->
(Iintop_imm(Isub, -n), [arg1])
| (Cdivi, [arg1; Cconst_int n])
when (not digital_asm) && n <> 1 lsl (Misc.log2 n) ->
(Iintop Idiv, args)