Reland "[LoongArch] Fix codegen of atomicrmw nand"
authorWeining Lu <luweining@loongson.cn>
Tue, 18 Oct 2022 23:58:35 +0000 (07:58 +0800)
committerWeining Lu <luweining@loongson.cn>
Wed, 19 Oct 2022 02:05:35 +0000 (10:05 +0800)
commit771aee91c85b15bb854f4811822d6bb74107bb2e
tree7f6f9212bf48145d89c6047ddd5766fb192d7b8d
parentdf9d60af1f9fa44f411b656bbc691d950c6fc087
Reland "[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.

Patch by lrzlin (Lin Runze).

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