Skip to content

Commit

Permalink
fix arm
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanburen committed Dec 13, 2024
1 parent a4ef41a commit 15c9c22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions backend/arm64/cfg_selection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ class selector =
method! insert_move_extcall_arg env ty_arg src dst =
let ty_arg_is_int32 =
match ty_arg with
| XInt8 | XInt16 -> false
| XInt32 -> true
| XInt8 | XInt16 | XInt32 -> true
| XInt | XInt64 | XFloat32 | XFloat | XVec128 -> false
in
if macosx && ty_arg_is_int32 && is_stack_slot dst
Expand Down
2 changes: 1 addition & 1 deletion backend/arm64/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ let external_calling_conventions
begin match ty_arg with
| XInt | XInt64 ->
loc.(i) <- [| loc_int last_int make_stack int ofs |]
| XInt32 ->
| XInt32 | XInt16 | XInt8 ->
loc.(i) <- [| loc_int32 last_int make_stack int ofs |]
| XFloat ->
loc.(i) <- [| loc_float last_float make_stack float ofs |]
Expand Down
7 changes: 6 additions & 1 deletion backend/arm64/selection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ class selector =
| _ -> super#select_operation op args dbg

method! insert_move_extcall_arg env ty_arg src dst =
if macosx && ty_arg = XInt32 && is_stack_slot dst
let ty_arg_is_int32 =
match ty_arg with
| XInt8 | XInt16 | XInt32 -> true
| XInt | XInt64 | XFloat32 | XFloat | XVec128 -> false
in
if macosx && ty_arg_is_int32 && is_stack_slot dst
then self#insert env (Iop (Ispecific Imove32)) src dst
else self#insert_moves env src dst
end
Expand Down

0 comments on commit 15c9c22

Please sign in to comment.