Is needed for d2l.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 arch/x86/emit-code.c                |    8 ++++++++
 arch/x86/include/arch/instruction.h |    1 +
 arch/x86/lir-printer.c              |    7 +++++++
 arch/x86/use-def.c                  |    1 +
 4 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index b1102ca..2ef7d3e 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -1451,6 +1451,13 @@ static void emit_or_membase_reg(struct buffer *buf,
        emit_membase_reg(buf, 0x0b, src, dest);
 }
 
+static void emit_or_imm_membase(struct buffer *buf,
+                               struct operand *src, struct operand *dest)
+{
+       __emit_membase(buf, 0x81, mach_reg(&dest->base_reg), dest->disp, 1);
+       emit_imm32(buf, src->disp);
+}
+
 static void emit_or_reg_reg(struct buffer *buf, struct operand *src,
                            struct operand *dest)
 {
@@ -1882,6 +1889,7 @@ struct emitter emitters[] = {
        DECL_EMITTER(INSN_MUL_REG_EAX, emit_mul_reg_eax, TWO_OPERANDS),
        DECL_EMITTER(INSN_MUL_REG_REG, emit_mul_reg_reg, TWO_OPERANDS),
        DECL_EMITTER(INSN_NEG_REG, emit_neg_reg, SINGLE_OPERAND),
+       DECL_EMITTER(INSN_OR_IMM_MEMBASE, emit_or_imm_membase, TWO_OPERANDS),
        DECL_EMITTER(INSN_OR_MEMBASE_REG, emit_or_membase_reg, TWO_OPERANDS),
        DECL_EMITTER(INSN_OR_REG_REG, emit_or_reg_reg, TWO_OPERANDS),
        DECL_EMITTER(INSN_PUSH_IMM, emit_push_imm, SINGLE_OPERAND),
diff --git a/arch/x86/include/arch/instruction.h 
b/arch/x86/include/arch/instruction.h
index 16ac963..f2f858c 100644
--- a/arch/x86/include/arch/instruction.h
+++ b/arch/x86/include/arch/instruction.h
@@ -153,6 +153,7 @@ enum insn_type {
        INSN_MUL_REG_EAX,
        INSN_MUL_REG_REG,
        INSN_NEG_REG,
+       INSN_OR_IMM_MEMBASE,
        INSN_OR_MEMBASE_REG,
        INSN_OR_REG_REG,
        INSN_PUSH_IMM,
diff --git a/arch/x86/lir-printer.c b/arch/x86/lir-printer.c
index e321169..d688f78 100644
--- a/arch/x86/lir-printer.c
+++ b/arch/x86/lir-printer.c
@@ -771,6 +771,12 @@ static int print_neg_reg(struct string *str, struct insn 
*insn)
        return print_reg(str, &insn->operand);
 }
 
+static int print_or_imm_membase(struct string *str, struct insn *insn)
+{
+       print_func_name(str);
+       return print_imm_membase(str, insn);
+}
+
 static int print_or_membase_reg(struct string *str, struct insn *insn)
 {
        print_func_name(str);
@@ -1019,6 +1025,7 @@ static print_insn_fn insn_printers[] = {
        [INSN_MUL_REG_EAX] = print_mul_reg_eax,
        [INSN_MUL_REG_REG] = print_mul_reg_reg,
        [INSN_NEG_REG] = print_neg_reg,
+       [INSN_OR_IMM_MEMBASE] = print_or_imm_membase,
        [INSN_OR_MEMBASE_REG] = print_or_membase_reg,
        [INSN_OR_REG_REG] = print_or_reg_reg,
        [INSN_PUSH_IMM] = print_push_imm,
diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c
index 6ebd7df..5d017bc 100644
--- a/arch/x86/use-def.c
+++ b/arch/x86/use-def.c
@@ -134,6 +134,7 @@ static struct insn_info insn_infos[] = {
        DECLARE_INFO(INSN_MUL_REG_EAX, USE_SRC | USE_DST | DEF_DST | DEF_xDX | 
DEF_xAX),
        DECLARE_INFO(INSN_MUL_REG_REG, USE_SRC | USE_DST | DEF_DST),
        DECLARE_INFO(INSN_NEG_REG, USE_SRC | DEF_SRC),
+       DECLARE_INFO(INSN_OR_IMM_MEMBASE, USE_DST | DEF_NONE),
        DECLARE_INFO(INSN_OR_MEMBASE_REG, USE_SRC | USE_DST | DEF_DST),
        DECLARE_INFO(INSN_OR_REG_REG, USE_SRC | USE_DST | DEF_DST),
        DECLARE_INFO(INSN_PUSH_IMM, USE_NONE | DEF_NONE),
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to