[llvm] [LoongArch] Add support for the ud macro instruction (PR #171583)

Lu Weining via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 18:12:06 PST 2025


================
@@ -33,6 +33,13 @@ rdtimeh.w $a7, $a1
 # CHECK-ASM: encoding: [0x03,0x6d,0x00,0x00]
 cpucfg $sp, $a4
 
+# CHECK-ASM-AND-OBJ: ud 0
----------------
SixWeining wrote:

If we still allow users to manually write the instruction `amswap.w $zero, $rk, $zero`, then corresponding assembly and disassembly tests for this instruction should be added. Otherwise, we should remove the condition `Rd != LoongArch::R0` from the `LoongArchAsmParser::checkTargetMatchPredicate` function.

Refer: https://reviews.llvm.org/D139303

https://github.com/llvm/llvm-project/pull/171583


More information about the llvm-commits mailing list