* src/vm/jit/i386/emit.c (emit_memabs): New function.
authoredwin <none@none>
Mon, 27 Nov 2006 14:20:57 +0000 (14:20 +0000)
committeredwin <none@none>
Mon, 27 Nov 2006 14:20:57 +0000 (14:20 +0000)
(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.

src/vm/jit/i386/codegen.h
src/vm/jit/i386/emit.c
src/vm/jit/i386/emit.h

index bf0e451ec56e975625b808a52b0b711b92c9e83d..fd829f1a74fe397a5754695b0f55ab9c80b73209 100644 (file)
@@ -27,7 +27,7 @@
    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))
 
index e38151148d66dba9bb9c05c81590594c465a5005..1317e643b2f1ebf276b897888bf32f31d4fd98a0 100644 (file)
@@ -26,7 +26,7 @@
 
    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 $
 
 */
 
@@ -706,6 +706,13 @@ static void emit_membase32(codegendata *cd, s4 basereg, s4 disp, s4 dreg)
 }
 
 
+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) {
@@ -1000,6 +1007,20 @@ 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)
+{
+       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;
index 855d69418d2d7a0b91d05d9151ab81f0c1205b05..d497c2ba1454b9e2ee2d616d2c8ccc22a25fd28a 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: emit.h 5562 2006-09-28 20:13:20Z edwin $
+   $Id: emit.h 6049 2006-11-27 14:20:57Z edwin $
 
 */
 
@@ -186,6 +186,7 @@ void emit_alu_membase_reg(codegendata *cd, s4 opc, s4 basereg, s4 disp, s4 reg);
 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);