mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-23 04:52:54 +02:00
Add support for return value promotion in X86 calling conventions.
Patch by Yiannis Tsiouris! llvm-svn: 157757
This commit is contained in:
parent
19569cbcde
commit
a77ddf1405
@ -1504,6 +1504,16 @@ X86TargetLowering::LowerReturn(SDValue Chain,
|
|||||||
SDValue ValToCopy = OutVals[i];
|
SDValue ValToCopy = OutVals[i];
|
||||||
EVT ValVT = ValToCopy.getValueType();
|
EVT ValVT = ValToCopy.getValueType();
|
||||||
|
|
||||||
|
// Promote values to the appropriate types
|
||||||
|
if (VA.getLocInfo() == CCValAssign::SExt)
|
||||||
|
ValToCopy = DAG.getNode(ISD::SIGN_EXTEND, dl, VA.getLocVT(), ValToCopy);
|
||||||
|
else if (VA.getLocInfo() == CCValAssign::ZExt)
|
||||||
|
ValToCopy = DAG.getNode(ISD::ZERO_EXTEND, dl, VA.getLocVT(), ValToCopy);
|
||||||
|
else if (VA.getLocInfo() == CCValAssign::AExt)
|
||||||
|
ValToCopy = DAG.getNode(ISD::ANY_EXTEND, dl, VA.getLocVT(), ValToCopy);
|
||||||
|
else if (VA.getLocInfo() == CCValAssign::BCvt)
|
||||||
|
ValToCopy = DAG.getNode(ISD::BITCAST, dl, VA.getLocVT(), ValToCopy);
|
||||||
|
|
||||||
// If this is x86-64, and we disabled SSE, we can't return FP values,
|
// If this is x86-64, and we disabled SSE, we can't return FP values,
|
||||||
// or SSE or MMX vectors.
|
// or SSE or MMX vectors.
|
||||||
if ((ValVT == MVT::f32 || ValVT == MVT::f64 ||
|
if ((ValVT == MVT::f32 || ValVT == MVT::f64 ||
|
||||||
|
Loading…
Reference in New Issue
Block a user