Skip to content

Commit

Permalink
i#1569 AArch64: Implement instr_is_mov_constant, instr_is_exclusive_s…
Browse files Browse the repository at this point in the history
…tore.

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
  • Loading branch information
egrimley-arm committed Sep 12, 2016
1 parent b95d14c commit 27e4737
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions core/arch/aarch64/instr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit 27e4737

Please sign in to comment.