[PATCH] D70427: [SystemZ] The Local Area Offset in SystemZFrameLowering.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 02:10:23 PST 2019


jonpa added a comment.



> F0D, F2D, F4D, F6D are used for passing floating-point arguments and must be saved into those specific slots in a function that uses variable argument lists, since the va_list holds a pointer to the start of the register save area, and va_arg assumes the first four floating-point arguments are stored at those particular offsets relative to that pointer.  If you use AllRegs, they'll also be saved there, which isn't really required, but doesn't hurt either.  Any other register, whether the normal call-saved register, or the other call-clobbered ones when using AllRegs, do not have assigned slots and will be saved in some arbitrary place on the stack allocated during register allocation.

For variable arguments, I see that this works since we are indeed adding -160 to the offsets from the table in LowerFormalArguments().

If I compile

  define anyregcc void @anyregcc1() {
  entry:
    call void asm sideeffect "", "~{f0}"() nounwind
    ret void
  }

I get

  anyregcc1:                              # @anyregcc1
          .cfi_startproc
  # %bb.0:                                # %entry
          std     %f0, 288(%r15)          # 8-byte Folded Spill
          .cfi_offset %f0, 128
          #APP
          #NO_APP
          ld      %f0, 288(%r15)          # 8-byte Folded Reload
          br      %r14

This seems broken to me since the correct offset for %f0 from the incoming SP is 128, or?


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

https://reviews.llvm.org/D70427





More information about the llvm-commits mailing list