OLD | NEW |
1 ; This file checks that Subzero generates code in accordance with the | 1 ; This file checks that Subzero generates code in accordance with the |
2 ; calling convention for vectors. | 2 ; calling convention for vectors. |
3 | 3 |
4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
5 ; RUN: -allow-externally-defined-symbols | FileCheck %s | 5 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ | 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
7 ; RUN: -allow-externally-defined-symbols | FileCheck --check-prefix=OPTM1 %s | 7 ; RUN: -allow-externally-defined-symbols | FileCheck --check-prefix=OPTM1 %s |
8 | 8 |
| 9 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ |
| 10 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target \ |
| 11 ; RUN: mips32 -i %s --args -O2 -allow-externally-defined-symbols \ |
| 12 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ |
| 13 ; RUN: --command FileCheck --check-prefix MIPS32 %s |
| 14 |
9 ; The first five functions test that vectors are moved from their | 15 ; The first five functions test that vectors are moved from their |
10 ; correct argument location to xmm0. | 16 ; correct argument location to xmm0. |
11 | 17 |
12 define internal <4 x float> @test_returning_arg0( | 18 define internal <4 x float> @test_returning_arg0( |
13 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, | 19 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, |
14 <4 x float> %arg4, <4 x float> %arg5) { | 20 <4 x float> %arg4, <4 x float> %arg5) { |
15 entry: | 21 entry: |
16 ret <4 x float> %arg0 | 22 ret <4 x float> %arg0 |
17 ; CHECK-LABEL: test_returning_arg0 | 23 ; CHECK-LABEL: test_returning_arg0 |
18 ; CHECK-NOT: mov | 24 ; CHECK-NOT: mov |
19 ; CHECK: ret | 25 ; CHECK: ret |
20 | 26 |
21 ; OPTM1-LABEL: test_returning_arg0 | 27 ; OPTM1-LABEL: test_returning_arg0 |
22 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm0 | 28 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm0 |
23 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 29 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
24 ; OPTM1: ret | 30 ; OPTM1: ret |
| 31 ; MIPS32-LABEL: test_returning_arg0 |
| 32 ; MIPS32: lw v0,{{.*}}(sp) |
| 33 ; MIPS32: lw v1,{{.*}}(sp) |
| 34 ; MIPS32: move a1,a0 |
| 35 ; MIPS32: sw a2,0(a1) |
| 36 ; MIPS32: sw a3,4(a1) |
| 37 ; MIPS32: sw v0,8(a1) |
| 38 ; MIPS32: sw v1,12(a1) |
| 39 ; MIPS32: move v0,a0 |
25 } | 40 } |
26 | 41 |
27 define internal <4 x float> @test_returning_arg1( | 42 define internal <4 x float> @test_returning_arg1( |
28 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, | 43 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, |
29 <4 x float> %arg4, <4 x float> %arg5) { | 44 <4 x float> %arg4, <4 x float> %arg5) { |
30 entry: | 45 entry: |
31 ret <4 x float> %arg1 | 46 ret <4 x float> %arg1 |
32 ; CHECK-LABEL: test_returning_arg1 | 47 ; CHECK-LABEL: test_returning_arg1 |
33 ; CHECK: movups xmm0,xmm1 | 48 ; CHECK: movups xmm0,xmm1 |
34 ; CHECK: ret | 49 ; CHECK: ret |
35 | 50 |
36 ; OPTM1-LABEL: test_returning_arg1 | 51 ; OPTM1-LABEL: test_returning_arg1 |
37 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm1 | 52 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm1 |
38 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 53 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
39 ; OPTM1: ret | 54 ; OPTM1: ret |
| 55 ; MIPS32-LABEL: test_returning_arg1 |
| 56 ; MIPS32: lw v0,{{.*}}(sp) |
| 57 ; MIPS32: lw v1,{{.*}}(sp) |
| 58 ; MIPS32: lw a1,{{.*}}(sp) |
| 59 ; MIPS32: lw a2,{{.*}}(sp) |
| 60 ; MIPS32: move a3,a0 |
| 61 ; MIPS32: sw v0,0(a3) |
| 62 ; MIPS32: sw v1,4(a3) |
| 63 ; MIPS32: sw a1,8(a3) |
| 64 ; MIPS32: sw a2,12(a3) |
| 65 ; MIPS32: move v0,a0 |
40 } | 66 } |
41 | 67 |
42 define internal <4 x float> @test_returning_arg2( | 68 define internal <4 x float> @test_returning_arg2( |
43 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, | 69 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, |
44 <4 x float> %arg4, <4 x float> %arg5) { | 70 <4 x float> %arg4, <4 x float> %arg5) { |
45 entry: | 71 entry: |
46 ret <4 x float> %arg2 | 72 ret <4 x float> %arg2 |
47 ; CHECK-LABEL: test_returning_arg2 | 73 ; CHECK-LABEL: test_returning_arg2 |
48 ; CHECK: movups xmm0,xmm2 | 74 ; CHECK: movups xmm0,xmm2 |
49 ; CHECK: ret | 75 ; CHECK: ret |
50 | 76 |
51 ; OPTM1-LABEL: test_returning_arg2 | 77 ; OPTM1-LABEL: test_returning_arg2 |
52 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm2 | 78 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm2 |
53 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 79 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
54 ; OPTM1: ret | 80 ; OPTM1: ret |
| 81 ; MIPS32-LABEL: test_returning_arg2 |
| 82 ; MIPS32: lw v0,{{.*}}(sp) |
| 83 ; MIPS32: lw v1,{{.*}}(sp) |
| 84 ; MIPS32: lw a1,{{.*}}(sp) |
| 85 ; MIPS32: lw a2,{{.*}}(sp) |
| 86 ; MIPS32: move a3,a0 |
| 87 ; MIPS32: sw v0,0(a3) |
| 88 ; MIPS32: sw v1,4(a3) |
| 89 ; MIPS32: sw a1,8(a3) |
| 90 ; MIPS32: sw a2,12(a3) |
| 91 ; MIPS32: move v0,a0 |
55 } | 92 } |
56 | 93 |
57 define internal <4 x float> @test_returning_arg3( | 94 define internal <4 x float> @test_returning_arg3( |
58 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, | 95 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, |
59 <4 x float> %arg4, <4 x float> %arg5) { | 96 <4 x float> %arg4, <4 x float> %arg5) { |
60 entry: | 97 entry: |
61 ret <4 x float> %arg3 | 98 ret <4 x float> %arg3 |
62 ; CHECK-LABEL: test_returning_arg3 | 99 ; CHECK-LABEL: test_returning_arg3 |
63 ; CHECK: movups xmm0,xmm3 | 100 ; CHECK: movups xmm0,xmm3 |
64 ; CHECK: ret | 101 ; CHECK: ret |
65 | 102 |
66 ; OPTM1-LABEL: test_returning_arg3 | 103 ; OPTM1-LABEL: test_returning_arg3 |
67 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm3 | 104 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm3 |
68 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 105 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
69 ; OPTM1: ret | 106 ; OPTM1: ret |
| 107 ; MIPS32-LABEL: test_returning_arg3 |
| 108 ; MIPS32: lw v0,{{.*}}(sp) |
| 109 ; MIPS32: lw v1,{{.*}}(sp) |
| 110 ; MIPS32: lw a1,{{.*}}(sp) |
| 111 ; MIPS32: lw a2,{{.*}}(sp) |
| 112 ; MIPS32: move a3,a0 |
| 113 ; MIPS32: sw v0,0(a3) |
| 114 ; MIPS32: sw v1,4(a3) |
| 115 ; MIPS32: sw a1,8(a3) |
| 116 ; MIPS32: sw a2,12(a3) |
| 117 ; MIPS32: move v0,a0 |
70 } | 118 } |
71 | 119 |
72 define internal <4 x float> @test_returning_arg4( | 120 define internal <4 x float> @test_returning_arg4( |
73 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, | 121 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, |
74 <4 x float> %arg4, <4 x float> %arg5) { | 122 <4 x float> %arg4, <4 x float> %arg5) { |
75 entry: | 123 entry: |
76 ret <4 x float> %arg4 | 124 ret <4 x float> %arg4 |
77 ; CHECK-LABEL: test_returning_arg4 | 125 ; CHECK-LABEL: test_returning_arg4 |
78 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x4] | 126 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x4] |
79 ; CHECK: ret | 127 ; CHECK: ret |
80 | 128 |
81 ; OPTM1-LABEL: test_returning_arg4 | 129 ; OPTM1-LABEL: test_returning_arg4 |
82 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} | 130 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
83 ; OPTM1: ret | 131 ; OPTM1: ret |
| 132 ; MIPS32-LABEL: test_returning_arg4 |
| 133 ; MIPS32: lw v0,{{.*}}(sp) |
| 134 ; MIPS32: lw v1,{{.*}}(sp) |
| 135 ; MIPS32: lw a1,{{.*}}(sp) |
| 136 ; MIPS32: lw a2,{{.*}}(sp) |
| 137 ; MIPS32: move a3,a0 |
| 138 ; MIPS32: sw v0,0(a3) |
| 139 ; MIPS32: sw v1,4(a3) |
| 140 ; MIPS32: sw a1,8(a3) |
| 141 ; MIPS32: sw a2,12(a3) |
| 142 ; MIPS32: move v0,a0 |
84 } | 143 } |
85 | 144 |
86 ; The next five functions check that xmm arguments are handled | 145 ; The next five functions check that xmm arguments are handled |
87 ; correctly when interspersed with stack arguments in the argument | 146 ; correctly when interspersed with stack arguments in the argument |
88 ; list. | 147 ; list. |
89 | 148 |
90 define internal <4 x float> @test_returning_interspersed_arg0( | 149 define internal <4 x float> @test_returning_interspersed_arg0( |
91 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, | 150 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, |
92 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, | 151 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, |
93 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, | 152 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, |
94 <4 x float> %arg5, float %floatarg1) { | 153 <4 x float> %arg5, float %floatarg1) { |
95 entry: | 154 entry: |
96 ret <4 x float> %arg0 | 155 ret <4 x float> %arg0 |
97 ; CHECK-LABEL: test_returning_interspersed_arg0 | 156 ; CHECK-LABEL: test_returning_interspersed_arg0 |
98 ; CHECK-NOT: mov | 157 ; CHECK-NOT: mov |
99 ; CHECK: ret | 158 ; CHECK: ret |
100 | 159 |
101 ; OPTM1-LABEL: test_returning_interspersed_arg0 | 160 ; OPTM1-LABEL: test_returning_interspersed_arg0 |
102 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm0 | 161 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm0 |
103 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 162 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
104 ; OPTM1: ret | 163 ; OPTM1: ret |
| 164 ; MIPS32-LABEL: test_returning_interspersed_arg0 |
| 165 ; MIPS32: lw v0,{{.*}}(sp) |
| 166 ; MIPS32: lw v1,{{.*}}(sp) |
| 167 ; MIPS32: lw a1,{{.*}}(sp) |
| 168 ; MIPS32: lw a2,{{.*}}(sp) |
| 169 ; MIPS32: move a3,a0 |
| 170 ; MIPS32: sw v0,0(a3) |
| 171 ; MIPS32: sw v1,4(a3) |
| 172 ; MIPS32: sw a1,8(a3) |
| 173 ; MIPS32: sw a2,12(a3) |
| 174 ; MIPS32: move v0,a0 |
105 } | 175 } |
106 | 176 |
107 define internal <4 x float> @test_returning_interspersed_arg1( | 177 define internal <4 x float> @test_returning_interspersed_arg1( |
108 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, | 178 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, |
109 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, | 179 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, |
110 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, | 180 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, |
111 <4 x float> %arg5, float %floatarg1) { | 181 <4 x float> %arg5, float %floatarg1) { |
112 entry: | 182 entry: |
113 ret <4 x float> %arg1 | 183 ret <4 x float> %arg1 |
114 ; CHECK-LABEL: test_returning_interspersed_arg1 | 184 ; CHECK-LABEL: test_returning_interspersed_arg1 |
115 ; CHECK: movups xmm0,xmm1 | 185 ; CHECK: movups xmm0,xmm1 |
116 ; CHECK: ret | 186 ; CHECK: ret |
117 | 187 |
118 ; OPTM1-LABEL: test_returning_interspersed_arg1 | 188 ; OPTM1-LABEL: test_returning_interspersed_arg1 |
119 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm1 | 189 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm1 |
120 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 190 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
121 ; OPTM1: ret | 191 ; OPTM1: ret |
| 192 ; MIPS32-LABEL: test_returning_interspersed_arg1 |
| 193 ; MIPS32: lw v0,{{.*}}(sp) |
| 194 ; MIPS32: lw v1,{{.*}}(sp) |
| 195 ; MIPS32: lw a1,{{.*}}(sp) |
| 196 ; MIPS32: lw a2,{{.*}}(sp) |
| 197 ; MIPS32: move a3,a0 |
| 198 ; MIPS32: sw v0,0(a3) |
| 199 ; MIPS32: sw v1,4(a3) |
| 200 ; MIPS32: sw a1,8(a3) |
| 201 ; MIPS32: sw a2,12(a3) |
| 202 ; MIPS32: move v0,a0 |
122 } | 203 } |
123 | 204 |
124 define internal <4 x float> @test_returning_interspersed_arg2( | 205 define internal <4 x float> @test_returning_interspersed_arg2( |
125 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, | 206 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, |
126 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, | 207 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, |
127 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, | 208 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, |
128 <4 x float> %arg5, float %floatarg1) { | 209 <4 x float> %arg5, float %floatarg1) { |
129 entry: | 210 entry: |
130 ret <4 x float> %arg2 | 211 ret <4 x float> %arg2 |
131 ; CHECK-LABEL: test_returning_interspersed_arg2 | 212 ; CHECK-LABEL: test_returning_interspersed_arg2 |
132 ; CHECK: movups xmm0,xmm2 | 213 ; CHECK: movups xmm0,xmm2 |
133 ; CHECK: ret | 214 ; CHECK: ret |
134 | 215 |
135 ; OPTM1-LABEL: test_returning_interspersed_arg2 | 216 ; OPTM1-LABEL: test_returning_interspersed_arg2 |
136 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm2 | 217 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm2 |
137 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 218 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
138 ; OPTM1: ret | 219 ; OPTM1: ret |
| 220 ; MIPS32-LABEL: test_returning_interspersed_arg2 |
| 221 ; MIPS32: lw v0,{{.*}}(sp) |
| 222 ; MIPS32: lw v1,{{.*}}(sp) |
| 223 ; MIPS32: lw a1,{{.*}}(sp) |
| 224 ; MIPS32: lw a2,{{.*}}(sp) |
| 225 ; MIPS32: move a3,a0 |
| 226 ; MIPS32: sw v0,0(a3) |
| 227 ; MIPS32: sw v1,4(a3) |
| 228 ; MIPS32: sw a1,8(a3) |
| 229 ; MIPS32: sw a2,12(a3) |
| 230 ; MIPS32: move v0,a0 |
139 } | 231 } |
140 | 232 |
141 define internal <4 x float> @test_returning_interspersed_arg3( | 233 define internal <4 x float> @test_returning_interspersed_arg3( |
142 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, | 234 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, |
143 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, | 235 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, |
144 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, | 236 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, |
145 <4 x float> %arg5, float %floatarg1) { | 237 <4 x float> %arg5, float %floatarg1) { |
146 entry: | 238 entry: |
147 ret <4 x float> %arg3 | 239 ret <4 x float> %arg3 |
148 ; CHECK-LABEL: test_returning_interspersed_arg3 | 240 ; CHECK-LABEL: test_returning_interspersed_arg3 |
149 ; CHECK: movups xmm0,xmm3 | 241 ; CHECK: movups xmm0,xmm3 |
150 ; CHECK: ret | 242 ; CHECK: ret |
151 | 243 |
152 ; OPTM1-LABEL: test_returning_interspersed_arg3 | 244 ; OPTM1-LABEL: test_returning_interspersed_arg3 |
153 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm3 | 245 ; OPTM1: movups XMMWORD PTR [[LOC:.*]],xmm3 |
154 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] | 246 ; OPTM1: movups xmm0,XMMWORD PTR [[LOC]] |
155 ; OPTM1: ret | 247 ; OPTM1: ret |
| 248 ; MIPS32-LABEL: test_returning_interspersed_arg3 |
| 249 ; MIPS32: lw v0,{{.*}}(sp) |
| 250 ; MIPS32: lw v1,{{.*}}(sp) |
| 251 ; MIPS32: lw a1,{{.*}}(sp) |
| 252 ; MIPS32: lw a2,{{.*}}(sp) |
| 253 ; MIPS32: move a3,a0 |
| 254 ; MIPS32: sw v0,0(a3) |
| 255 ; MIPS32: sw v1,4(a3) |
| 256 ; MIPS32: sw a1,8(a3) |
| 257 ; MIPS32: sw a2,12(a3) |
| 258 ; MIPS32: move v0,a0 |
| 259 |
156 } | 260 } |
157 | 261 |
158 define internal <4 x float> @test_returning_interspersed_arg4( | 262 define internal <4 x float> @test_returning_interspersed_arg4( |
159 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, | 263 i32 %i32arg0, double %doublearg0, <4 x float> %arg0, <4 x float> %arg1, |
160 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, | 264 i32 %i32arg1, <4 x float> %arg2, double %doublearg1, <4 x float> %arg3, |
161 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, | 265 i32 %i32arg2, double %doublearg2, float %floatarg0, <4 x float> %arg4, |
162 <4 x float> %arg5, float %floatarg1) { | 266 <4 x float> %arg5, float %floatarg1) { |
163 entry: | 267 entry: |
164 ret <4 x float> %arg4 | 268 ret <4 x float> %arg4 |
165 ; CHECK-LABEL: test_returning_interspersed_arg4 | 269 ; CHECK-LABEL: test_returning_interspersed_arg4 |
166 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x34] | 270 ; CHECK: movups xmm0,XMMWORD PTR [esp+0x34] |
167 ; CHECK: ret | 271 ; CHECK: ret |
168 | 272 |
169 ; OPTM1-LABEL: test_returning_interspersed_arg4 | 273 ; OPTM1-LABEL: test_returning_interspersed_arg4 |
170 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} | 274 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
171 ; OPTM1: ret | 275 ; OPTM1: ret |
| 276 ; MIPS32-LABEL: test_returning_interspersed_arg4 |
| 277 ; MIPS32: lw v0,1{{.*}}(sp) |
| 278 ; MIPS32: lw v1,1{{.*}}(sp) |
| 279 ; MIPS32: lw a1,1{{.*}}(sp) |
| 280 ; MIPS32: lw a2,1{{.*}}(sp) |
| 281 ; MIPS32: move a3,a0 |
| 282 ; MIPS32: sw v0,0(a3) |
| 283 ; MIPS32: sw v1,4(a3) |
| 284 ; MIPS32: sw a1,8(a3) |
| 285 ; MIPS32: sw a2,12(a3) |
| 286 ; MIPS32: move v0,a0 |
172 } | 287 } |
173 | 288 |
174 ; Test that vectors are passed correctly as arguments to a function. | 289 ; Test that vectors are passed correctly as arguments to a function. |
175 | 290 |
176 declare void @VectorArgs(<4 x float>, <4 x float>, <4 x float>, <4 x float>, | 291 declare void @VectorArgs(<4 x float>, <4 x float>, <4 x float>, <4 x float>, |
177 <4 x float>, <4 x float>) | 292 <4 x float>, <4 x float>) |
178 | 293 |
179 declare void @killXmmRegisters() | 294 declare void @killXmmRegisters() |
180 | 295 |
181 define internal void @test_passing_vectors( | 296 define internal void @test_passing_vectors( |
(...skipping 25 matching lines...) Loading... |
207 ; OPTM1: movups [[ARG5:.*]],XMMWORD PTR {{.*}} | 322 ; OPTM1: movups [[ARG5:.*]],XMMWORD PTR {{.*}} |
208 ; OPTM1: movups XMMWORD PTR [esp],[[ARG5]] | 323 ; OPTM1: movups XMMWORD PTR [esp],[[ARG5]] |
209 ; OPTM1: movups [[ARG6:.*]],XMMWORD PTR {{.*}} | 324 ; OPTM1: movups [[ARG6:.*]],XMMWORD PTR {{.*}} |
210 ; OPTM1: movups XMMWORD PTR [esp+0x10],[[ARG6]] | 325 ; OPTM1: movups XMMWORD PTR [esp+0x10],[[ARG6]] |
211 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} | 326 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
212 ; OPTM1: movups xmm1,XMMWORD PTR {{.*}} | 327 ; OPTM1: movups xmm1,XMMWORD PTR {{.*}} |
213 ; OPTM1: movups xmm2,XMMWORD PTR {{.*}} | 328 ; OPTM1: movups xmm2,XMMWORD PTR {{.*}} |
214 ; OPTM1: movups xmm3,XMMWORD PTR {{.*}} | 329 ; OPTM1: movups xmm3,XMMWORD PTR {{.*}} |
215 ; OPTM1: call {{.*}} R_{{.*}} VectorArgs | 330 ; OPTM1: call {{.*}} R_{{.*}} VectorArgs |
216 ; OPTM1-NEXT: add esp,0x6c | 331 ; OPTM1-NEXT: add esp,0x6c |
| 332 ; MIPS32-LABEL: test_passing_vectors |
| 333 ; MIPS32: sw s7,{{.*}}(sp) |
| 334 ; MIPS32: sw s6,{{.*}}(sp) |
| 335 ; MIPS32: sw s5,{{.*}}(sp) |
| 336 ; MIPS32: sw s4,{{.*}}(sp) |
| 337 ; MIPS32: sw s3,{{.*}}(sp) |
| 338 ; MIPS32: sw s2,{{.*}}(sp) |
| 339 ; MIPS32: sw s1,{{.*}}(sp) |
| 340 ; MIPS32: sw s0,{{.*}}(sp) |
| 341 ; MIPS32: lw s0,{{.*}}(sp) |
| 342 ; MIPS32: lw s1,{{.*}}(sp) |
| 343 ; MIPS32: lw s2,{{.*}}(sp) |
| 344 ; MIPS32: lw s3,{{.*}}(sp) |
| 345 ; MIPS32: lw s4,{{.*}}(sp) |
| 346 ; MIPS32: lw s5,{{.*}}(sp) |
| 347 ; MIPS32: lw s6,{{.*}}(sp) |
| 348 ; MIPS32: lw s7,{{.*}}(sp) |
| 349 ; MIPS32: jal 0 <test_returning_arg0> 228: R_MIPS_26 killXmmRegisters |
| 350 ; MIPS32: nop |
| 351 ; MIPS32: lw v0,{{.*}}(sp) |
| 352 ; MIPS32: sw v0,{{.*}}(sp) |
| 353 ; MIPS32: lw v0,{{.*}}(sp) |
| 354 ; MIPS32: sw v0,{{.*}}(sp) |
| 355 ; MIPS32: lw v0,{{.*}}(sp) |
| 356 ; MIPS32: sw v0,{{.*}}(sp) |
| 357 ; MIPS32: lw v0,{{.*}}(sp) |
| 358 ; MIPS32: sw v0,{{.*}}(sp) |
| 359 ; MIPS32: lw v0,{{.*}}(sp) |
| 360 ; MIPS32: sw v0,{{.*}}(sp) |
| 361 ; MIPS32: lw v0,{{.*}}(sp) |
| 362 ; MIPS32: sw v0,{{.*}}(sp) |
| 363 ; MIPS32: lw v0,{{.*}}(sp) |
| 364 ; MIPS32: sw v0,{{.*}}(sp) |
| 365 ; MIPS32: lw v0,{{.*}}(sp) |
| 366 ; MIPS32: sw v0,{{.*}}(sp) |
| 367 ; MIPS32: lw v0,{{.*}}(sp) |
| 368 ; MIPS32: sw v0,{{.*}}(sp) |
| 369 ; MIPS32: lw v0,{{.*}}(sp) |
| 370 ; MIPS32: sw v0,{{.*}}(sp) |
| 371 ; MIPS32: lw v0,{{.*}}(sp) |
| 372 ; MIPS32: sw v0,{{.*}}(sp) |
| 373 ; MIPS32: lw v0,{{.*}}(sp) |
| 374 ; MIPS32: sw v0,{{.*}}(sp) |
| 375 ; MIPS32: sw s4,{{.*}}(sp) |
| 376 ; MIPS32: sw s5,{{.*}}(sp) |
| 377 ; MIPS32: sw s6,{{.*}}(sp) |
| 378 ; MIPS32: sw s7,{{.*}}(sp) |
| 379 ; MIPS32: sw s0,{{.*}}(sp) |
| 380 ; MIPS32: sw s1,{{.*}}(sp) |
| 381 ; MIPS32: sw s2,{{.*}}(sp) |
| 382 ; MIPS32: sw s3,{{.*}}(sp) |
| 383 ; MIPS32: lw a0,{{.*}}(sp) |
| 384 ; MIPS32: lw a1,{{.*}}(sp) |
| 385 ; MIPS32: lw a2,{{.*}}(sp) |
| 386 ; MIPS32: lw a3,{{.*}}(sp) |
| 387 ; MIPS32: jal 0 <test_returning_arg0> 2c0: R_MIPS_26 VectorArgs |
| 388 ; MIPS32: nop |
| 389 ; MIPS32: lw s0,{{.*}}(sp) |
| 390 ; MIPS32: lw s1,{{.*}}(sp) |
| 391 ; MIPS32: lw s2,{{.*}}(sp) |
| 392 ; MIPS32: lw s3,{{.*}}(sp) |
| 393 ; MIPS32: lw s4,{{.*}}(sp) |
| 394 ; MIPS32: lw s5,{{.*}}(sp) |
| 395 ; MIPS32: lw s6,{{.*}}(sp) |
| 396 ; MIPS32: lw s7,{{.*}}(sp) |
| 397 ; MIPS32: lw ra,{{.*}}(sp) |
| 398 |
217 } | 399 } |
218 | 400 |
219 declare void @InterspersedVectorArgs( | 401 declare void @InterspersedVectorArgs( |
220 <4 x float>, i64, <4 x float>, i64, <4 x float>, float, <4 x float>, | 402 <4 x float>, i64, <4 x float>, i64, <4 x float>, float, <4 x float>, |
221 double, <4 x float>, i32, <4 x float>) | 403 double, <4 x float>, i32, <4 x float>) |
222 | 404 |
223 define internal void @test_passing_vectors_interspersed( | 405 define internal void @test_passing_vectors_interspersed( |
224 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, | 406 <4 x float> %arg0, <4 x float> %arg1, <4 x float> %arg2, <4 x float> %arg3, |
225 <4 x float> %arg4, <4 x float> %arg5, <4 x float> %arg6, <4 x float> %arg7, | 407 <4 x float> %arg4, <4 x float> %arg5, <4 x float> %arg6, <4 x float> %arg7, |
226 <4 x float> %arg8, <4 x float> %arg9) { | 408 <4 x float> %arg8, <4 x float> %arg9) { |
(...skipping 26 matching lines...) Loading... |
253 ; OPTM1: movups XMMWORD PTR [esp+0x20],[[ARG9]] | 435 ; OPTM1: movups XMMWORD PTR [esp+0x20],[[ARG9]] |
254 ; OPTM1: movups [[ARG11:.*]],XMMWORD PTR {{.*}} | 436 ; OPTM1: movups [[ARG11:.*]],XMMWORD PTR {{.*}} |
255 ; OPTM1: movups XMMWORD PTR [esp+0x40],[[ARG11]] | 437 ; OPTM1: movups XMMWORD PTR [esp+0x40],[[ARG11]] |
256 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} | 438 ; OPTM1: movups xmm0,XMMWORD PTR {{.*}} |
257 ; OPTM1: movups xmm1,XMMWORD PTR {{.*}} | 439 ; OPTM1: movups xmm1,XMMWORD PTR {{.*}} |
258 ; OPTM1: movups xmm2,XMMWORD PTR {{.*}} | 440 ; OPTM1: movups xmm2,XMMWORD PTR {{.*}} |
259 ; OPTM1: movups xmm3,XMMWORD PTR {{.*}} | 441 ; OPTM1: movups xmm3,XMMWORD PTR {{.*}} |
260 ; OPTM1: call {{.*}} R_{{.*}} InterspersedVectorArgs | 442 ; OPTM1: call {{.*}} R_{{.*}} InterspersedVectorArgs |
261 ; OPTM1-NEXT: add esp,0x9c | 443 ; OPTM1-NEXT: add esp,0x9c |
262 ; OPTM1: ret | 444 ; OPTM1: ret |
| 445 ; MIPS32-LABEL: test_passing_vectors_interspersed |
| 446 ; MIPS32: sw s7,{{.*}}(sp) |
| 447 ; MIPS32: sw s6,{{.*}}(sp) |
| 448 ; MIPS32: sw s5,{{.*}}(sp) |
| 449 ; MIPS32: sw s4,{{.*}}(sp) |
| 450 ; MIPS32: sw s3,{{.*}}(sp) |
| 451 ; MIPS32: sw s2,{{.*}}(sp) |
| 452 ; MIPS32: sw s1,{{.*}}(sp) |
| 453 ; MIPS32: sw s0,{{.*}}(sp) |
| 454 ; MIPS32: lw s0,{{.*}}(sp) |
| 455 ; MIPS32: lw s1,{{.*}}(sp) |
| 456 ; MIPS32: lw s2,{{.*}}(sp) |
| 457 ; MIPS32: lw s3,{{.*}}(sp) |
| 458 ; MIPS32: lw s4,{{.*}}(sp) |
| 459 ; MIPS32: lw s5,{{.*}}(sp) |
| 460 ; MIPS32: lw s6,{{.*}}(sp) |
| 461 ; MIPS32: lw s7,{{.*}}(sp) |
| 462 ; MIPS32: jal 0 <test_returning_arg0> 348: R_MIPS_26 killXmmRegisters |
| 463 ; MIPS32: nop |
| 464 ; MIPS32: li v0,0 |
| 465 ; MIPS32: li v1,0 |
| 466 ; MIPS32: sw v0,{{.*}}(sp) |
| 467 ; MIPS32: sw v1,{{.*}}(sp) |
| 468 ; MIPS32: lw v0,{{.*}}(sp) |
| 469 ; MIPS32: sw v0,{{.*}}(sp) |
| 470 ; MIPS32: lw v0,{{.*}}(sp) |
| 471 ; MIPS32: sw v0,{{.*}}(sp) |
| 472 ; MIPS32: lw v0,{{.*}}(sp) |
| 473 ; MIPS32: sw v0,{{.*}}(sp) |
| 474 ; MIPS32: lw v0,{{.*}}(sp) |
| 475 ; MIPS32: sw v0,{{.*}}(sp) |
| 476 ; MIPS32: li v0,0 |
| 477 ; MIPS32: li v1,1 |
| 478 ; MIPS32: sw v0,{{.*}}(sp) |
| 479 ; MIPS32: sw v1,{{.*}}(sp) |
| 480 ; MIPS32: lw v0,{{.*}}(sp) |
| 481 ; MIPS32: sw v0,{{.*}}(sp) |
| 482 ; MIPS32: lw v0,{{.*}}(sp) |
| 483 ; MIPS32: sw v0,{{.*}}(sp) |
| 484 ; MIPS32: lw v0,{{.*}}(sp) |
| 485 ; MIPS32: sw v0,{{.*}}(sp) |
| 486 ; MIPS32: lw v0,{{.*}}(sp) |
| 487 ; MIPS32: sw v0,{{.*}}(sp) |
| 488 ; MIPS32: lui v0,0x0 3b0: R_MIPS_HI16 .L$float$40000000 |
| 489 ; MIPS32: lwc1 $f0,0(v0) 3b4: R_MIPS_LO16 .L$float$40000000 |
| 490 ; MIPS32: swc1 $f0,{{.*}}(sp) |
| 491 ; MIPS32: lw v0,{{.*}}(sp) |
| 492 ; MIPS32: sw v0,{{.*}}(sp) |
| 493 ; MIPS32: lw v0,{{.*}}(sp) |
| 494 ; MIPS32: sw v0,{{.*}}(sp) |
| 495 ; MIPS32: lw v0,{{.*}}(sp) |
| 496 ; MIPS32: sw v0,{{.*}}(sp) |
| 497 ; MIPS32: lw v0,{{.*}}(sp) |
| 498 ; MIPS32: sw v0,{{.*}}(sp) |
| 499 ; MIPS32: lui v0,0x0 3dc: R_MIPS_HI16 .L$double$4008000000000000 |
| 500 ; MIPS32: ldc1 $f0,0(v0) 3e0: R_MIPS_LO16 .L$double$4008000000000000 |
| 501 ; MIPS32: sdc1 $f0,{{.*}}(sp) |
| 502 ; MIPS32: sw s4,{{.*}}(sp) |
| 503 ; MIPS32: sw s5,{{.*}}(sp) |
| 504 ; MIPS32: sw s6,{{.*}}(sp) |
| 505 ; MIPS32: sw s7,{{.*}}(sp) |
| 506 ; MIPS32: li v0,4 |
| 507 ; MIPS32: sw v0,{{.*}}(sp) |
| 508 ; MIPS32: sw s0,{{.*}}(sp) |
| 509 ; MIPS32: sw s1,{{.*}}(sp) |
| 510 ; MIPS32: sw s2,{{.*}}(sp) |
| 511 ; MIPS32: sw s3,{{.*}}(sp) |
| 512 ; MIPS32: lw a0,{{.*}}(sp) |
| 513 ; MIPS32: lw a1,{{.*}}(sp) |
| 514 ; MIPS32: lw a2,{{.*}}(sp) |
| 515 ; MIPS32: lw a3,{{.*}}(sp) |
| 516 ; MIPS32: jal 0 <test_returning_arg0> 420: R_MIPS_26 InterspersedVect
orArgs |
| 517 ; MIPS32: nop |
| 518 ; MIPS32: lw s0,{{.*}}(sp) |
| 519 ; MIPS32: lw s1,{{.*}}(sp) |
| 520 ; MIPS32: lw s2,{{.*}}(sp) |
| 521 ; MIPS32: lw s3,{{.*}}(sp) |
| 522 ; MIPS32: lw s4,{{.*}}(sp) |
| 523 ; MIPS32: lw s5,{{.*}}(sp) |
| 524 ; MIPS32: lw s6,{{.*}}(sp) |
| 525 ; MIPS32: lw s7,{{.*}}(sp) |
| 526 ; MIPS32: lw ra,{{.*}}(sp) |
263 } | 527 } |
264 | 528 |
265 ; Test that a vector returned from a function is recognized to be in | 529 ; Test that a vector returned from a function is recognized to be in |
266 ; xmm0. | 530 ; xmm0. |
267 | 531 |
268 declare <4 x float> @VectorReturn(<4 x float> %arg0) | 532 declare <4 x float> @VectorReturn(<4 x float> %arg0) |
269 | 533 |
270 define internal void @test_receiving_vectors(<4 x float> %arg0) { | 534 define internal void @test_receiving_vectors(<4 x float> %arg0) { |
271 entry: | 535 entry: |
272 %result = call <4 x float> @VectorReturn(<4 x float> %arg0) | 536 %result = call <4 x float> @VectorReturn(<4 x float> %arg0) |
273 %result2 = call <4 x float> @VectorReturn(<4 x float> %result) | 537 %result2 = call <4 x float> @VectorReturn(<4 x float> %result) |
274 ret void | 538 ret void |
275 ; CHECK-LABEL: test_receiving_vectors | 539 ; CHECK-LABEL: test_receiving_vectors |
276 ; CHECK: call {{.*}} R_{{.*}} VectorReturn | 540 ; CHECK: call {{.*}} R_{{.*}} VectorReturn |
277 ; CHECK-NOT: movups xmm0 | 541 ; CHECK-NOT: movups xmm0 |
278 ; CHECK: call {{.*}} R_{{.*}} VectorReturn | 542 ; CHECK: call {{.*}} R_{{.*}} VectorReturn |
279 ; CHECK: ret | 543 ; CHECK: ret |
280 | 544 |
281 ; OPTM1-LABEL: test_receiving_vectors | 545 ; OPTM1-LABEL: test_receiving_vectors |
282 ; OPTM1: call {{.*}} R_{{.*}} VectorReturn | 546 ; OPTM1: call {{.*}} R_{{.*}} VectorReturn |
283 ; OPTM1: movups {{.*}},xmm0 | 547 ; OPTM1: movups {{.*}},xmm0 |
284 ; OPTM1: movups xmm0,{{.*}} | 548 ; OPTM1: movups xmm0,{{.*}} |
285 ; OPTM1: call {{.*}} R_{{.*}} VectorReturn | 549 ; OPTM1: call {{.*}} R_{{.*}} VectorReturn |
286 ; OPTM1: ret | 550 ; OPTM1: ret |
| 551 ; MIPS32-LABEL: test_receiving_vectors |
| 552 ; MIPS32: sw s8,{{.*}}(sp) |
| 553 ; MIPS32: sw s0,{{.*}}(sp) |
| 554 ; MIPS32: move s8,sp |
| 555 ; MIPS32: move v0,a0 |
| 556 ; MIPS32: addiu v1,sp,16 |
| 557 ; MIPS32: move s0,v1 |
| 558 ; MIPS32: move a0,s0 |
| 559 ; MIPS32: sw a2,{{.*}}(sp) |
| 560 ; MIPS32: sw a3,{{.*}}(sp) |
| 561 ; MIPS32: move a2,v0 |
| 562 ; MIPS32: move a3,a1 |
| 563 ; MIPS32: jal 0 <test_returning_arg0> 494: R_MIPS_26 VectorReturn |
| 564 ; MIPS32: nop |
| 565 ; MIPS32: lw v0,0(s0) |
| 566 ; MIPS32: lw v1,4(s0) |
| 567 ; MIPS32: lw a1,8(s0) |
| 568 ; MIPS32: lw s0,12(s0) |
| 569 ; MIPS32: addiu a0,sp,32 |
| 570 ; MIPS32: sw a1,{{.*}}(sp) |
| 571 ; MIPS32: sw s0,{{.*}}(sp) |
| 572 ; MIPS32: move a2,v0 |
| 573 ; MIPS32: move a3,v1 |
| 574 ; MIPS32: jal 0 <test_returning_arg0> 4c0: R_MIPS_26 VectorReturn |
| 575 ; MIPS32: nop |
| 576 ; MIPS32: move sp,s8 |
| 577 ; MIPS32: lw s0,{{.*}}(sp) |
| 578 ; MIPS32: lw s8,{{.*}}(sp) |
| 579 ; MIPS32: lw ra,{{.*}}(sp) |
287 } | 580 } |
OLD | NEW |