]> git.ipfire.org Git - thirdparty/valgrind.git/commit
s390x: Rework s390_disasm interface (BZ 498942)
authorFlorian Krohm <flo2030@eich-krohm.de>
Sat, 15 Mar 2025 23:18:59 +0000 (23:18 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Sat, 15 Mar 2025 23:18:59 +0000 (23:18 +0000)
commitc3049684e26ee4300c797a11c9b88708223771f3
treeaa46baf624e4a5d42ffbfddb8a4a7d074bc15adf
parent17ac4a379dfee9b06a7988d2268a9614ca5cd385
s390x: Rework s390_disasm interface  (BZ 498942)

The way extended mnemonics were communicated to s390_disasm was a bit messy
and, more importantly, error prone. The primary reason is that extended
mnemonics were added late in the game (at the time) and sort of force-fitted
on top of the existing scheme. Here are a few examples showing the new
way of doing things:

old: s390_disasm(ENC3(MNM, GPR, UINT), mnm, r1, i2);
new: S390_DISASM(MNM(mnm), GPR(r1), UINT(i2));

old: s390_disasm(ENC3(MNM, FPR, UDXB), mnm, r1, d2, x2, b2);
new: S390_DISASM(MNM(mnm), FPR(r1), UDXB(d2, x2, b2));

The arguments to S390_DISASM are essentially constructors for the various
opcode fields. They appear in the same order as written in Principles of Ops.

old: s390_disasm(ENC4(XMNM, GPR, INT, CABM), S390_XMNM_CAB, mnm, m3, r1, i2, m3);
new: S390_DISASM(XMNM(mnm, cabt_disasm), GPR(r1), INT(i2), MASK(m3));

The 2nd argument to XMNM() is a function that constructs the extended mnemonic
and writes the disassembed insn as appropriate.

Fixes https://bugs.kde.org/show_bug.cgi?id=498942
NEWS
VEX/priv/guest_s390_toIR.c
VEX/priv/host_s390_defs.c
VEX/priv/s390_disasm.c
VEX/priv/s390_disasm.h