Signed-off-by: Tomek Grabiec <[email protected]>
---
arch/x86/emit-code.c | 24 ++++++++++++++++++++++++
arch/x86/include/arch/instruction.h | 4 ++++
arch/x86/lir-printer.c | 28 ++++++++++++++++++++++++++++
arch/x86/use-def.c | 12 ++++++++----
4 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index e1eb5ba..e84e725 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -1154,6 +1154,16 @@ 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_fld_memlocal(struct buffer *buf, struct operand *src)
+{
+ __emit_membase(buf, 0xd9, MACH_REG_EBP, slot_offset(src->slot), 0);
+}
+
+static void emit_fld_64_memlocal(struct buffer *buf, struct operand *src)
+{
+ __emit_membase(buf, 0xdd, MACH_REG_EBP, slot_offset_64(src->slot), 0);
+}
+
static void emit_fild_64_membase(struct buffer *buf, struct operand *src)
{
__emit_membase(buf, 0xdf, mach_reg(&src->base_reg), src->disp, 5);
@@ -1179,11 +1189,21 @@ 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_memlocal(struct buffer *buf, struct operand *dest)
+{
+ __emit_membase(buf, 0xd9, MACH_REG_EBP, slot_offset(dest->slot), 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_fstp_64_memlocal(struct buffer *buf, struct operand *dest)
+{
+ __emit_membase(buf, 0xdd, MACH_REG_EBP, slot_offset_64(dest->slot), 3);
+}
+
static void emit_add_membase_reg(struct buffer *buf,
struct operand *src, struct operand *dest)
{
@@ -1680,13 +1700,17 @@ struct emitter emitters[] = {
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_MEMLOCAL, emit_fld_memlocal, TWO_OPERANDS),
DECL_EMITTER(INSN_FLD_64_MEMBASE, emit_fld_64_membase, TWO_OPERANDS),
+ DECL_EMITTER(INSN_FLD_64_MEMLOCAL, emit_fld_64_memlocal, TWO_OPERANDS),
DECL_EMITTER(INSN_FLDCW_MEMBASE, emit_fldcw_membase, SINGLE_OPERAND),
DECL_EMITTER(INSN_FILD_64_MEMBASE, emit_fild_64_membase, TWO_OPERANDS),
DECL_EMITTER(INSN_FISTP_64_MEMBASE, emit_fistp_64_membase,
SINGLE_OPERAND),
DECL_EMITTER(INSN_FNSTCW_MEMBASE, emit_fnstcw_membase, SINGLE_OPERAND),
DECL_EMITTER(INSN_FSTP_MEMBASE, emit_fstp_membase, TWO_OPERANDS),
+ DECL_EMITTER(INSN_FSTP_MEMLOCAL, emit_fstp_memlocal, TWO_OPERANDS),
DECL_EMITTER(INSN_FSTP_64_MEMBASE, emit_fstp_64_membase, TWO_OPERANDS),
+ DECL_EMITTER(INSN_FSTP_64_MEMLOCAL, emit_fstp_64_memlocal,
TWO_OPERANDS),
DECL_EMITTER(INSN_CONV_GPR_TO_FPU, emit_conv_gpr_to_fpu, TWO_OPERANDS),
DECL_EMITTER(INSN_CONV_GPR_TO_FPU64, emit_conv_gpr_to_fpu64,
TWO_OPERANDS),
DECL_EMITTER(INSN_CONV_FPU_TO_GPR, emit_conv_fpu_to_gpr, TWO_OPERANDS),
diff --git a/arch/x86/include/arch/instruction.h
b/arch/x86/include/arch/instruction.h
index 0186745..50c6678 100644
--- a/arch/x86/include/arch/instruction.h
+++ b/arch/x86/include/arch/instruction.h
@@ -87,13 +87,17 @@ enum insn_type {
INSN_FSUB_REG_REG,
INSN_FSUB_64_REG_REG,
INSN_FLD_MEMBASE,
+ INSN_FLD_MEMLOCAL,
INSN_FLD_64_MEMBASE,
+ INSN_FLD_64_MEMLOCAL,
INSN_FLDCW_MEMBASE,
INSN_FILD_64_MEMBASE,
INSN_FISTP_64_MEMBASE,
INSN_FNSTCW_MEMBASE,
INSN_FSTP_MEMBASE,
+ INSN_FSTP_MEMLOCAL,
INSN_FSTP_64_MEMBASE,
+ INSN_FSTP_64_MEMLOCAL,
INSN_CONV_FPU_TO_GPR,
INSN_CONV_FPU64_TO_GPR,
INSN_CONV_GPR_TO_FPU,
diff --git a/arch/x86/lir-printer.c b/arch/x86/lir-printer.c
index 2980771..ff2a11c 100644
--- a/arch/x86/lir-printer.c
+++ b/arch/x86/lir-printer.c
@@ -335,12 +335,24 @@ static int print_fld_membase(struct string *str, struct
insn *insn)
return print_membase(str, &insn->operand);
}
+static int print_fld_memlocal(struct string *str, struct insn *insn)
+{
+ print_func_name(str);
+ return print_memlocal(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_fld_64_memlocal(struct string *str, struct insn *insn)
+{
+ print_func_name(str);
+ return print_memlocal(str, &insn->operand);
+}
+
static int print_fild_64_membase(struct string *str, struct insn *insn)
{
print_func_name(str);
@@ -359,6 +371,18 @@ static int print_fstp_64_membase(struct string *str,
struct insn *insn)
return print_membase(str, &insn->operand);
}
+static int print_fstp_memlocal(struct string *str, struct insn *insn)
+{
+ print_func_name(str);
+ return print_memlocal(str, &insn->operand);
+}
+
+static int print_fstp_64_memlocal(struct string *str, struct insn *insn)
+{
+ print_func_name(str);
+ return print_memlocal(str, &insn->operand);
+}
+
static int print_fnstcw_membase(struct string *str, struct insn *insn)
{
print_func_name(str);
@@ -975,13 +999,17 @@ static print_insn_fn insn_printers[] = {
[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_MEMLOCAL] = print_fld_memlocal,
[INSN_FLD_64_MEMBASE] = print_fld_64_membase,
+ [INSN_FLD_64_MEMLOCAL] = print_fld_64_memlocal,
[INSN_FLDCW_MEMBASE] = print_fldcw_membase,
[INSN_FILD_64_MEMBASE] = print_fild_64_membase,
[INSN_FISTP_64_MEMBASE] = print_fistp_64_membase,
[INSN_FNSTCW_MEMBASE] = print_fnstcw_membase,
[INSN_FSTP_MEMBASE] = print_fstp_membase,
+ [INSN_FSTP_MEMLOCAL] = print_fstp_memlocal,
[INSN_FSTP_64_MEMBASE] = print_fstp_64_membase,
+ [INSN_FSTP_64_MEMLOCAL] = print_fstp_64_memlocal,
[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,
diff --git a/arch/x86/use-def.c b/arch/x86/use-def.c
index feffb5a..056e715 100644
--- a/arch/x86/use-def.c
+++ b/arch/x86/use-def.c
@@ -68,13 +68,17 @@ static struct insn_info insn_infos[] = {
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_FLDCW_MEMBASE, USE_SRC | DEF_NONE),
- DECLARE_INFO(INSN_FLD_MEMBASE, USE_SRC),
- DECLARE_INFO(INSN_FLD_64_MEMBASE, USE_SRC),
+ DECLARE_INFO(INSN_FLD_MEMBASE, USE_SRC | DEF_NONE),
+ DECLARE_INFO(INSN_FLD_MEMLOCAL, USE_FP | DEF_NONE),
+ DECLARE_INFO(INSN_FLD_64_MEMBASE, USE_SRC | DEF_NONE),
+ DECLARE_INFO(INSN_FLD_64_MEMLOCAL, USE_FP | DEF_NONE),
DECLARE_INFO(INSN_FILD_64_MEMBASE, USE_SRC),
DECLARE_INFO(INSN_FISTP_64_MEMBASE, USE_SRC | DEF_NONE),
DECLARE_INFO(INSN_FNSTCW_MEMBASE, USE_SRC | DEF_NONE),
- DECLARE_INFO(INSN_FSTP_MEMBASE, USE_SRC),
- DECLARE_INFO(INSN_FSTP_64_MEMBASE, USE_SRC),
+ DECLARE_INFO(INSN_FSTP_MEMBASE, USE_SRC | DEF_NONE),
+ DECLARE_INFO(INSN_FSTP_MEMLOCAL, USE_FP | DEF_NONE),
+ DECLARE_INFO(INSN_FSTP_64_MEMBASE, USE_SRC | DEF_NONE),
+ DECLARE_INFO(INSN_FSTP_64_MEMLOCAL, USE_FP | DEF_NONE),
DECLARE_INFO(INSN_CONV_GPR_TO_FPU, USE_SRC | DEF_DST),
DECLARE_INFO(INSN_CONV_GPR_TO_FPU64, USE_SRC | DEF_DST),
DECLARE_INFO(INSN_CONV_FPU_TO_GPR, USE_SRC | DEF_DST),
--
1.6.3.3
------------------------------------------------------------------------------
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