Skip to content

Commit

Permalink
review: Add comment on mov_constant pattern checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco committed Nov 22, 2023
1 parent 9b3cc9a commit 11e477e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/arch/riscv64/mangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ instr_is_ldstex_mangling(dcontext_t *dcontext, instr_t *instr)
instr_is_exclusive_store(instr_get_prev(instr_get_prev(instr)))) ||
instr_is_exclusive_load(instr) || instr_is_exclusive_store(instr) ||
(instr_is_mov_constant(instr, &val) &&
/* XXX: These are fragile, should we look backward a bit to check for more
specific patterns? */
(val == 1 /* cas fail */ || val == -1 /* reservation invalidation */ ||
val == 4 /* lr.w/sc.w size */ || val == 8 /* lr.d/sc.d size */)))
return true;
Expand Down

0 comments on commit 11e477e

Please sign in to comment.