[LoongArch] Fix codegen of atomicrmw nand
authorWeining Lu <luweining@loongson.cn>
Tue, 18 Oct 2022 09:33:50 +0000 (17:33 +0800)
committerWeining Lu <luweining@loongson.cn>
Tue, 18 Oct 2022 12:39:20 +0000 (20:39 +0800)
commit9572406bbcb497f8c23c28daa762b55ee3219f41
treee165fa2ffb24dfcd1bbe8546ce36022615246da4
parent599f261c9258e1e1d7f8228cc5ae88b4fa6f846d
[LoongArch] Fix codegen of atomicrmw nand

Fix invalid RISCV-like MI being emitted for performing the `not`
operation: the LoongArch `xori` zero-extends the immediate, hence is
not equivalent to RISCV `xori`. The LoongArch `not` is a `nor` with
zero.

Differential Revision: https://reviews.llvm.org/D136021
llvm/lib/Target/LoongArch/LoongArchExpandAtomicPseudoInsts.cpp
llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw.ll