Signed-off-by: Tomek Grabiec <[email protected]>
---
arch/x86/emit-code.c | 22 ++++++++++++++++++++++
arch/x86/include/arch/instruction.h | 2 ++
arch/x86/lir-printer.c | 14 ++++++++++++++
arch/x86/use-def.c | 2 ++
4 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 4b2825f..e94c2e0 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -1385,6 +1385,16 @@ static void emit_mov_memdisp_xmm(struct buffer *buf,
struct operand *src,
__emit_memdisp_reg(buf, 0x10, src->imm, mach_reg(&dest->reg));
}
+static void emit_mov_memindex_xmm(struct buffer *buf, struct operand *src,
+ struct operand *dest)
+{
+ emit(buf, 0xf3);
+ emit(buf, 0x0f);
+ emit(buf, 0x10);
+ emit(buf, encode_modrm(0x00, encode_reg(&dest->reg), 0x04));
+ emit(buf, encode_sib(src->shift, encode_reg(&src->index_reg),
encode_reg(&src->base_reg)));
+}
+
static void emit_mov_xmm_membase(struct buffer *buf, struct operand *src,
struct operand *dest)
{
@@ -1393,6 +1403,16 @@ static void emit_mov_xmm_membase(struct buffer *buf,
struct operand *src,
emit_membase_reg(buf, 0x11, dest, src);
}
+static void emit_mov_xmm_memindex(struct buffer *buf, struct operand *src,
+ struct operand *dest)
+{
+ emit(buf, 0xf3);
+ emit(buf, 0x0f);
+ emit(buf, 0x11);
+ emit(buf, encode_modrm(0x00, encode_reg(&src->reg), 0x04));
+ emit(buf, encode_sib(dest->shift, encode_reg(&dest->index_reg),
encode_reg(&dest->base_reg)));
+}
+
static void emit_mov_xmm_memdisp(struct buffer *buf, struct operand *src,
struct operand *dest)
{
@@ -1449,6 +1469,7 @@ struct emitter emitters[] = {
DECL_EMITTER(INSN_MOV_REG_MEMDISP, emit_mov_reg_memdisp, TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_THREAD_LOCAL_MEMDISP_REG,
emit_mov_thread_local_memdisp_reg, TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_MEMINDEX_REG, emit_mov_memindex_reg,
TWO_OPERANDS),
+ DECL_EMITTER(INSN_MOV_MEMINDEX_XMM, emit_mov_memindex_xmm,
TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_REG_MEMBASE, emit_mov_reg_membase, TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_REG_MEMINDEX, emit_mov_reg_memindex,
TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_REG_MEMLOCAL, emit_mov_reg_memlocal,
TWO_OPERANDS),
@@ -1457,6 +1478,7 @@ struct emitter emitters[] = {
DECL_EMITTER(INSN_MOV_FREG_MEMLOCAL, emit_mov_freg_memlocal,
TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_REG_REG, emit_mov_reg_reg, TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_XMM_MEMDISP, emit_mov_xmm_memdisp, TWO_OPERANDS),
+ DECL_EMITTER(INSN_MOV_XMM_MEMINDEX, emit_mov_xmm_memindex,
TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_XMM_XMM, emit_mov_xmm_xmm, TWO_OPERANDS),
DECL_EMITTER(INSN_MOVSX_8_REG_REG, emit_movsx_8_reg_reg, TWO_OPERANDS),
DECL_EMITTER(INSN_MOVSX_16_REG_REG, emit_movsx_16_reg_reg,
TWO_OPERANDS),
diff --git a/arch/x86/include/arch/instruction.h
b/arch/x86/include/arch/instruction.h
index fb13019..514870a 100644
--- a/arch/x86/include/arch/instruction.h
+++ b/arch/x86/include/arch/instruction.h
@@ -110,8 +110,10 @@ enum insn_type {
INSN_MOV_FREG_MEMLOCAL,
INSN_MOV_REG_REG,
INSN_MOV_MEMBASE_XMM,
+ INSN_MOV_MEMINDEX_XMM,
INSN_MOV_XMM_MEMBASE,
INSN_MOV_XMM_MEMDISP,
+ INSN_MOV_XMM_MEMINDEX,
INSN_MOV_XMM_XMM,
INSN_MOVSX_8_REG_REG,
INSN_MOVSX_16_REG_REG,
diff --git a/arch/x86/lir-printer.c b/arch/x86/lir-printer.c
index 2083913..53f1888 100644
--- a/arch/x86/lir-printer.c
+++ b/arch/x86/lir-printer.c
@@ -510,6 +510,12 @@ static int print_mov_memindex_reg(struct string *str,
struct insn *insn)
return print_memindex_reg(str, insn);
}
+static int print_mov_memindex_xmm(struct string *str, struct insn *insn)
+{
+ print_func_name(str);
+ return print_memindex_reg(str, insn);
+}
+
static int print_mov_reg_membase(struct string *str, struct insn *insn)
{
print_func_name(str);
@@ -522,6 +528,12 @@ static int print_mov_reg_memindex(struct string *str,
struct insn *insn)
return print_reg_memindex(str, insn);
}
+static int print_mov_xmm_memindex(struct string *str, struct insn *insn)
+{
+ print_func_name(str);
+ return print_reg_memindex(str, insn);
+}
+
static int print_mov_reg_memlocal(struct string *str, struct insn *insn)
{
print_func_name(str);
@@ -774,6 +786,7 @@ static print_insn_fn insn_printers[] = {
[INSN_MOV_MEMBASE_REG] = print_mov_membase_reg,
[INSN_MOV_MEMDISP_REG] = print_mov_memdisp_reg,
[INSN_MOV_MEMDISP_XMM] = print_mov_memdisp_xmm,
+ [INSN_MOV_MEMINDEX_XMM] = print_mov_memindex_xmm,
[INSN_MOV_REG_MEMDISP] = print_mov_reg_memdisp,
[INSN_MOV_THREAD_LOCAL_MEMDISP_REG] = print_mov_tlmemdisp_reg,
[INSN_MOV_MEMINDEX_REG] = print_mov_memindex_reg,
@@ -785,6 +798,7 @@ static print_insn_fn insn_printers[] = {
[INSN_MOV_FREG_MEMLOCAL] = print_mov_freg_memlocal,
[INSN_MOV_REG_REG] = print_mov_reg_reg,
[INSN_MOV_XMM_MEMDISP] = print_mov_xmm_memdisp,
+ [INSN_MOV_XMM_MEMINDEX] = print_mov_xmm_memindex,
[INSN_MOV_XMM_XMM] = print_mov_xmm_xmm,
[INSN_MOVSX_8_REG_REG] = print_movsx_8_reg_reg,
[INSN_MOVSX_16_REG_REG] = print_movsx_16_reg_reg,
diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c
index 63fb709..382bcb9 100644
--- a/arch/x86/use-def.c
+++ b/arch/x86/use-def.c
@@ -88,6 +88,7 @@ static struct insn_info insn_infos[] = {
DECLARE_INFO(INSN_MOV_REG_MEMDISP, USE_SRC | DEF_NONE),
DECLARE_INFO(INSN_MOV_THREAD_LOCAL_MEMDISP_REG, USE_NONE | DEF_DST),
DECLARE_INFO(INSN_MOV_MEMINDEX_REG, USE_SRC | USE_IDX_SRC | DEF_DST),
+ DECLARE_INFO(INSN_MOV_MEMINDEX_XMM, USE_SRC | USE_IDX_SRC | DEF_DST),
DECLARE_INFO(INSN_MOV_REG_MEMINDEX, USE_SRC | USE_DST | USE_IDX_DST |
DEF_NONE),
DECLARE_INFO(INSN_MOV_REG_MEMLOCAL, USE_SRC),
DECLARE_INFO(INSN_MOV_REG_THREAD_LOCAL_MEMBASE, USE_SRC | USE_DST |
DEF_NONE),
@@ -95,6 +96,7 @@ static struct insn_info insn_infos[] = {
DECLARE_INFO(INSN_MOV_FREG_MEMLOCAL, USE_SRC),
DECLARE_INFO(INSN_MOV_REG_REG, USE_SRC | DEF_DST),
DECLARE_INFO(INSN_MOV_XMM_MEMDISP, USE_SRC | DEF_NONE),
+ DECLARE_INFO(INSN_MOV_XMM_MEMINDEX, USE_SRC | USE_DST | USE_IDX_DST |
DEF_NONE),
DECLARE_INFO(INSN_MOV_XMM_XMM, USE_SRC | DEF_DST),
DECLARE_INFO(INSN_MOVSX_8_REG_REG, USE_SRC | DEF_DST),
DECLARE_INFO(INSN_MOVSX_16_REG_REG, USE_SRC | DEF_DST),
--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel