From 27e4737b3a2850e28adedc530e2f628e2cf3f0da Mon Sep 17 00:00:00 2001 From: Edmund Grimley Evans Date: Mon, 12 Sep 2016 09:19:36 +0100 Subject: [PATCH] i#1569 AArch64: Implement instr_is_mov_constant, instr_is_exclusive_store. instr_is_mov_constant recognises mov{n,z}. instr_is_exclusive_store recognises st{l,}x{p,r,rb,rh}. Review-URL: https://codereview.appspot.com/307260043 --- core/arch/aarch64/instr.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/core/arch/aarch64/instr.c b/core/arch/aarch64/instr.c index cbb3c9ba58c..a025b395155 100644 --- a/core/arch/aarch64/instr.c +++ b/core/arch/aarch64/instr.c @@ -216,11 +216,11 @@ instr_is_mov_constant(instr_t *instr, ptr_int_t *value) */ /* movn/movz reg, imm */ - /* FIXME i#1569: NYI */ - if (false) { + if (opc == OP_movn || opc == OP_movz) { opnd_t op = instr_get_src(instr, 0); if (opnd_is_immed_int(op)) { - *value = opnd_get_immed_int(op); + ptr_int_t imm = opnd_get_immed_int(op); + *value = (opc == OP_movn ? ~imm : imm); return true; } else return false; @@ -375,6 +375,16 @@ DR_API bool instr_is_exclusive_store(instr_t *instr) { - /* FIXME i#1569: NYI */ + switch (instr_get_opcode(instr)) { + case OP_stlxp: + case OP_stlxr: + case OP_stlxrb: + case OP_stlxrh: + case OP_stxp: + case OP_stxr: + case OP_stxrb: + case OP_stxrh: + return true; + } return false; }