1 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff < %s | \
2 ; RUN: FileCheck --check-prefixes=CHECK,32BIT %s
3 ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff < %s | \
4 ; RUN: FileCheck --check-prefixes=CHECK,64BIT %s
6 @gcd = external global { double, double }, align 8
7 @gcf = external global { float, float }, align 4
8 @gcfp128 = external global { ppc_fp128, ppc_fp128 }, align 16
10 declare void @anchor(...)
12 define dso_local { double, double } @dblCmplxRetCallee() {
14 %retval = alloca { double, double }, align 8
15 %retval.realp = getelementptr inbounds { double, double }, ptr %retval, i32 0, i32 0
16 store double 1.000000e+00, ptr %retval.realp, align 8
17 %retval.imagp = getelementptr inbounds { double, double }, ptr %retval, i32 0, i32 1
18 store double 0.000000e+00, ptr %retval.imagp, align 8
19 %0 = load { double, double }, ptr %retval, align 8
20 ret { double, double } %0
23 ; CHECK-LABEL: .dblCmplxRetCallee:
29 define dso_local void @dblCmplxRetCaller() {
31 %call = call { double, double } @dblCmplxRetCallee()
32 %0 = extractvalue { double, double } %call, 0
33 %1 = extractvalue { double, double } %call, 1
34 store double %0, ptr getelementptr inbounds ({ double, double }, ptr @gcd, i32 0, i32 0), align 8
35 store double %1, ptr getelementptr inbounds ({ double, double }, ptr @gcd, i32 0, i32 1), align 8
40 ; CHECK-LABEL: .dblCmplxRetCaller:
42 ; CHECK: bl .dblCmplxRetCallee
43 ; 32BIT-NEXT: lwz [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
44 ; 64BIT-NEXT: ld [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
45 ; CHECK-DAG: stfd 1, 0([[REG]])
46 ; CHECK-DAG: stfd 2, 8([[REG]])
47 ; CHECK-NEXT: bl .anchor
49 define dso_local { float, float } @fltCmplxRetCallee() {
51 %retval = alloca { float, float }, align 4
52 %retval.realp = getelementptr inbounds { float, float }, ptr %retval, i32 0, i32 0
53 %retval.imagp = getelementptr inbounds { float, float }, ptr %retval, i32 0, i32 1
54 store float 1.000000e+00, ptr %retval.realp, align 4
55 store float 0.000000e+00, ptr %retval.imagp, align 4
56 %0 = load { float, float }, ptr %retval, align 4
57 ret { float, float } %0
60 ; CHECK-LABEL: .fltCmplxRetCallee:
66 define dso_local void @fltCmplxRetCaller() {
68 %call = call { float, float } @fltCmplxRetCallee()
69 %0 = extractvalue { float, float } %call, 0
70 %1 = extractvalue { float, float } %call, 1
71 store float %0, ptr getelementptr inbounds ({ float, float }, ptr @gcf, i32 0, i32 0), align 4
72 store float %1, ptr getelementptr inbounds ({ float, float }, ptr @gcf, i32 0, i32 1), align 4
77 ; CHECK-LABEL: .fltCmplxRetCaller:
79 ; CHECK: bl .fltCmplxRetCallee
80 ; 32BIT-NEXT: lwz [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
81 ; 64BIT-NEXT: ld [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
82 ; CHECK-DAG: stfs 1, 0([[REG]])
83 ; CHECK-DAG: stfs 2, 4([[REG]])
84 ; CHECK-NEXT: bl .anchor
86 define dso_local { ppc_fp128, ppc_fp128 } @fp128CmplxRetCallee() {
88 %retval = alloca { ppc_fp128, ppc_fp128 }, align 16
89 %retval.realp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %retval, i32 0, i32 0
90 %retval.imagp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, ptr %retval, i32 0, i32 1
91 store ppc_fp128 0xM7ffeffffffffffffffffffffffffffff, ptr %retval.realp, align 16
92 store ppc_fp128 0xM3ffefffffffffffffffffffffffffffe, ptr %retval.imagp, align 16
93 %0 = load { ppc_fp128, ppc_fp128 }, ptr %retval, align 16
94 ret { ppc_fp128, ppc_fp128 } %0
97 ; CHECK-LABEL: .fp128CmplxRetCallee:
105 define dso_local void @fp128CmplxRetCaller() {
107 %call = call { ppc_fp128, ppc_fp128 } @fp128CmplxRetCallee()
108 %0 = extractvalue { ppc_fp128, ppc_fp128 } %call, 0
109 %1 = extractvalue { ppc_fp128, ppc_fp128 } %call, 1
110 store ppc_fp128 %0, ptr getelementptr inbounds ({ ppc_fp128, ppc_fp128 }, ptr @gcfp128, i32 0, i32 0), align 16
111 store ppc_fp128 %1, ptr getelementptr inbounds ({ ppc_fp128, ppc_fp128 }, ptr @gcfp128, i32 0, i32 1), align 16
116 ; CHECK-LABEL: .fp128CmplxRetCaller:
118 ; CHECK: bl .fp128CmplxRetCallee
119 ; 32BIT-NEXT: lwz [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
120 ; 64BIT-NEXT: ld [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
121 ; CHECK-DAG: stfd 1, 0([[REG]])
122 ; CHECK-DAG: stfd 2, 8([[REG]])
123 ; CHECK-DAG: stfd 3, 16([[REG]])
124 ; CHECK-DAG: stfd 4, 24([[REG]])
125 ; CHECK-NEXT: bl .anchor