blob: f92096f3ab7d33ff43a3f0476b2f1386aa8a255d [file] [log] [blame]
Jason Liu8fc095d2019-08-14 14:13:11 +00001; RUN: llc -mtriple powerpc-ibm-aix-xcoff -stop-after=machine-cp < %s | \
2; RUN: FileCheck --check-prefix=32BIT %s
3
4; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -stop-after=machine-cp < %s | \
5; RUN: FileCheck --check-prefix=64BIT %s
6
7@f1 = global float 0.000000e+00, align 4
8@d1 = global double 0.000000e+00, align 8
9
10define void @call_test_float() {
11entry:
12; 32BIT: renamable $r3 = LWZtoc @f1, $r2 :: (load 4 from got)
13; 32BIT: renamable $f1 = LFS 0, killed renamable $r3 :: (dereferenceable load 4 from @f1)
14; 32BIT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
15; 32BIT: BL_NOP <mcsymbol .test_float>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $f1, implicit $r2, implicit-def $r1
16; 32BIT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1
17
18; 64BIT: renamable $x3 = LDtoc @f1, $x2 :: (load 8 from got)
19; 64BIT: renamable $f1 = LFS 0, killed renamable $x3 :: (dereferenceable load 4 from @f1)
20; 64BIT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1
21; 64BIT: BL8_NOP <mcsymbol .test_float>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $f1, implicit $x2, implicit-def $r1
22; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
23
24 %0 = load float, float* @f1, align 4
25 call void @test_float(float %0)
26 ret void
27}
28
29declare void @test_float(float)
30
31define void @call_test_floats() {
32entry:
33; 32BIT: renamable $r3 = LWZtoc @f1, $r2 :: (load 4 from got)
34; 32BIT: renamable $f1 = LFS 0, killed renamable $r3 :: (dereferenceable load 4 from @f1)
35; 32BIT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
36; 32BIT: $f2 = COPY renamable $f1
37; 32BIT: $f3 = COPY renamable $f1
38; 32BIT: BL_NOP <mcsymbol .test_floats>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $f1, implicit killed $f2, implicit killed $f3, implicit $r2, implicit-def $r1
39; 32BIT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1
40
41; 64BIT: renamable $x3 = LDtoc @f1, $x2 :: (load 8 from got)
42; 64BIT: renamable $f1 = LFS 0, killed renamable $x3 :: (dereferenceable load 4 from @f1)
43; 64BIT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1
44; 64BIT: $f2 = COPY renamable $f1
45; 64BIT: $f3 = COPY renamable $f1
46; 64BIT: BL8_NOP <mcsymbol .test_floats>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $f1, implicit killed $f2, implicit killed $f3, implicit $x2, implicit-def $r1
47; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
48
49 %0 = load float, float* @f1, align 4
50 call void @test_floats(float %0, float %0, float %0)
51 ret void
52}
53
54declare void @test_floats(float, float, float)
55
56define void @call_test_double() {
57entry:
58; 32BIT: renamable $r3 = LWZtoc @d1, $r2 :: (load 4 from got)
59; 32BIT: renamable $f1 = LFD 0, killed renamable $r3 :: (dereferenceable load 8 from @d1)
60; 32BIT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
61; 32BIT: BL_NOP <mcsymbol .test_double>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $f1, implicit $r2, implicit-def $r1
62; 32BIT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1
63
64; 64BIT: renamable $x3 = LDtoc @d1, $x2 :: (load 8 from got)
65; 64BIT: renamable $f1 = LFD 0, killed renamable $x3 :: (dereferenceable load 8 from @d1)
66; 64BIT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1
67; 64BIT: BL8_NOP <mcsymbol .test_double>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $f1, implicit $x2, implicit-def $r1
68; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
69
70 %0 = load double, double* @d1, align 8
71 call void @test_double(double %0)
72 ret void
73}
74
75declare void @test_double(double)
76
77define void @call_test_fpr_max() {
78entry:
79; 32BIT: renamable $r3 = LWZtoc @d1, $r2 :: (load 4 from got)
80; 32BIT: renamable $f1 = LFD 0, killed renamable $r3 :: (dereferenceable load 8 from @d1)
81; 32BIT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
82; 32BIT: $f2 = COPY renamable $f1
83; 32BIT: $f3 = COPY renamable $f1
84; 32BIT: $f4 = COPY renamable $f1
85; 32BIT: $f5 = COPY renamable $f1
86; 32BIT: $f6 = COPY renamable $f1
87; 32BIT: $f7 = COPY renamable $f1
88; 32BIT: $f8 = COPY renamable $f1
89; 32BIT: $f9 = COPY renamable $f1
90; 32BIT: $f10 = COPY renamable $f1
91; 32BIT: $f11 = COPY renamable $f1
92; 32BIT: $f12 = COPY renamable $f1
93; 32BIT: $f13 = COPY renamable $f1
94; 32BIT: BL_NOP <mcsymbol .test_fpr_max>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $f1, implicit killed $f2, implicit killed $f3, implicit killed $f4, implicit killed $f5, implicit killed $f6, implicit killed $f7, implicit killed $f8, implicit killed $f9, implicit killed $f10, implicit killed $f11, implicit killed $f12, implicit killed $f13, implicit $r2, implicit-def $r1
95; 32BIT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1
96
97; 64BIT: renamable $x3 = LDtoc @d1, $x2 :: (load 8 from got)
98; 64BIT: renamable $f1 = LFD 0, killed renamable $x3 :: (dereferenceable load 8 from @d1)
99; 64BIT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1
100; 64BIT: $f2 = COPY renamable $f1
101; 64BIT: $f3 = COPY renamable $f1
102; 64BIT: $f4 = COPY renamable $f1
103; 64BIT: $f5 = COPY renamable $f1
104; 64BIT: $f6 = COPY renamable $f1
105; 64BIT: $f7 = COPY renamable $f1
106; 64BIT: $f8 = COPY renamable $f1
107; 64BIT: $f9 = COPY renamable $f1
108; 64BIT: $f10 = COPY renamable $f1
109; 64BIT: $f11 = COPY renamable $f1
110; 64BIT: $f12 = COPY renamable $f1
111; 64BIT: $f13 = COPY renamable $f1
112; 64BIT: BL8_NOP <mcsymbol .test_fpr_max>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $f1, implicit killed $f2, implicit killed $f3, implicit killed $f4, implicit killed $f5, implicit killed $f6, implicit killed $f7, implicit killed $f8, implicit killed $f9, implicit killed $f10, implicit killed $f11, implicit killed $f12, implicit killed $f13, implicit $x2, implicit-def $r1
113; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
114
115 %0 = load double, double* @d1, align 8
116 call void @test_fpr_max(double %0, double %0, double %0, double %0, double %0, double %0, double %0, double %0, double %0, double %0, double %0, double %0, double %0)
117 ret void
118}
119
120declare void @test_fpr_max(double, double, double, double, double, double, double, double, double, double, double, double, double)
121
122define void @call_test_mix() {
123entry:
124; 32BIT: renamable $r3 = LWZtoc @f1, $r2 :: (load 4 from got)
125; 32BIT: renamable $r4 = LWZtoc @d1, $r2 :: (load 4 from got)
126; 32BIT: renamable $f1 = LFS 0, killed renamable $r3 :: (dereferenceable load 4 from @f1)
127; 32BIT: renamable $f2 = LFD 0, killed renamable $r4 :: (dereferenceable load 8 from @d1)
128; 32BIT: ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
129; 32BIT: $r4 = LI 1
130; 32BIT: $r7 = LI 97
131; 32BIT: BL_NOP <mcsymbol .test_mix>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $f1, implicit $r4, implicit $f2, implicit killed $r7, implicit $r2, implicit-def $r1
132; 32BIT: ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1
133
134; 64BIT: renamable $x3 = LDtoc @f1, $x2 :: (load 8 from got)
135; 64BIT: renamable $x4 = LDtoc @d1, $x2 :: (load 8 from got)
136; 64BIT: renamable $f1 = LFS 0, killed renamable $x3 :: (dereferenceable load 4 from @f1)
137; 64BIT: renamable $f2 = LFD 0, killed renamable $x4 :: (dereferenceable load 8 from @d1)
138; 64BIT: ADJCALLSTACKDOWN 112, 0, implicit-def dead $r1, implicit $r1
139; 64BIT: $x4 = LI8 1
140; 64BIT: $x6 = LI8 97
141; 64BIT: BL8_NOP <mcsymbol .test_mix>, csr_aix64, implicit-def dead $lr8, implicit $rm, implicit $f1, implicit $x4, implicit $f2, implicit killed $x6, implicit $x2, implicit-def $r1
142; 64BIT: ADJCALLSTACKUP 112, 0, implicit-def dead $r1, implicit $r1
143
144 %0 = load float, float* @f1, align 4
145 %1 = load double, double* @d1, align 8
146 call void @test_mix(float %0, i32 1, double %1, i8 signext 97)
147 ret void
148}
149
150declare void @test_mix(float, i32, double, i8 signext)