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 5 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 9 10declare void @anchor(...) 11 12define dso_local { double, double } @dblCmplxRetCallee() { 13entry: 14 %retval = alloca { double, double }, align 8 15 %retval.realp = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 0 16 store double 1.000000e+00, double* %retval.realp, align 8 17 %retval.imagp = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 1 18 store double 0.000000e+00, double* %retval.imagp, align 8 19 %0 = load { double, double }, { double, double }* %retval, align 8 20 ret { double, double } %0 21} 22 23; CHECK-LABEL: .dblCmplxRetCallee: 24 25; CHECK-DAG: lfs 1, 26; CHECK-DAG: lfs 2, 27; CHECK: blr 28 29define dso_local void @dblCmplxRetCaller() { 30entry: 31 %call = call { double, double } @dblCmplxRetCallee() 32 %0 = extractvalue { double, double } %call, 0 33 %1 = extractvalue { double, double } %call, 1 34 store double %0, double* getelementptr inbounds ({ double, double }, { double, double }* @gcd, i32 0, i32 0), align 8 35 store double %1, double* getelementptr inbounds ({ double, double }, { double, double }* @gcd, i32 0, i32 1), align 8 36 call void bitcast (void (...)* @anchor to void ()*)() 37 ret void 38} 39 40; CHECK-LABEL: .dblCmplxRetCaller: 41 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 48 49define dso_local { float, float } @fltCmplxRetCallee() { 50entry: 51 %retval = alloca { float, float }, align 4 52 %retval.realp = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 0 53 %retval.imagp = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 1 54 store float 1.000000e+00, float* %retval.realp, align 4 55 store float 0.000000e+00, float* %retval.imagp, align 4 56 %0 = load { float, float }, { float, float }* %retval, align 4 57 ret { float, float } %0 58} 59 60; CHECK-LABEL: .fltCmplxRetCallee: 61 62; CHECK-DAG: lfs 1, 63; CHECK-DAG: lfs 2, 64; CHECK: blr 65 66define dso_local void @fltCmplxRetCaller() { 67entry: 68 %call = call { float, float } @fltCmplxRetCallee() 69 %0 = extractvalue { float, float } %call, 0 70 %1 = extractvalue { float, float } %call, 1 71 store float %0, float* getelementptr inbounds ({ float, float }, { float, float }* @gcf, i32 0, i32 0), align 4 72 store float %1, float* getelementptr inbounds ({ float, float }, { float, float }* @gcf, i32 0, i32 1), align 4 73 call void bitcast (void (...)* @anchor to void ()*)() 74 ret void 75} 76 77; CHECK-LABEL: .fltCmplxRetCaller: 78 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 85 86define dso_local { ppc_fp128, ppc_fp128 } @fp128CmplxRetCallee() { 87entry: 88 %retval = alloca { ppc_fp128, ppc_fp128 }, align 16 89 %retval.realp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %retval, i32 0, i32 0 90 %retval.imagp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %retval, i32 0, i32 1 91 store ppc_fp128 0xM7ffeffffffffffffffffffffffffffff, ppc_fp128* %retval.realp, align 16 92 store ppc_fp128 0xM3ffefffffffffffffffffffffffffffe, ppc_fp128* %retval.imagp, align 16 93 %0 = load { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %retval, align 16 94 ret { ppc_fp128, ppc_fp128 } %0 95} 96 97; CHECK-LABEL: .fp128CmplxRetCallee: 98 99; CHECK-DAG: lfd 1, 100; CHECK-DAG: lfd 2, 101; CHECK-DAG: lfd 3, 102; CHECK-DAG: lfd 4, 103; CHECK: blr 104 105define dso_local void @fp128CmplxRetCaller() { 106entry: 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, ppc_fp128* getelementptr inbounds ({ ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* @gcfp128, i32 0, i32 0), align 16 111 store ppc_fp128 %1, ppc_fp128* getelementptr inbounds ({ ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* @gcfp128, i32 0, i32 1), align 16 112 call void bitcast (void (...)* @anchor to void ()*)() 113 ret void 114} 115 116; CHECK-LABEL: .fp128CmplxRetCaller: 117 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 126