[PATCH] [mips] Add CCValAssign::[ASZ]ExtUpper and CCPromoteToUpperBitsInType and handle struct's correctly on big-endian N32/N64 return values.

Daniel Sanders daniel.sanders at imgtec.com
Wed Sep 10 03:12:16 PDT 2014


Hi vmedic,

The N32/N64 ABI's require that structs passed in registers are laid out
such that spilling the register with 'sd' places the struct at the lowest
address. For little endian this is trivial but for big-endian it requires
that structs are shifted into the upper bits of the register.

We also require that structs passed in registers have the 'inreg'
attribute for big-endian N32/N64 to work correctly. This is because the
tablegen-erated calling convention implementation only has access to the
lowered form of struct arguments (one or more integers of up to 64-bits
each) and is unable to determine the original type.

http://reviews.llvm.org/D5286

Files:
  include/llvm/CodeGen/CallingConvLower.h
  include/llvm/Target/TargetCallingConv.td
  lib/Target/Mips/MipsCallingConv.td
  lib/Target/Mips/MipsISelLowering.cpp
  test/CodeGen/Mips/cconv/return-struct.ll
  utils/TableGen/CallingConvEmitter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5286.13524.patch
Type: text/x-patch
Size: 13342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140910/a0ab740e/attachment.bin>


More information about the llvm-commits mailing list