diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-04-06 23:57:33 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-04-06 23:57:33 +0000 |
commit | edaf66b056f6cb9fe08e43cc6d23f0dadb7060d6 (patch) | |
tree | bf2924447f517ebd9abd40c9041da687eabf75ea /llvm/lib/Target/Sparc/SparcISelLowering.h | |
parent | 03d9f7fda6cde43f88accbe7700f47f5515dfb47 (diff) | |
download | bcm5719-llvm-edaf66b056f6cb9fe08e43cc6d23f0dadb7060d6.tar.gz bcm5719-llvm-edaf66b056f6cb9fe08e43cc6d23f0dadb7060d6.zip |
Implement LowerReturn_64 for SPARC v9.
Integer return values are sign or zero extended by the callee, and
structs up to 32 bytes in size can be returned in registers.
The CC_Sparc64 CallingConv definition is shared between
LowerFormalArguments_64 and LowerReturn_64. Function arguments and
return values are passed in the same registers.
The inreg flag is also used for return values. This is required to handle
C functions returning structs containing floats and ints:
struct ifp {
int i;
float f;
};
struct ifp f(void);
LLVM IR:
define inreg { i32, float } @f() {
...
ret { i32, float } %retval
}
The ABI requires that %retval.i is returned in the high bits of %i0
while %retval.f goes in %f1.
Without the inreg return value attribute, %retval.i would go in %i0 and
%retval.f would go in %f3 which is a more efficient way of returning
%multiple values, but it is not ABI compliant for returning C structs.
llvm-svn: 178966
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcISelLowering.h')
-rw-r--r-- | llvm/lib/Target/Sparc/SparcISelLowering.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.h b/llvm/lib/Target/Sparc/SparcISelLowering.h index aa2ef711a08..189a3882d3c 100644 --- a/llvm/lib/Target/Sparc/SparcISelLowering.h +++ b/llvm/lib/Target/Sparc/SparcISelLowering.h @@ -102,6 +102,16 @@ namespace llvm { const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, DebugLoc dl, SelectionDAG &DAG) const; + SDValue LowerReturn_32(SDValue Chain, + CallingConv::ID CallConv, bool IsVarArg, + const SmallVectorImpl<ISD::OutputArg> &Outs, + const SmallVectorImpl<SDValue> &OutVals, + DebugLoc DL, SelectionDAG &DAG) const; + SDValue LowerReturn_64(SDValue Chain, + CallingConv::ID CallConv, bool IsVarArg, + const SmallVectorImpl<ISD::OutputArg> &Outs, + const SmallVectorImpl<SDValue> &OutVals, + DebugLoc DL, SelectionDAG &DAG) const; SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const; SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const; |