Skip to content

Commit 9145cdc

Browse files
authored
Merge pull request #2094 from chihminchao/enhance-amo-disasm
disasm: show the acquire and release attribute to amo instructions
2 parents bccbf3b + 7b060d0 commit 9145cdc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

disasm/disasm.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,17 @@ static void NOINLINE add_fstore_insn(disassembler_t* d, const char* name, uint32
643643

644644
static void NOINLINE add_xamo_insn(disassembler_t* d, const char* name, uint32_t match, uint32_t mask)
645645
{
646-
d->add_insn(new disasm_insn_t(name, match, mask, {&xrd, &xrs2, &base_only_address}));
646+
const char *suffix[] = {"", ".rl", ".aq", ".aqrl"};
647+
char new_name[128];
648+
uint32_t new_mask = mask | (0x3 << 25);
649+
uint32_t new_match;
650+
651+
for (uint32_t idx = 0; idx < sizeof(suffix) / sizeof(suffix[0]); ++idx) {
652+
snprintf(new_name, sizeof(new_name), "%s%s", name, suffix[idx]);
653+
new_match = match | (idx << 25);
654+
655+
d->add_insn(new disasm_insn_t(new_name, new_match, new_mask, {&xrd, &xrs2, &base_only_address}));
656+
}
647657
}
648658

649659
static void NOINLINE add_xlr_insn(disassembler_t* d, const char* name, uint32_t match, uint32_t mask)

0 commit comments

Comments
 (0)