diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2020-07-25 09:50:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-25 09:50:42 +0200 |
commit | e41dc9c44327f40c1ab0feea12f779c931c9e31e (patch) | |
tree | 6063829f61d08c1dcc01f96b47d0ed12e72a6aa9 /asmcomp/amd64/selection.ml | |
parent | 80326033cbedfe59c0664e3912f21017e968a1e5 (diff) | |
parent | cc25fc9342c63d7a97eeb052c6eaaadfe7fb2fc5 (diff) | |
download | ocaml-e41dc9c44327f40c1ab0feea12f779c931c9e31e.tar.gz |
Merge pull request #9752 from xavierleroy/c-calling-conventions
Revised handing of calling conventions for external C functions
Diffstat (limited to 'asmcomp/amd64/selection.ml')
-rw-r--r-- | asmcomp/amd64/selection.ml | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/asmcomp/amd64/selection.ml b/asmcomp/amd64/selection.ml index d4f5cad167..3c0993f234 100644 --- a/asmcomp/amd64/selection.ml +++ b/asmcomp/amd64/selection.ml @@ -135,7 +135,7 @@ method is_immediate_natint n = n <= 0x7FFFFFFFn && n >= -0x80000000n method! is_simple_expr e = match e with - | Cop(Cextcall (fn, _, _, _), args, _) + | Cop(Cextcall (fn, _, _, _, _), args, _) when List.mem fn inline_ops -> (* inlined ops are simple if their arguments are *) List.for_all self#is_simple_expr args @@ -144,7 +144,7 @@ method! is_simple_expr e = method! effects_of e = match e with - | Cop(Cextcall(fn, _, _, _), args, _) + | Cop(Cextcall(fn, _, _, _, _), args, _) when List.mem fn inline_ops -> Selectgen.Effect_and_coeffect.join_list_map args self#effects_of | _ -> @@ -197,7 +197,7 @@ method! select_operation op args dbg = self#select_floatarith true Imulf Ifloatmul args | Cdivf -> self#select_floatarith false Idivf Ifloatdiv args - | Cextcall("sqrt", _, false, _) -> + | Cextcall("sqrt", _, _, false, _) -> begin match args with [Cop(Cload ((Double|Double_u as chunk), _), [loc], _dbg)] -> let (addr, arg) = self#select_addressing chunk loc in @@ -217,12 +217,12 @@ method! select_operation op args dbg = | _ -> super#select_operation op args dbg end - | Cextcall("caml_bswap16_direct", _, _, _) -> + | Cextcall("caml_bswap16_direct", _, _, _, _) -> (Ispecific (Ibswap 16), args) - | Cextcall("caml_int32_direct_bswap", _, _, _) -> + | Cextcall("caml_int32_direct_bswap", _, _, _, _) -> (Ispecific (Ibswap 32), args) - | Cextcall("caml_int64_direct_bswap", _, _, _) - | Cextcall("caml_nativeint_direct_bswap", _, _, _) -> + | Cextcall("caml_int64_direct_bswap", _, _, _, _) + | Cextcall("caml_nativeint_direct_bswap", _, _, _, _) -> (Ispecific (Ibswap 64), args) (* AMD64 does not support immediate operands for multiply high signed *) | Cmulhi -> |