[PATCH] D139535: [SPARC] Add GNU syntax extensions of WRPR instruction

Koakuma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 06:20:35 PST 2022


koakuma created this revision.
koakuma added reviewers: brad, dcederman, MaskRay, ro, arsenm.
Herald added subscribers: StephenFan, jrtc27, fedor.sergeev, hiraditya, jyknight.
Herald added a project: All.
koakuma requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Add two GNU extension forms of `wrpr`:

1. `wrpr %reg, %rd -> wrpr %reg, %g0, %rd`
2. `wrpr  imm, %rd -> wrpr  %g0, imm, %rd`

Note: since the semantics of `wrpr %rs1, %rs2/imm, %rd` is `%rd <- (%rs1 xor %rs2/imm)`, in case (1) it technically doesn't matter whether the `%g0` is placed as the first or second operand, however, I'm placing it as the second operand to match the encoding of GNU as.

This fixes the `wrpr` instruction part of bug #40792 (https://github.com/llvm/llvm-project/issues/40792).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139535

Files:
  llvm/lib/Target/Sparc/SparcInstrAliases.td
  llvm/test/MC/Sparc/sparcv9-instructions.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139535.480885.patch
Type: text/x-patch
Size: 7923 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/0832ec3b/attachment.bin>


More information about the llvm-commits mailing list