(emit_alu_imm_memabs): New function.
* src/vm/jit/i386/emit.h (emit_alu_imm_memabs): Added prototype.
* src/vm/jit/i386/codegen.h (M_ISUB_IMM_MEMABS): New macro.
Authors: Andreas Krall
Christian Thalinger
- $Id: codegen.h 5932 2006-11-07 09:06:18Z twisti $
+ $Id: codegen.h 6049 2006-11-27 14:20:57Z edwin $
*/
#define M_IADD_IMM_MEMBASE(a,b,c) emit_alu_imm_membase(cd, ALU_ADD, (a), (b), (c))
+#define M_ISUB_IMM_MEMABS(a,b) emit_alu_imm_memabs(cd, ALU_SUB, (a), (b))
+
#define M_IADDC(a,b) emit_alu_reg_reg(cd, ALU_ADC, (a), (b))
#define M_ISUBB(a,b) emit_alu_reg_reg(cd, ALU_SBB, (a), (b))
Authors: Christian Thalinger
- $Id: emit.c 6036 2006-11-22 10:50:07Z twisti $
+ $Id: emit.c 6049 2006-11-27 14:20:57Z edwin $
*/
}
+static void emit_memabs(codegendata *cd, s4 disp, s4 dreg)
+{
+ emit_address_byte(0, dreg, 5);
+ emit_imm32(disp);
+}
+
+
static void emit_memindex(codegendata *cd, s4 reg, s4 disp, s4 basereg, s4 indexreg, s4 scale)
{
if (basereg == -1) {
}
+void emit_alu_imm_memabs(codegendata *cd, s4 opc, s4 imm, s4 disp)
+{
+ if (IS_IMM8(imm)) {
+ *(cd->mcodeptr++) = 0x83;
+ emit_memabs(cd, (disp), (opc));
+ emit_imm8((imm));
+ } else {
+ *(cd->mcodeptr++) = 0x81;
+ emit_memabs(cd, (disp), (opc));
+ emit_imm32((imm));
+ }
+}
+
+
void emit_test_reg_reg(codegendata *cd, s4 reg, s4 dreg)
{
*(cd->mcodeptr++) = 0x85;
Changes:
- $Id: emit.h 5562 2006-09-28 20:13:20Z edwin $
+ $Id: emit.h 6049 2006-11-27 14:20:57Z edwin $
*/
void emit_alu_imm_reg(codegendata *cd, s4 opc, s4 imm, s4 reg);
void emit_alu_imm32_reg(codegendata *cd, s4 opc, s4 imm, s4 reg);
void emit_alu_imm_membase(codegendata *cd, s4 opc, s4 imm, s4 basereg, s4 disp);
+void emit_alu_imm_memabs(codegendata *cd, s4 opc, s4 imm, s4 disp);
void emit_test_reg_reg(codegendata *cd, s4 reg, s4 dreg);
void emit_test_imm_reg(codegendata *cd, s4 imm, s4 dreg);
void emit_dec_mem(codegendata *cd, s4 mem);