From b2465b0dee180044d1df2ca121e171aa2e0c818d Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 31 Jul 1997 03:50:32 +0000 Subject: [PATCH] add -n => sub n quand c'est profitable git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1683 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- asmcomp/alpha/selection.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asmcomp/alpha/selection.ml b/asmcomp/alpha/selection.ml index 14cb53d8f..0e59e7a06 100644 --- a/asmcomp/alpha/selection.ml +++ b/asmcomp/alpha/selection.ml @@ -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)