diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1997-07-31 03:50:32 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1997-07-31 03:50:32 +0000 |
commit | b2465b0dee180044d1df2ca121e171aa2e0c818d (patch) | |
tree | 3d7eb8e44b336d48eacdf67eabc009c9a5583029 | |
parent | bbe71afd4ff59048b29b5c8b88d2fcf08491114f (diff) |
add -n => sub n quand c'est profitable
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1683 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | asmcomp/alpha/selection.ml | 2 |
1 files changed, 2 insertions, 0 deletions
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) |