1 ; RUN: llc < %s -march=x86 | grep fldz
2 ; RUN: llc < %s -march=x86-64 | grep fld1
4 %0 = type { x86_fp80, x86_fp80 }
6 ; This is basically this code on x86-64:
7 ; _Complex long double test() { return 1.0; }
9 %A = fpext double 1.0 to x86_fp80
10 %B = fpext double 0.0 to x86_fp80
11 %mrv = insertvalue %0 undef, x86_fp80 %A, 0
12 %mrv1 = insertvalue %0 %mrv, x86_fp80 %B, 1
22 %A = fpext double 1.0 to x86_fp80
23 %mrv = insertvalue %0 undef, x86_fp80 %A, 0
24 %mrv1 = insertvalue %0 %mrv, x86_fp80 %A, 1
29 define void @call1(x86_fp80 *%P1, x86_fp80 *%P2) {
31 %b = extractvalue %0 %a, 0
32 store x86_fp80 %b, x86_fp80* %P1
34 %c = extractvalue %0 %a, 1
35 store x86_fp80 %c, x86_fp80* %P2
39 ; Uses both values, requires fxch
40 define void @call2(x86_fp80 *%P1, x86_fp80 *%P2) {
42 %b = extractvalue %0 %a, 1
43 store x86_fp80 %b, x86_fp80* %P1
45 %c = extractvalue %0 %a, 0
46 store x86_fp80 %c, x86_fp80* %P2
50 ; Uses ST(0), ST(1) is dead but must be popped.
51 define void @call3(x86_fp80 *%P1, x86_fp80 *%P2) {
53 %b = extractvalue %0 %a, 0
54 store x86_fp80 %b, x86_fp80* %P1
58 ; Uses ST(1), ST(0) is dead and must be popped.
59 define void @call4(x86_fp80 *%P1, x86_fp80 *%P2) {
62 %c = extractvalue %0 %a, 1
63 store x86_fp80 %c, x86_fp80* %P2