Those instructions are needed to implement double precision arithmetic. Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- arch/x86/emit-code.c | 163 +++++++++++++++++++++++++++++++++++ arch/x86/include/arch/instruction.h | 16 ++++ arch/x86/lir-printer.c | 112 ++++++++++++++++++++++++ arch/x86/use-def.c | 16 ++++ 4 files changed, 307 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c index 8035ec6..282d8d6 100644 --- a/arch/x86/emit-code.c +++ b/arch/x86/emit-code.c @@ -760,6 +760,20 @@ emit_mov_memlocal_xmm(struct buffer *buf, struct operand *src, struct operand *d __emit_membase_reg(buf, 0x10, MACH_REG_EBP, disp, dest_reg); } +static void +emit_mov_64_memlocal_xmm(struct buffer *buf, struct operand *src, struct operand *dest) +{ + enum machine_reg dest_reg; + unsigned long disp; + + dest_reg = mach_reg(&dest->reg); + disp = slot_offset(src->slot); + + emit(buf, 0xf2); + emit(buf, 0x0f); + __emit_membase_reg(buf, 0x10, MACH_REG_EBP, disp, dest_reg); +} + static void emit_mov_membase_reg(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -912,6 +926,28 @@ static void emit_mov_xmm_memlocal(struct buffer *buf, struct operand *src, emit_imm(buf, disp); } +static void emit_mov_64_xmm_memlocal(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + unsigned long disp; + int mod; + + disp = slot_offset(dest->slot); + + if (is_imm_8(disp)) + mod = 0x01; + else + mod = 0x02; + + emit(buf, 0xf2); + emit(buf, 0x0f); + emit(buf, 0x11); + emit(buf, encode_modrm(mod, encode_reg(&src->reg), + __encode_reg(MACH_REG_EBP))); + + emit_imm(buf, disp); +} + static void emit_mov_reg_memindex(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1075,6 +1111,14 @@ static void emit_fadd_reg_reg(struct buffer *buf, emit_reg_reg(buf, 0x58, dest, src); } +static void emit_fadd_64_reg_reg(struct buffer *buf, + struct operand *src, struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_reg_reg(buf, 0x58, dest, src); +} + static void emit_fsub_reg_reg(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1082,6 +1126,15 @@ static void emit_fsub_reg_reg(struct buffer *buf, emit(buf, 0x0f); emit_reg_reg(buf, 0x5c, dest, src); } + +static void emit_fsub_64_reg_reg(struct buffer *buf, + struct operand *src, struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_reg_reg(buf, 0x5c, dest, src); +} + static void emit_fmul_reg_reg(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1089,6 +1142,15 @@ static void emit_fmul_reg_reg(struct buffer *buf, emit(buf, 0x0f); emit_reg_reg(buf, 0x59, dest, src); } + +static void emit_fmul_64_reg_reg(struct buffer *buf, + struct operand *src, struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_reg_reg(buf, 0x59, dest, src); +} + static void emit_fdiv_reg_reg(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1097,16 +1159,34 @@ static void emit_fdiv_reg_reg(struct buffer *buf, emit_reg_reg(buf, 0x5e, dest, src); } +static void emit_fdiv_64_reg_reg(struct buffer *buf, + struct operand *src, struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_reg_reg(buf, 0x5e, dest, src); +} + static void emit_fld_membase(struct buffer *buf, struct operand *src) { __emit_membase(buf, 0xd9, mach_reg(&src->base_reg), src->disp, 0); } +static void emit_fld_64_membase(struct buffer *buf, struct operand *src) +{ + __emit_membase(buf, 0xdd, mach_reg(&src->base_reg), src->disp, 0); +} + static void emit_fstp_membase(struct buffer *buf, struct operand *dest) { __emit_membase(buf, 0xd9, mach_reg(&dest->base_reg), dest->disp, 3); } +static void emit_fstp_64_membase(struct buffer *buf, struct operand *dest) +{ + __emit_membase(buf, 0xdd, mach_reg(&dest->base_reg), dest->disp, 3); +} + static void emit_add_membase_reg(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1276,6 +1356,14 @@ static void emit_xor_xmm_reg_reg(struct buffer *buf, struct operand *src, emit_reg_reg(buf, 0x57, dest, src); } +static void emit_xor_64_xmm_reg_reg(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0x66); + emit(buf, 0x0f); + emit_reg_reg(buf, 0x57, dest, src); +} + static void __emit_add_imm_reg(struct buffer *buf, long imm, enum machine_reg reg) { emit_alu_imm_reg(buf, 0x00, imm, reg); @@ -1402,6 +1490,14 @@ static void emit_mov_xmm_xmm(struct buffer *buf, struct operand *src, emit_reg_reg(buf, 0x10, dest, src); } +static void emit_mov_64_xmm_xmm(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_reg_reg(buf, 0x10, dest, src); +} + static void emit_mov_membase_xmm(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1410,6 +1506,14 @@ static void emit_mov_membase_xmm(struct buffer *buf, struct operand *src, emit_membase_reg(buf, 0x10, src, dest); } +static void emit_mov_64_membase_xmm(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_membase_reg(buf, 0x10, src, dest); +} + static void emit_mov_memdisp_xmm(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1418,6 +1522,14 @@ 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_64_memdisp_xmm(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + __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) { @@ -1443,7 +1555,16 @@ static void __emit_mov_membase_xmm(struct buffer *buf, enum machine_reg base, emit(buf, 0xf3); emit(buf, 0x0f); __emit_membase_reg(buf, 0x10, base, offs, dst); +} +static void emit_mov_64_memindex_xmm(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + 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, @@ -1454,6 +1575,14 @@ static void emit_mov_xmm_membase(struct buffer *buf, struct operand *src, emit_membase_reg(buf, 0x11, dest, src); } +static void emit_mov_64_xmm_membase(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + emit_membase_reg(buf, 0x11, dest, src); +} + static void emit_mov_xmm_memindex(struct buffer *buf, struct operand *src, struct operand *dest) { @@ -1464,6 +1593,16 @@ static void emit_mov_xmm_memindex(struct buffer *buf, struct operand *src, emit(buf, encode_sib(dest->shift, encode_reg(&dest->index_reg), encode_reg(&dest->base_reg))); } +static void emit_mov_64_xmm_memindex(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + 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) { @@ -1472,6 +1611,14 @@ static void emit_mov_xmm_memdisp(struct buffer *buf, struct operand *src, __emit_reg_memdisp(buf, 0x11, mach_reg(&src->reg), dest->imm); } +static void emit_mov_64_xmm_memdisp(struct buffer *buf, struct operand *src, + struct operand *dest) +{ + emit(buf, 0xf2); + emit(buf, 0x0f); + __emit_reg_memdisp(buf, 0x11, mach_reg(&src->reg), dest->imm); +} + static void emit_jmp_memindex(struct buffer *buf, struct operand *target) { emit(buf, 0xff); @@ -1498,39 +1645,54 @@ struct emitter emitters[] = { DECL_EMITTER(INSN_DIV_MEMBASE_REG, emit_div_membase_reg, TWO_OPERANDS), DECL_EMITTER(INSN_DIV_REG_REG, emit_div_reg_reg, TWO_OPERANDS), DECL_EMITTER(INSN_FADD_REG_REG, emit_fadd_reg_reg, TWO_OPERANDS), + DECL_EMITTER(INSN_FADD_64_REG_REG, emit_fadd_64_reg_reg, TWO_OPERANDS), DECL_EMITTER(INSN_FSUB_REG_REG, emit_fsub_reg_reg, TWO_OPERANDS), + DECL_EMITTER(INSN_FSUB_64_REG_REG, emit_fsub_64_reg_reg, TWO_OPERANDS), DECL_EMITTER(INSN_FMUL_REG_REG, emit_fmul_reg_reg, TWO_OPERANDS), + DECL_EMITTER(INSN_FMUL_64_REG_REG, emit_fmul_64_reg_reg, TWO_OPERANDS), DECL_EMITTER(INSN_FDIV_REG_REG, emit_fdiv_reg_reg, TWO_OPERANDS), + DECL_EMITTER(INSN_FDIV_64_REG_REG, emit_fdiv_64_reg_reg, TWO_OPERANDS), DECL_EMITTER(INSN_FLD_MEMBASE, emit_fld_membase, TWO_OPERANDS), + DECL_EMITTER(INSN_FLD_64_MEMBASE, emit_fld_64_membase, TWO_OPERANDS), DECL_EMITTER(INSN_FSTP_MEMBASE, emit_fstp_membase, TWO_OPERANDS), + DECL_EMITTER(INSN_FSTP_64_MEMBASE, emit_fstp_64_membase, TWO_OPERANDS), DECL_EMITTER(INSN_CONV_GPR_TO_FPU, emit_conv_gpr_to_fpu, TWO_OPERANDS), DECL_EMITTER(INSN_CONV_FPU_TO_GPR, emit_conv_fpu_to_gpr, TWO_OPERANDS), DECL_EMITTER(INSN_JMP_MEMINDEX, emit_jmp_memindex, SINGLE_OPERAND), DECL_EMITTER(INSN_MOV_MEMBASE_XMM, emit_mov_membase_xmm, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_MEMBASE_XMM, emit_mov_64_membase_xmm, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_XMM_MEMBASE, emit_mov_xmm_membase, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_XMM_MEMBASE, emit_mov_64_xmm_membase, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_IMM_MEMBASE, emit_mov_imm_membase, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_IMM_REG, emit_mov_imm_reg, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_IMM_THREAD_LOCAL_MEMBASE, emit_mov_imm_thread_local_membase, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_IP_THREAD_LOCAL_MEMBASE, emit_mov_ip_thread_local_membase, SINGLE_OPERAND), DECL_EMITTER(INSN_MOV_MEMLOCAL_REG, emit_mov_memlocal_reg, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_MEMLOCAL_XMM, emit_mov_memlocal_xmm, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_MEMLOCAL_XMM, emit_mov_64_memlocal_xmm, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_MEMBASE_REG, emit_mov_membase_reg, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_MEMDISP_REG, emit_mov_memdisp_reg, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_MEMDISP_XMM, emit_mov_memdisp_xmm, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_MEMDISP_XMM, emit_mov_64_memdisp_xmm, TWO_OPERANDS), 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_64_MEMINDEX_XMM, emit_mov_64_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), DECL_EMITTER(INSN_MOV_REG_THREAD_LOCAL_MEMBASE, emit_mov_reg_thread_local_membase, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_REG_THREAD_LOCAL_MEMDISP, emit_mov_reg_thread_local_memdisp, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_XMM_MEMLOCAL, emit_mov_xmm_memlocal, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_XMM_MEMLOCAL, emit_mov_64_xmm_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_64_XMM_MEMDISP, emit_mov_64_xmm_memdisp, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_XMM_MEMINDEX, emit_mov_xmm_memindex, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_XMM_MEMINDEX, emit_mov_64_xmm_memindex, TWO_OPERANDS), DECL_EMITTER(INSN_MOV_XMM_XMM, emit_mov_xmm_xmm, TWO_OPERANDS), + DECL_EMITTER(INSN_MOV_64_XMM_XMM, emit_mov_64_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), DECL_EMITTER(INSN_MOVZX_16_REG_REG, emit_movzx_16_reg_reg, TWO_OPERANDS), @@ -1560,6 +1722,7 @@ struct emitter emitters[] = { DECL_EMITTER(INSN_XOR_IMM_REG, emit_xor_imm_reg, TWO_OPERANDS), DECL_EMITTER(INSN_XOR_REG_REG, emit_xor_reg_reg, TWO_OPERANDS), DECL_EMITTER(INSN_XOR_XMM_REG_REG, emit_xor_xmm_reg_reg, TWO_OPERANDS), + DECL_EMITTER(INSN_XOR_64_XMM_REG_REG, emit_xor_64_xmm_reg_reg, TWO_OPERANDS), }; void emit_trampoline(struct compilation_unit *cu, diff --git a/arch/x86/include/arch/instruction.h b/arch/x86/include/arch/instruction.h index 6f9d823..1bdbae3 100644 --- a/arch/x86/include/arch/instruction.h +++ b/arch/x86/include/arch/instruction.h @@ -75,11 +75,17 @@ enum insn_type { INSN_DIV_MEMBASE_REG, INSN_DIV_REG_REG, INSN_FADD_REG_REG, + INSN_FADD_64_REG_REG, INSN_FMUL_REG_REG, + INSN_FMUL_64_REG_REG, INSN_FDIV_REG_REG, + INSN_FDIV_64_REG_REG, INSN_FSUB_REG_REG, + INSN_FSUB_64_REG_REG, INSN_FLD_MEMBASE, + INSN_FLD_64_MEMBASE, INSN_FSTP_MEMBASE, + INSN_FSTP_64_MEMBASE, INSN_CONV_FPU_TO_GPR, INSN_CONV_GPR_TO_FPU, INSN_JE_BRANCH, @@ -97,9 +103,11 @@ enum insn_type { INSN_MOV_IP_THREAD_LOCAL_MEMBASE, INSN_MOV_MEMLOCAL_REG, INSN_MOV_MEMLOCAL_XMM, + INSN_MOV_64_MEMLOCAL_XMM, INSN_MOV_MEMBASE_REG, INSN_MOV_MEMDISP_REG, INSN_MOV_MEMDISP_XMM, + INSN_MOV_64_MEMDISP_XMM, INSN_MOV_REG_MEMDISP, INSN_MOV_REG_THREAD_LOCAL_MEMBASE, INSN_MOV_REG_THREAD_LOCAL_MEMDISP, @@ -109,13 +117,20 @@ enum insn_type { INSN_MOV_REG_MEMINDEX, INSN_MOV_REG_MEMLOCAL, INSN_MOV_XMM_MEMLOCAL, + INSN_MOV_64_XMM_MEMLOCAL, INSN_MOV_REG_REG, INSN_MOV_MEMBASE_XMM, + INSN_MOV_64_MEMBASE_XMM, INSN_MOV_MEMINDEX_XMM, + INSN_MOV_64_MEMINDEX_XMM, INSN_MOV_XMM_MEMBASE, + INSN_MOV_64_XMM_MEMBASE, INSN_MOV_XMM_MEMDISP, + INSN_MOV_64_XMM_MEMDISP, INSN_MOV_XMM_MEMINDEX, + INSN_MOV_64_XMM_MEMINDEX, INSN_MOV_XMM_XMM, + INSN_MOV_64_XMM_XMM, INSN_MOVSX_8_REG_REG, INSN_MOVSX_16_REG_REG, INSN_MOVZX_16_REG_REG, @@ -146,6 +161,7 @@ enum insn_type { INSN_XOR_IMM_REG, INSN_XOR_REG_REG, INSN_XOR_XMM_REG_REG, + INSN_XOR_64_XMM_REG_REG, /* Must be last */ NR_INSN_TYPES, diff --git a/arch/x86/lir-printer.c b/arch/x86/lir-printer.c index 0082f8b..e938ee0 100644 --- a/arch/x86/lir-printer.c +++ b/arch/x86/lir-printer.c @@ -256,36 +256,72 @@ static int print_fadd_reg_reg(struct string *str, struct insn *insn) return print_reg_reg(str, insn); } +static int print_fadd_64_reg_reg(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_reg(str, insn); +} + static int print_fsub_reg_reg(struct string *str, struct insn *insn) { print_func_name(str); return print_reg_reg(str, insn); } +static int print_fsub_64_reg_reg(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_reg(str, insn); +} + static int print_fmul_reg_reg(struct string *str, struct insn *insn) { print_func_name(str); return print_reg_reg(str, insn); } +static int print_fmul_64_reg_reg(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_reg(str, insn); +} + static int print_fdiv_reg_reg(struct string *str, struct insn *insn) { print_func_name(str); return print_reg_reg(str, insn); } +static int print_fdiv_64_reg_reg(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_reg(str, insn); +} + static int print_fld_membase(struct string *str, struct insn *insn) { print_func_name(str); return print_membase(str, &insn->operand); } +static int print_fld_64_membase(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_membase(str, &insn->operand); +} + static int print_fstp_membase(struct string *str, struct insn *insn) { print_func_name(str); return print_membase(str, &insn->operand); } +static int print_fstp_64_membase(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_membase(str, &insn->operand); +} + static int print_and_membase_reg(struct string *str, struct insn *insn) { print_func_name(str); @@ -354,12 +390,24 @@ static int print_mov_membase_xmm(struct string *str, struct insn *insn) return print_membase_reg(str, insn); } +static int print_mov_64_membase_xmm(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_membase_reg(str, insn); +} + static int print_mov_xmm_membase(struct string *str, struct insn *insn) { print_func_name(str); return print_reg_membase(str, insn); } +static int print_mov_64_xmm_membase(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_membase(str, insn); +} + static int print_conv_fpu_to_gpr(struct string *str, struct insn *insn) { print_func_name(str); @@ -444,6 +492,12 @@ static int print_mov_memlocal_xmm(struct string *str, struct insn *insn) return print_memlocal_reg(str, insn); } +static int print_mov_64_memlocal_xmm(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_memlocal_reg(str, insn); +} + static int print_mov_membase_reg(struct string *str, struct insn *insn) { print_func_name(str); @@ -462,6 +516,12 @@ static int print_mov_memdisp_xmm(struct string *str, struct insn *insn) return print_memdisp_reg(str, insn); } +static int print_mov_64_memdisp_xmm(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_memdisp_reg(str, insn); +} + static int print_mov_reg_memdisp(struct string *str, struct insn *insn) { print_func_name(str); @@ -474,6 +534,12 @@ static int print_mov_xmm_memdisp(struct string *str, struct insn *insn) return print_reg_memdisp(str, insn); } +static int print_mov_64_xmm_memdisp(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_memdisp(str, insn); +} + static int print_mov_tlmemdisp_reg(struct string *str, struct insn *insn) { print_func_name(str); @@ -516,6 +582,12 @@ static int print_mov_memindex_xmm(struct string *str, struct insn *insn) return print_memindex_reg(str, insn); } +static int print_mov_64_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); @@ -534,6 +606,12 @@ static int print_mov_xmm_memindex(struct string *str, struct insn *insn) return print_reg_memindex(str, insn); } +static int print_mov_64_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); @@ -546,6 +624,12 @@ static int print_mov_xmm_memlocal(struct string *str, struct insn *insn) return print_reg_memlocal(str, insn); } +static int print_mov_64_xmm_memlocal(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_memlocal(str, insn); +} + static int print_mov_reg_reg(struct string *str, struct insn *insn) { print_func_name(str); @@ -558,6 +642,12 @@ static int print_mov_xmm_xmm(struct string *str, struct insn *insn) return print_reg_reg(str, insn); } +static int print_mov_64_xmm_xmm(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_reg(str, insn); +} + static int print_movsx_8_reg_reg(struct string *str, struct insn *insn) { print_func_name(str); @@ -740,6 +830,12 @@ static int print_xor_xmm_reg_reg(struct string *str, struct insn *insn) return print_reg_reg(str, insn); } +static int print_xor_64_xmm_reg_reg(struct string *str, struct insn *insn) +{ + print_func_name(str); + return print_reg_reg(str, insn); +} + typedef int (*print_insn_fn) (struct string *str, struct insn *insn); static print_insn_fn insn_printers[] = { @@ -760,13 +856,21 @@ static print_insn_fn insn_printers[] = { [INSN_DIV_MEMBASE_REG] = print_div_membase_reg, [INSN_DIV_REG_REG] = print_div_reg_reg, [INSN_FADD_REG_REG] = print_fadd_reg_reg, + [INSN_FADD_64_REG_REG] = print_fadd_64_reg_reg, [INSN_FSUB_REG_REG] = print_fsub_reg_reg, + [INSN_FSUB_64_REG_REG] = print_fsub_64_reg_reg, [INSN_FMUL_REG_REG] = print_fmul_reg_reg, + [INSN_FMUL_64_REG_REG] = print_fmul_64_reg_reg, [INSN_FDIV_REG_REG] = print_fdiv_reg_reg, + [INSN_FDIV_64_REG_REG] = print_fdiv_64_reg_reg, [INSN_FLD_MEMBASE] = print_fld_membase, + [INSN_FLD_64_MEMBASE] = print_fld_64_membase, [INSN_FSTP_MEMBASE] = print_fstp_membase, + [INSN_FSTP_64_MEMBASE] = print_fstp_64_membase, [INSN_MOV_MEMBASE_XMM] = print_mov_membase_xmm, + [INSN_MOV_64_MEMBASE_XMM] = print_mov_64_membase_xmm, [INSN_MOV_XMM_MEMBASE] = print_mov_xmm_membase, + [INSN_MOV_64_XMM_MEMBASE] = print_mov_64_xmm_membase, [INSN_CONV_FPU_TO_GPR] = print_conv_fpu_to_gpr, [INSN_CONV_GPR_TO_FPU] = print_conv_gpr_to_fpu, [INSN_JE_BRANCH] = print_je_branch, @@ -783,10 +887,13 @@ static print_insn_fn insn_printers[] = { [INSN_MOV_IP_THREAD_LOCAL_MEMBASE] = print_mov_ip_tlmembase, [INSN_MOV_MEMLOCAL_REG] = print_mov_memlocal_reg, [INSN_MOV_MEMLOCAL_XMM] = print_mov_memlocal_xmm, + [INSN_MOV_64_MEMLOCAL_XMM] = print_mov_64_memlocal_xmm, [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_64_MEMDISP_XMM] = print_mov_64_memdisp_xmm, [INSN_MOV_MEMINDEX_XMM] = print_mov_memindex_xmm, + [INSN_MOV_64_MEMINDEX_XMM] = print_mov_64_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, @@ -796,10 +903,14 @@ static print_insn_fn insn_printers[] = { [INSN_MOV_REG_THREAD_LOCAL_MEMBASE] = print_mov_reg_tlmembase, [INSN_MOV_REG_THREAD_LOCAL_MEMDISP] = print_mov_reg_tlmemdisp, [INSN_MOV_XMM_MEMLOCAL] = print_mov_xmm_memlocal, + [INSN_MOV_64_XMM_MEMLOCAL] = print_mov_64_xmm_memlocal, [INSN_MOV_REG_REG] = print_mov_reg_reg, [INSN_MOV_XMM_MEMDISP] = print_mov_xmm_memdisp, + [INSN_MOV_64_XMM_MEMDISP] = print_mov_64_xmm_memdisp, [INSN_MOV_XMM_MEMINDEX] = print_mov_xmm_memindex, + [INSN_MOV_64_XMM_MEMINDEX] = print_mov_64_xmm_memindex, [INSN_MOV_XMM_XMM] = print_mov_xmm_xmm, + [INSN_MOV_64_XMM_XMM] = print_mov_64_xmm_xmm, [INSN_MOVSX_8_REG_REG] = print_movsx_8_reg_reg, [INSN_MOVSX_16_REG_REG] = print_movsx_16_reg_reg, [INSN_MOVZX_16_REG_REG] = print_movzx_16_reg_reg, @@ -830,6 +941,7 @@ static print_insn_fn insn_printers[] = { [INSN_XOR_IMM_REG] = print_xor_imm_reg, [INSN_XOR_REG_REG] = print_xor_reg_reg, [INSN_XOR_XMM_REG_REG] = print_xor_xmm_reg_reg, + [INSN_XOR_64_XMM_REG_REG] = print_xor_64_xmm_reg_reg, }; int lir_print(struct insn *insn, struct string *str) diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c index 0c0a34f..349ac1e 100644 --- a/arch/x86/use-def.c +++ b/arch/x86/use-def.c @@ -58,15 +58,23 @@ static struct insn_info insn_infos[] = { DECLARE_INFO(INSN_DIV_MEMBASE_REG, USE_SRC | USE_DST | DEF_DST | DEF_xAX | DEF_xDX), DECLARE_INFO(INSN_DIV_REG_REG, USE_SRC | USE_DST | DEF_DST | DEF_xAX | DEF_xDX), DECLARE_INFO(INSN_FADD_REG_REG, USE_SRC | USE_DST | DEF_DST), + DECLARE_INFO(INSN_FADD_64_REG_REG, USE_SRC | USE_DST | DEF_DST), DECLARE_INFO(INSN_FSUB_REG_REG, USE_SRC | USE_DST | DEF_DST), + DECLARE_INFO(INSN_FSUB_64_REG_REG, USE_SRC | USE_DST | DEF_DST), DECLARE_INFO(INSN_FMUL_REG_REG, USE_SRC | USE_DST | DEF_DST), + DECLARE_INFO(INSN_FMUL_64_REG_REG, USE_SRC | USE_DST | DEF_DST), DECLARE_INFO(INSN_FDIV_REG_REG, USE_SRC | USE_DST | DEF_DST), + DECLARE_INFO(INSN_FDIV_64_REG_REG, USE_SRC | USE_DST | DEF_DST), DECLARE_INFO(INSN_FLD_MEMBASE, USE_SRC), + DECLARE_INFO(INSN_FLD_64_MEMBASE, USE_SRC), DECLARE_INFO(INSN_FSTP_MEMBASE, USE_SRC), + DECLARE_INFO(INSN_FSTP_64_MEMBASE, USE_SRC), DECLARE_INFO(INSN_CONV_GPR_TO_FPU, USE_SRC | DEF_DST), DECLARE_INFO(INSN_CONV_FPU_TO_GPR, USE_SRC | DEF_DST), DECLARE_INFO(INSN_MOV_MEMBASE_XMM, USE_SRC | DEF_DST), + DECLARE_INFO(INSN_MOV_64_MEMBASE_XMM, USE_SRC | DEF_DST), DECLARE_INFO(INSN_MOV_XMM_MEMBASE, USE_SRC | USE_DST), + DECLARE_INFO(INSN_MOV_64_XMM_MEMBASE, USE_SRC | USE_DST), DECLARE_INFO(INSN_JE_BRANCH, USE_NONE | DEF_NONE), DECLARE_INFO(INSN_JGE_BRANCH, USE_NONE | DEF_NONE), DECLARE_INFO(INSN_JG_BRANCH, USE_NONE | DEF_NONE), @@ -82,23 +90,30 @@ static struct insn_info insn_infos[] = { DECLARE_INFO(INSN_MOV_IP_REG, DEF_DST), DECLARE_INFO(INSN_MOV_MEMLOCAL_REG, USE_FP | DEF_DST), DECLARE_INFO(INSN_MOV_MEMLOCAL_XMM, USE_FP | DEF_DST), + DECLARE_INFO(INSN_MOV_64_MEMLOCAL_XMM, USE_FP | DEF_DST), DECLARE_INFO(INSN_MOV_MEMBASE_REG, USE_SRC | DEF_DST), DECLARE_INFO(INSN_MOV_MEMDISP_REG, USE_NONE | DEF_DST), DECLARE_INFO(INSN_MOV_MEMDISP_XMM, USE_NONE | DEF_DST), + DECLARE_INFO(INSN_MOV_64_MEMDISP_XMM, USE_NONE | DEF_DST), DECLARE_INFO(INSN_MOV_REG_MEMBASE, USE_SRC | USE_DST), 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_64_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), DECLARE_INFO(INSN_MOV_REG_THREAD_LOCAL_MEMDISP, USE_SRC | DEF_NONE), DECLARE_INFO(INSN_MOV_XMM_MEMLOCAL, USE_SRC), + DECLARE_INFO(INSN_MOV_64_XMM_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_64_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_64_XMM_MEMINDEX, USE_SRC | USE_DST | USE_IDX_DST | DEF_NONE), DECLARE_INFO(INSN_MOV_XMM_XMM, USE_SRC | DEF_DST), + DECLARE_INFO(INSN_MOV_64_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), DECLARE_INFO(INSN_MOVZX_16_REG_REG, USE_SRC | DEF_DST), @@ -129,6 +144,7 @@ static struct insn_info insn_infos[] = { DECLARE_INFO(INSN_XOR_IMM_REG, USE_SRC | USE_DST | DEF_DST), DECLARE_INFO(INSN_XOR_REG_REG, USE_SRC | USE_DST | DEF_DST), DECLARE_INFO(INSN_XOR_XMM_REG_REG, USE_SRC | USE_DST | DEF_DST), + DECLARE_INFO(INSN_XOR_64_XMM_REG_REG, USE_SRC | USE_DST | DEF_DST), }; void insn_sanity_check(void) -- 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