Skip to content

Commit

Permalink
Backend\X64: fix broken SUB #1 optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Apr 26, 2024
1 parent e7e0460 commit 3ac20fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/x86_64/compile_alu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void X64Backend::CompileSUB(CompileContext const& context, IRSub* op) {
if (result_reg != lhs_reg) {
code.mov(result_reg, lhs_reg);
}
if(imm == 1u && update_host_flags) {
if(imm == 1u && !update_host_flags) {
code.dec(result_reg);
} else {
code.sub(result_reg, imm);
Expand Down

0 comments on commit 3ac20fd

Please sign in to comment.