]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
LoongArch: Add support for the ud macro instruction
authorLulu Cai <cailulu@loongson.cn>
Fri, 28 Nov 2025 07:54:58 +0000 (15:54 +0800)
committercailulu <cailulu@loongson.cn>
Tue, 9 Dec 2025 09:06:26 +0000 (17:06 +0800)
commit9bb91ce42f34798131d60a26a9dda5dae3025c9b
tree96d070894eda7a669b5bc59b9ca4e6d827929b75
parentbf85c50303457cb2d50779456ba291011fd60577
LoongArch: Add support for the ud macro instruction

In the "ud ui5" macro, the value of ui5 must be in the range 0–31. It
expands to "amswap.w $rd, $r1, $rj", where ui5 specifies the register
number for $rd in the amswap.w instruction, and $rd == $rj.

The test case have been adjusted to no longer report errors for illegal
operands of the amswap.w instruction.

gas/

* config/tc-loongarch.c (check_this_insn_before_appending): No
  longer check amswap.w.
* testsuite/gas/loongarch/illegal-operand.l: Update.
* testsuite/gas/loongarch/illegal-operand.s: Update.
* testsuite/gas/loongarch/macro_ud.d: New test.
* testsuite/gas/loongarch/macro_ud.s: New test.

include/

* opcode/loongarch.h: Add new macro for amswap.w.

opcodes/

* loongarch-opc.c: Add macro for ud.
gas/config/tc-loongarch.c
gas/testsuite/gas/loongarch/illegal-operand.l
gas/testsuite/gas/loongarch/illegal-operand.s
gas/testsuite/gas/loongarch/macro_ud.d [new file with mode: 0644]
gas/testsuite/gas/loongarch/macro_ud.s [new file with mode: 0644]
include/opcode/loongarch.h
opcodes/loongarch-opc.c