]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
LoongArch: Add disassembly support for ud ui5
authorLulu Cai <cailulu@loongson.cn>
Sat, 13 Dec 2025 07:33:15 +0000 (15:33 +0800)
committercailulu <cailulu@loongson.cn>
Sat, 20 Dec 2025 02:49:47 +0000 (10:49 +0800)
commit8bea934667cdf3046dd388e9d07ca055d4ff5277
treed38204560559b41a9ce171b124d30107800c4807
parent28e9d214f9649f8736462b59f18712fb358c5784
LoongArch: Add disassembly support for ud ui5

ud ui5, also known as amswap.w rd,$r1,rj(rd==rj), is displayed as
"ud ui5" by default during disassembly. Alternatively, the original
instruction can be printed using the objdump -M no-aliases.

To implement this support, a format specifier "ru0:5,ru5:5" for ud is
applied exclusively during disassembly. This specifier indicates that
registers should be printed using their corresponding numeric values,
and when the instruction is identified as ud, only a single parameter
is displayed.

binutils/

        * testsuite/binutils-all/loongarch64/dis-amswap-ud-noaliases.d:
  New test.
        * testsuite/binutils-all/loongarch64/dis-amswap-ud.d: New test.
        * testsuite/binutils-all/loongarch64/dis-amswap-ud.s: New test.

gas/

        * testsuite/gas/loongarch/macro_ud.d: Update test.

include/

        * opcode/loongarch.h: New macro.

opcodes/

        * loongarch-dis.c (get_loongarch_opcode_by_binfmt): Correct match `ud`.
        (dis_one_arg): Disassemble the `ud` parameter.
        * loongarch-opc.c: Add opcode for "ud" alias.
binutils/testsuite/binutils-all/loongarch64/dis-amswap-ud-noaliases.d [new file with mode: 0644]
binutils/testsuite/binutils-all/loongarch64/dis-amswap-ud.d [new file with mode: 0644]
binutils/testsuite/binutils-all/loongarch64/dis-amswap-ud.s [new file with mode: 0644]
gas/testsuite/gas/loongarch/macro_ud.d
include/opcode/loongarch.h
opcodes/loongarch-dis.c
opcodes/loongarch-opc.c