aix-complex.ll
4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff < %s | \
; RUN: FileCheck --check-prefixes=CHECK,32BIT %s
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff < %s | \
; RUN: FileCheck --check-prefixes=CHECK,64BIT %s
@gcd = external global { double, double }, align 8
@gcf = external global { float, float }, align 4
@gcfp128 = external global { ppc_fp128, ppc_fp128 }, align 16
declare void @anchor(...)
define dso_local { double, double } @dblCmplxRetCallee() {
entry:
%retval = alloca { double, double }, align 8
%retval.realp = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 0
store double 1.000000e+00, double* %retval.realp, align 8
%retval.imagp = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 1
store double 0.000000e+00, double* %retval.imagp, align 8
%0 = load { double, double }, { double, double }* %retval, align 8
ret { double, double } %0
}
; CHECK-LABEL: .dblCmplxRetCallee:
; CHECK-DAG: lfs 1,
; CHECK-DAG: lfs 2,
; CHECK: blr
define dso_local void @dblCmplxRetCaller() {
entry:
%call = call { double, double } @dblCmplxRetCallee()
%0 = extractvalue { double, double } %call, 0
%1 = extractvalue { double, double } %call, 1
store double %0, double* getelementptr inbounds ({ double, double }, { double, double }* @gcd, i32 0, i32 0), align 8
store double %1, double* getelementptr inbounds ({ double, double }, { double, double }* @gcd, i32 0, i32 1), align 8
call void bitcast (void (...)* @anchor to void ()*)()
ret void
}
; CHECK-LABEL: .dblCmplxRetCaller:
; CHECK: bl .dblCmplxRetCallee
; 32BIT-NEXT: lwz [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
; 64BIT-NEXT: ld [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
; CHECK-DAG: stfd 1, 0([[REG]])
; CHECK-DAG: stfd 2, 8([[REG]])
; CHECK-NEXT: bl .anchor
define dso_local { float, float } @fltCmplxRetCallee() {
entry:
%retval = alloca { float, float }, align 4
%retval.realp = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 0
%retval.imagp = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 1
store float 1.000000e+00, float* %retval.realp, align 4
store float 0.000000e+00, float* %retval.imagp, align 4
%0 = load { float, float }, { float, float }* %retval, align 4
ret { float, float } %0
}
; CHECK-LABEL: .fltCmplxRetCallee:
; CHECK-DAG: lfs 1,
; CHECK-DAG: lfs 2,
; CHECK: blr
define dso_local void @fltCmplxRetCaller() {
entry:
%call = call { float, float } @fltCmplxRetCallee()
%0 = extractvalue { float, float } %call, 0
%1 = extractvalue { float, float } %call, 1
store float %0, float* getelementptr inbounds ({ float, float }, { float, float }* @gcf, i32 0, i32 0), align 4
store float %1, float* getelementptr inbounds ({ float, float }, { float, float }* @gcf, i32 0, i32 1), align 4
call void bitcast (void (...)* @anchor to void ()*)()
ret void
}
; CHECK-LABEL: .fltCmplxRetCaller:
; CHECK: bl .fltCmplxRetCallee
; 32BIT-NEXT: lwz [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
; 64BIT-NEXT: ld [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
; CHECK-DAG: stfs 1, 0([[REG]])
; CHECK-DAG: stfs 2, 4([[REG]])
; CHECK-NEXT: bl .anchor
define dso_local { ppc_fp128, ppc_fp128 } @fp128CmplxRetCallee() {
entry:
%retval = alloca { ppc_fp128, ppc_fp128 }, align 16
%retval.realp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %retval, i32 0, i32 0
%retval.imagp = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %retval, i32 0, i32 1
store ppc_fp128 0xM7ffeffffffffffffffffffffffffffff, ppc_fp128* %retval.realp, align 16
store ppc_fp128 0xM3ffefffffffffffffffffffffffffffe, ppc_fp128* %retval.imagp, align 16
%0 = load { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %retval, align 16
ret { ppc_fp128, ppc_fp128 } %0
}
; CHECK-LABEL: .fp128CmplxRetCallee:
; CHECK-DAG: lfd 1,
; CHECK-DAG: lfd 2,
; CHECK-DAG: lfd 3,
; CHECK-DAG: lfd 4,
; CHECK: blr
define dso_local void @fp128CmplxRetCaller() {
entry:
%call = call { ppc_fp128, ppc_fp128 } @fp128CmplxRetCallee()
%0 = extractvalue { ppc_fp128, ppc_fp128 } %call, 0
%1 = extractvalue { ppc_fp128, ppc_fp128 } %call, 1
store ppc_fp128 %0, ppc_fp128* getelementptr inbounds ({ ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* @gcfp128, i32 0, i32 0), align 16
store ppc_fp128 %1, ppc_fp128* getelementptr inbounds ({ ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* @gcfp128, i32 0, i32 1), align 16
call void bitcast (void (...)* @anchor to void ()*)()
ret void
}
; CHECK-LABEL: .fp128CmplxRetCaller:
; CHECK: bl .fp128CmplxRetCallee
; 32BIT-NEXT: lwz [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
; 64BIT-NEXT: ld [[REG:[0-9]+]], L..C{{[0-9]+}}(2)
; CHECK-DAG: stfd 1, 0([[REG]])
; CHECK-DAG: stfd 2, 8([[REG]])
; CHECK-DAG: stfd 3, 16([[REG]])
; CHECK-DAG: stfd 4, 24([[REG]])
; CHECK-NEXT: bl .anchor