summaryrefslogtreecommitdiff
path: root/asmcomp/amd64/selection.ml
diff options
context:
space:
mode:
Diffstat (limited to 'asmcomp/amd64/selection.ml')
-rw-r--r--asmcomp/amd64/selection.ml16
1 files changed, 8 insertions, 8 deletions
diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml
index fa7fe66c05..4556ac668b 100644
--- a/asmcomp/amd64/selection.ml
+++ b/asmcomp/amd64/selection.ml
@@ -30,11 +30,11 @@ let rec select_addr exp =
match exp with
Cconst_symbol s when not !Clflags.dlcode ->
(Asymbol s, 0)
- | Cop((Caddi | Cadda), [arg; Cconst_int m]) ->
+ | Cop((Caddi | Caddv | Cadda), [arg; Cconst_int m]) ->
let (a, n) = select_addr arg in (a, n + m)
- | Cop((Csubi | Csuba), [arg; Cconst_int m]) ->
+ | Cop(Csubi, [arg; Cconst_int m]) ->
let (a, n) = select_addr arg in (a, n - m)
- | Cop((Caddi | Cadda), [Cconst_int m; arg]) ->
+ | Cop((Caddi | Caddv | Cadda), [Cconst_int m; arg]) ->
let (a, n) = select_addr arg in (a, n + m)
| Cop(Clsl, [arg; Cconst_int(1|2|3 as shift)]) ->
begin match select_addr arg with
@@ -51,7 +51,7 @@ let rec select_addr exp =
(Alinear e, n) -> (Ascale(e, mult), n * mult)
| _ -> (Alinear exp, 0)
end
- | Cop((Caddi | Cadda), [arg1; arg2]) ->
+ | Cop((Caddi | Caddv | Cadda), [arg1; arg2]) ->
begin match (select_addr arg1, select_addr arg2) with
((Alinear e1, n1), (Alinear e2, n2)) ->
(Aadd(e1, e2), n1 + n2)
@@ -170,8 +170,8 @@ method! select_store is_assign addr exp =
method! select_operation op args =
match op with
(* Recognize the LEA instruction *)
- Caddi | Cadda | Csubi | Csuba ->
- begin match self#select_addressing Word (Cop(op, args)) with
+ Caddi | Caddv | Cadda | Csubi ->
+ begin match self#select_addressing Word_int (Cop(op, args)) with
(Iindexed d, _) -> super#select_operation op args
| (Iindexed2 0, _) -> super#select_operation op args
| (addr, arg) -> (Ispecific(Ilea addr), [arg])
@@ -196,11 +196,11 @@ method! select_operation op args =
assert false
end
(* Recognize store instructions *)
- | Cstore Word ->
+ | Cstore (Word_int|Word_val as chunk) ->
begin match args with
[loc; Cop(Caddi, [Cop(Cload _, [loc']); Cconst_int n])]
when loc = loc' && self#is_immediate n ->
- let (addr, arg) = self#select_addressing Word loc in
+ let (addr, arg) = self#select_addressing chunk loc in
(Ispecific(Ioffset_loc(n, addr)), [arg])
| _ ->
super#select_operation op args