This implements the emitter for INSN_MOV_THREAD_LOCAL_MEMDISP_REG.
Signed-off-by: Eduard - Gabriel Munteanu <[email protected]>
---
arch/x86/emit-code.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index c54f428..c9bdae4 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -2076,6 +2076,16 @@ static void emit_mov_reg_memdisp(struct buffer *buf,
__emit_reg_memdisp(buf, rex_w, 0x89, mach_reg(&src->reg), dest->imm);
}
+static void emit_mov_thread_local_memdisp_reg(struct buffer *buf,
+ struct operand *src,
+ struct operand *dest)
+{
+ int rex_w = is_64bit_reg(dest);
+
+ emit(buf, 0x64); /* FS segment override prefix */
+ __emit_memdisp_reg(buf, rex_w, 0x8b, src->imm, mach_reg(&dest->reg));
+}
+
static void __emit64_test_membase_reg(struct buffer *buf,
enum machine_reg src,
unsigned long disp,
@@ -2213,6 +2223,7 @@ struct emitter emitters[] = {
DECL_EMITTER(INSN_MOV_REG_MEMDISP, emit_mov_reg_memdisp, TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_REG_MEMLOCAL, emit_mov_reg_memlocal,
TWO_OPERANDS),
DECL_EMITTER(INSN_MOV_REG_REG, emit_mov_reg_reg, TWO_OPERANDS),
+ DECL_EMITTER(INSN_MOV_THREAD_LOCAL_MEMDISP_REG,
emit_mov_thread_local_memdisp_reg, TWO_OPERANDS),
DECL_EMITTER(INSN_PUSH_IMM, emit_push_imm, SINGLE_OPERAND),
DECL_EMITTER(INSN_PUSH_REG, emit_push_reg, SINGLE_OPERAND),
DECL_EMITTER(INSN_POP_REG, emit_pop_reg, SINGLE_OPERAND),
--
1.6.0.6
------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel