diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-03-21 06:38:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-03-21 06:38:26 +0000 |
| commit | 5abbe6cef52829a6f52f27de724fe2a995f773b0 (patch) | |
| tree | 93714a1ad09b030dd28f416c3047ebedf289114c /llvm/test | |
| parent | 7e59a30e9fb5b365c062b6e08aa399adb29994e7 (diff) | |
| download | bcm5719-llvm-5abbe6cef52829a6f52f27de724fe2a995f773b0.tar.gz bcm5719-llvm-5abbe6cef52829a6f52f27de724fe2a995f773b0.zip | |
Add support for calls that return two FP values in
ST(0)/ST(1).
llvm-svn: 48634
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/fp-stack-2results.ll | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fp-stack-2results.ll b/llvm/test/CodeGen/X86/fp-stack-2results.ll index dcb2031a504..f47fd7472ec 100644 --- a/llvm/test/CodeGen/X86/fp-stack-2results.ll +++ b/llvm/test/CodeGen/X86/fp-stack-2results.ll @@ -19,3 +19,42 @@ define {x86_fp80, x86_fp80} @test2() { ret x86_fp80 %A, x86_fp80 %A } +; Uses both values. +define void @call1(x86_fp80 *%P1, x86_fp80 *%P2) { + %a = call {x86_fp80,x86_fp80} @test() + %b = getresult {x86_fp80,x86_fp80} %a, 0 + store x86_fp80 %b, x86_fp80* %P1 + + %c = getresult {x86_fp80,x86_fp80} %a, 1 + store x86_fp80 %c, x86_fp80* %P2 + ret void +} + +; Uses both values, requires fxch +define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) { + %a = call {x86_fp80,x86_fp80} @test() + %b = getresult {x86_fp80,x86_fp80} %a, 1 + store x86_fp80 %b, x86_fp80* %P1 + + %c = getresult {x86_fp80,x86_fp80} %a, 0 + store x86_fp80 %c, x86_fp80* %P2 + ret void +} + +; Uses ST(0), ST(1) is dead but must be popped. +define void @call3(x86_fp80 *%P1, x86_fp80 *%P2) { + %a = call {x86_fp80,x86_fp80} @test() + %b = getresult {x86_fp80,x86_fp80} %a, 0 + store x86_fp80 %b, x86_fp80* %P1 + ret void +} + +; Uses ST(1), ST(0) is dead and must be popped. +define void @call4(x86_fp80 *%P1, x86_fp80 *%P2) { + %a = call {x86_fp80,x86_fp80} @test() + + %c = getresult {x86_fp80,x86_fp80} %a, 1 + store x86_fp80 %c, x86_fp80* %P2 + ret void +} + |

