Skip to content
Snippets Groups Projects
Commit 83056896 authored by Chris Dewhurst's avatar Chris Dewhurst
Browse files

[Sparc] Complex return value ABI compliance.

According to the Sparc V8 ABI, complex numbers should be passed and returned as pairs of registers:

https://docs.oracle.com/cd/E26502_01/html/E28387/gentextid-2734.html

This fix ensures this is the case. Without this, complex numbers are returned as a struct of two floats, which breaks the ABI rules.

Differential Review: http://reviews.llvm.org/D20955

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272148 91177308-0d34-0410-b5e6-96231b3b80d8
parent ac13d7e4
No related branches found
No related tags found
No related merge requests found
// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
// CHECK-LABEL: define { float, float } @p({ float, float }* byval align 4 %a, { float, float }* byval align 4 %b) #0 {
float __complex__
p (float __complex__ a, float __complex__ b)
{
}
// CHECK-LABEL: define { double, double } @q({ double, double }* byval align 8 %a, { double, double }* byval align 8 %b) #0 {
double __complex__
q (double __complex__ a, double __complex__ b)
{
}
// CHECK-LABEL: define { i64, i64 } @r({ i64, i64 }* byval align 8 %a, { i64, i64 }* byval align 8 %b) #0 {
long long __complex__
r (long long __complex__ a, long long __complex__ b)
{
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment