Skip to content

Commit 2b0e213

Browse files
committed
Refactor: WASM_X86: Directly push value onto stack
1 parent 311da6b commit 2b0e213

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libasr/codegen/wasm_to_x86.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,11 @@ class X86Visitor : public WASMDecoder<X86Visitor>,
225225
} else {
226226
throw CodeGenError("Comparison operator not implemented");
227227
}
228-
m_a.asm_mov_r32_imm32(X86Reg::eax, 0);
228+
m_a.asm_push_imm8(0);
229229
m_a.asm_jmp_label(".compare.end_" + label);
230230
m_a.add_label(".compare_1" + label);
231-
m_a.asm_mov_r32_imm32(X86Reg::eax, 1);
231+
m_a.asm_push_imm8(1);
232232
m_a.add_label(".compare.end_" + label);
233-
m_a.asm_push_r32(X86Reg::eax);
234233
}
235234

236235
void visit_I32Eq() { handle_I32Compare("Eq"); }

0 commit comments

Comments
 (0)