diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2014-01-12 04:13:17 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2014-01-12 04:13:17 +0000 |
commit | 1655be290cf871f22b1da1fc700ad9e1deab2a01 (patch) | |
tree | 8be8b3e95a4552705c5745ce089e5f1e487923e1 /test/CodeGen/SPARC/64abi.ll | |
parent | 86802628de93cd3011e77543e6a7010de12bba87 (diff) |
The SPARCv9 ABI returns a float in %f0.
This is different from the argument passing convention which puts the
first float argument in %f1.
With this patch, all returned floats are treated as if the 'inreg' flag
were set. This means multiple float return values get packed in %f0,
%f1, %f2, ...
Note that when returning a struct in registers, clang will set the
'inreg' flag on the return value, so that behavior is unchanged. This
also happens when returning a float _Complex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SPARC/64abi.ll')
-rw-r--r-- | test/CodeGen/SPARC/64abi.ll | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/CodeGen/SPARC/64abi.ll b/test/CodeGen/SPARC/64abi.ll index 7f9d216e52e..37718889cb7 100644 --- a/test/CodeGen/SPARC/64abi.ll +++ b/test/CodeGen/SPARC/64abi.ll @@ -180,7 +180,7 @@ define void @call_inreg_fi(i32* %p, i32 %i1, float %f5) { } ; CHECK: inreg_ff -; CHECK: fsubs %f0, %f1, %f1 +; CHECK: fsubs %f0, %f1, %f0 define float @inreg_ff(float inreg %a0, ; %f0 float inreg %a1) { ; %f1 %rv = fsub float %a0, %a1 @@ -262,10 +262,10 @@ define void @call_ret_i64_pair(i64* %i0) { ret void } -; This is not a C struct, each member uses 8 bytes. +; This is not a C struct, the i32 member uses 8 bytes, but the float only 4. ; CHECK: ret_i32_float_pair ; CHECK: ld [%i2], %i0 -; CHECK: ld [%i3], %f3 +; CHECK: ld [%i3], %f2 define { i32, float } @ret_i32_float_pair(i32 %a0, i32 %a1, i32* %p, float* %q) { %r1 = load i32* %p @@ -279,7 +279,7 @@ define { i32, float } @ret_i32_float_pair(i32 %a0, i32 %a1, ; CHECK: call_ret_i32_float_pair ; CHECK: call ret_i32_float_pair ; CHECK: st %o0, [%i0] -; CHECK: st %f3, [%i1] +; CHECK: st %f2, [%i1] define void @call_ret_i32_float_pair(i32* %i0, float* %i1) { %rv = call { i32, float } @ret_i32_float_pair(i32 undef, i32 undef, i32* undef, float* undef) |