diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-31 17:28:20 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-31 17:28:20 +0000 |
| commit | 4f203ea34b3be825e019d173bf14c7577b608ea2 (patch) | |
| tree | a8e1edece160fbc9e3bf6b9fcd7c1302dea7ddc0 /llvm/lib/Target | |
| parent | afcfef147bebc697b574e032d2c99388f19d5152 (diff) | |
| download | bcm5719-llvm-4f203ea34b3be825e019d173bf14c7577b608ea2.tar.gz bcm5719-llvm-4f203ea34b3be825e019d173bf14c7577b608ea2.zip | |
Add support for return value promotion in X86 calling conventions.
Patch by Yiannis Tsiouris!
llvm-svn: 157757
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 58af729af1c..f3b66e4f903 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1504,6 +1504,16 @@ X86TargetLowering::LowerReturn(SDValue Chain, SDValue ValToCopy = OutVals[i]; 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, // or SSE or MMX vectors. if ((ValVT == MVT::f32 || ValVT == MVT::f64 || |

