[PATCH] D158197: [PowerPC][lld] Account for additional X-Forms -> D-Form/DS-Forms load/stores when relaxing initial-exec to local-exec

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 09:43:16 PDT 2023


MaskRay added inline comments.


================
Comment at: lld/ELF/Arch/PPC64.cpp:846
+// DS-Form instructions.
+unsigned elf::getPPCDSFormOp(unsigned secondaryOp) {
+  switch (secondaryOp) {
----------------
nemanjai wrote:
> I understand the motivation to return both the primary opcode and the last two bits here to differentiate `LWA` from `LD/STD`. However, I am not a fan of the different interface of these very similar and related functions.
> 
> Do any users of `getPPCDFormOp()` need the primary opcode to be in the least significant bits? Could we change the interface to return the instruction with the primary opcode in the most significant bits regardless of whether it is `D-Form/DS-Form` or even (in the future) `DQ-Form`?
`static unsigned getPPCDSFormOp`

`getPPCDFormOp` is external just because PPC.cpp uses it as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158197/new/

https://reviews.llvm.org/D158197



More information about the llvm-commits mailing list