[mips] Add CCValAssign::[ASZ]ExtUpper and CCPromoteToUpperBitsInType and handle struc...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 25 Sep 2014 12:15:05 +0000 (12:15 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Thu, 25 Sep 2014 12:15:05 +0000 (12:15 +0000)
commit03fe69e90d2e9c0104ea9a94aa3a417ed12f2f92
treef59b224cb1cd90721d631e6ca400c4d5071a8f36
parent6765c34b0c930afc7add70b31b2f17f6d3c6c917
[mips] Add CCValAssign::[ASZ]ExtUpper and CCPromoteToUpperBitsInType and handle struct's correctly on big-endian N32/N64 return values.

Summary:
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.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5286

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218451 91177308-0d34-0410-b5e6-96231b3b80d8
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 [new file with mode: 0644]
utils/TableGen/CallingConvEmitter.cpp