Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/fp-stack-ret.ll @ 0:95c75e76d11b LLVM3.4
LLVM 3.4
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 12 Dec 2013 13:56:28 +0900 |
parents | |
children | afa8332a0e37 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:95c75e76d11b |
---|---|
1 ; RUN: llc < %s -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 | FileCheck %s | |
2 | |
3 ; These testcases shouldn't require loading into an XMM register then storing | |
4 ; to memory, then reloading into an FPStack reg. | |
5 | |
6 ; CHECK: test1 | |
7 ; CHECK: fldl | |
8 ; CHECK-NEXT: ret | |
9 define double @test1(double *%P) { | |
10 %A = load double* %P | |
11 ret double %A | |
12 } | |
13 | |
14 ; fastcc should return a value | |
15 ; CHECK: test2 | |
16 ; CHECK-NOT: xmm | |
17 ; CHECK: ret | |
18 define fastcc double @test2(<2 x double> %A) { | |
19 %B = extractelement <2 x double> %A, i32 0 | |
20 ret double %B | |
21 } | |
22 | |
23 ; CHECK: test3 | |
24 ; CHECK: sub{{.*}}%esp | |
25 ; CHECK-NOT: xmm | |
26 define fastcc double @test3(<4 x float> %A) { | |
27 %B = bitcast <4 x float> %A to <2 x double> | |
28 %C = call fastcc double @test2(<2 x double> %B) | |
29 ret double %C | |
30 } | |
31 | |
32 ; Clear the stack when not using a return value. | |
33 ; CHECK: test4 | |
34 ; CHECK: call | |
35 ; CHECK: fstp | |
36 ; CHECK: ret | |
37 define void @test4(double *%P) { | |
38 %A = call double @test1(double *%P) | |
39 ret void | |
40 } |