[PATCH] D139303: [LoongArch] Add custom parser for atomic instructions' memory operand

wanglei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 02:01:45 PST 2022


wangleiat created this revision.
wangleiat added reviewers: SixWeining, xen0n, xry111, MaskRay.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
wangleiat requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

1. In order to be compatible with the form of the atomic instruction in

GAS that accepts the fourth operand as 0 (i.e. `am* $rd, $rk, $rj, 0`),
we need to treat `$rj, 0` as one operand, but only print `$rj`.

2. Modified the number of result operands of inline assembly memory

operand `ZB` constraint to 2 (reg + 0).

3. Restrictions on register usage in `am*` instructions have also been

adjusted. When `$rd` is equal to `R0`, the instruction must be
considered legal, because of some special usage, eg: PseudoUNIMP.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139303

Files:
  llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
  llvm/lib/Target/LoongArch/LoongArchAsmPrinter.cpp
  llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp
  llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
  llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchInstPrinter.cpp
  llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchInstPrinter.h
  llvm/test/CodeGen/LoongArch/inline-asm-constraint-ZB.ll
  llvm/test/MC/LoongArch/Basic/Integer/atomic.s
  llvm/test/MC/LoongArch/Basic/Integer/invalid64.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139303.480023.patch
Type: text/x-patch
Size: 13023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221205/91de01ea/attachment.bin>


More information about the llvm-commits mailing list