Skip to content

Commit

Permalink
Fix Icsel reload for test and res. (ocaml#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
gretay-js committed Feb 3, 2023
1 parent b56f751 commit 83732c0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions backend/amd64/reload.ml
Expand Up @@ -157,12 +157,10 @@ method! reload_operation op arg res =
directly, but then in Emit we will have to do Array.sub again
to call emit_test (unless emit_test takes an index, which is also
weird). *)
if stackp res.(0)
then begin
(* CR-soon gyorsh: [reload_test] may lose some sharing
between the arguments of the test and the last two arguments
and the result of the move. *)
let r = self#makereg res.(0) in
let r = if stackp res.(0) then self#makereg res.(0) else res.(0) in
let len = Array.length arg in
let arg' = Array.copy arg in
let test_arg = self#reload_test tst (Array.sub arg 0 (len - 2)) in
Expand All @@ -171,7 +169,6 @@ method! reload_operation op arg res =
done;
arg'.(len - 1) <- r;
(arg', [|r|])
end else (arg, res)
| Iintop (Ipopcnt | Iclz _| Ictz _)
| Iintop_atomic _
| Ispecific (Isqrtf | Isextend32 | Izextend32 | Ilea _
Expand Down

0 comments on commit 83732c0

Please sign in to comment.