[PATCH] D52099: [PPC64] Add split-stack support.

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 09:24:51 PDT 2018


sfertile marked an inline comment as done.
sfertile added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:761
+  if (getPrimaryOpCode(SecondInstr) == 14) {
+    assert(!LoImm);
+    LoImm = SecondInstr & 0xFFFF;
----------------
ruiu wrote:
> I think this can be triggered by feeding an object file that doesn't comply with the ABI standard, so this shouldn't be an assert. I'd just omit this check.
Good point. I've updated to ensure that if LoImm is set and the second instruction is not a nop or we don't adjust the stack.


================
Comment at: ELF/Arch/PPC64.cpp:794
+  if (HiImm) {
+    write32(Loc + 4, 0x3D810000 | (uint16_t)HiImm);
+    // If the low immediate is zero the second instruction will be a nop.
----------------
ruiu wrote:
> Do you need a cast?
Since LoImm and HiImm can be negative I added the casts so that we zero extend in the conversion from 16 bits to 32 bits. I could instead add a mask for the lower 16bits if that is clearer eg `write32(Loc + 4, 0x3D810000 | (0x0000FFFF & HiImm));`


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D52099





More information about the llvm-commits mailing list