Skip to content

Commit 1484abd

Browse files
authored
Always use x86 inc/dec for add/sub with 1 (#2211)
use inc/dec in fast mode
1 parent 7a399da commit 1484abd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/amd64/emit.mlp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,9 +1485,9 @@ let emit_instr fallthrough i =
14851485
instr_for_intop op (arg i 1) (res i 0)
14861486
| Lop(Iintop_imm(Iadd, n)) when i.arg.(0).loc <> i.res.(0).loc ->
14871487
I.lea (mem64 NONE n (arg64 i 0)) (res i 0)
1488-
| Lop(Iintop_imm(Iadd, 1) | Iintop_imm(Isub, -1)) when not !fastcode_flag ->
1488+
| Lop(Iintop_imm(Iadd, 1) | Iintop_imm(Isub, -1)) ->
14891489
I.inc (res i 0)
1490-
| Lop(Iintop_imm(Iadd, -1) | Iintop_imm(Isub, 1)) when not !fastcode_flag ->
1490+
| Lop(Iintop_imm(Iadd, -1) | Iintop_imm(Isub, 1)) ->
14911491
I.dec (res i 0)
14921492
| Lop(Iintop_imm(op, n)) ->
14931493
(* We have i.arg.(0) = i.res.(0) *)

0 commit comments

Comments
 (0)