This is an archive of the discontinued LLVM Phabricator instance.

[SPARC] Add GNU syntax extensions of WRPR instruction
ClosedPublic

Authored by koakuma on Dec 7 2022, 6:20 AM.

Details

Summary

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).

Diff Detail

Event Timeline

koakuma created this revision.Dec 7 2022, 6:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 6:20 AM
koakuma requested review of this revision.Dec 7 2022, 6:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 6:20 AM
arsenm accepted this revision.Dec 13 2022, 2:23 PM

I don't know any of the context but the change itself looks fine

This revision is now accepted and ready to land.Dec 13 2022, 2:23 PM
This revision was landed with ongoing or failed builds.Dec 13 2022, 3:03 PM
This revision was automatically updated to reflect the committed changes.