1
1
//@ assembly-output: emit-asm
2
- //@ only-x86
3
2
// FIXME(#114479): LLVM miscompiles loading and storing `f32` and `f64` when SSE is disabled.
4
3
// There's no compiletest directive to ignore a test on i586 only, so just always explicitly enable
5
4
// SSE2.
6
5
// Use the same target CPU as `i686` so that LLVM orders the instructions in the same order.
7
6
//@ compile-flags: -Ctarget-feature=+sse2 -Ctarget-cpu=pentium4
8
7
// Force frame pointers to make ASM more consistent between targets
9
- //@ compile-flags: -Copt-level=3 -C force-frame-pointers
8
+ //@ compile-flags: -C force-frame-pointers
9
+ // At opt-level=3, LLVM can merge two movss into one movsd, and we aren't testing for that.
10
+ //@ compile-flags: -Copt-level=2
10
11
//@ filecheck-flags: --implicit-check-not fld --implicit-check-not fst
11
- //@ revisions: normal win
12
- //@[normal] ignore-windows
13
- //@[win] only-windows
12
+ //@ revisions: linux win
13
+ //@ add-core-stubs
14
+ //@ needs-llvm-components: x86
15
+ //@[linux] compile-flags: --target i686-unknown-linux-gnu
16
+ //@[win] compile-flags: --target i686-pc-windows-msvc
14
17
15
18
#![ crate_type = "lib" ]
16
19
#![ feature( f16, f128) ]
20
+ #![ feature( no_core) ]
21
+ #![ no_core]
22
+
23
+ extern crate minicore;
24
+ use minicore:: * ;
17
25
18
26
// Tests that returning `f32` and `f64` with the "Rust" ABI on 32-bit x86 doesn't use the x87
19
27
// floating point stack, as loading and storing `f32`s and `f64`s to and from the x87 stack quietens
@@ -190,8 +198,8 @@ pub unsafe fn call_f64_f64(x: &mut (f64, f64)) {
190
198
}
191
199
// CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
192
200
// CHECK: calll {{()|_}}get_f64_f64
193
- // normal : movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
194
- // normal -NEXT: movsd [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
201
+ // linux : movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
202
+ // linux -NEXT: movsd [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
195
203
// win: movsd (%esp), %[[VAL1:.*]]
196
204
// win-NEXT: movsd 8(%esp), %[[VAL2:.*]]
197
205
// CHECK-NEXT: movsd %[[VAL1]], (%[[PTR]])
@@ -207,12 +215,12 @@ pub unsafe fn call_f32_f64(x: &mut (f32, f64)) {
207
215
}
208
216
// CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
209
217
// CHECK: calll {{()|_}}get_f32_f64
210
- // normal : movss [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
211
- // normal -NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
218
+ // linux : movss [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
219
+ // linux -NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
212
220
// win: movss (%esp), %[[VAL1:.*]]
213
221
// win-NEXT: movsd 8(%esp), %[[VAL2:.*]]
214
222
// CHECK-NEXT: movss %[[VAL1]], (%[[PTR]])
215
- // normal -NEXT: movsd %[[VAL2]], 4(%[[PTR]])
223
+ // linux -NEXT: movsd %[[VAL2]], 4(%[[PTR]])
216
224
// win-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
217
225
* x = get_f32_f64 ( ) ;
218
226
}
@@ -225,8 +233,8 @@ pub unsafe fn call_f64_f32(x: &mut (f64, f32)) {
225
233
}
226
234
// CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
227
235
// CHECK: calll {{()|_}}get_f64_f32
228
- // normal : movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
229
- // normal -NEXT: movss [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
236
+ // linux : movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
237
+ // linux -NEXT: movss [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
230
238
// win: movsd (%esp), %[[VAL1:.*]]
231
239
// win-NEXT: movss 8(%esp), %[[VAL2:.*]]
232
240
// CHECK-NEXT: movsd %[[VAL1]], (%[[PTR]])
@@ -257,8 +265,8 @@ pub unsafe fn call_f64_other(x: &mut (f64, usize)) {
257
265
}
258
266
// CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
259
267
// CHECK: calll {{()|_}}get_f64_other
260
- // normal : movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
261
- // normal -NEXT: movl [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
268
+ // linux : movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
269
+ // linux -NEXT: movl [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
262
270
// win: movsd (%esp), %[[VAL1:.*]]
263
271
// win-NEXT: movl 8(%esp), %[[VAL2:.*]]
264
272
// CHECK-NEXT: movsd %[[VAL1]], (%[[PTR]])
@@ -289,12 +297,12 @@ pub unsafe fn call_other_f64(x: &mut (usize, f64)) {
289
297
}
290
298
// CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
291
299
// CHECK: calll {{()|_}}get_other_f64
292
- // normal : movl [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
293
- // normal -NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
300
+ // linux : movl [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
301
+ // linux -NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
294
302
// win: movl (%esp), %[[VAL1:.*]]
295
303
// win-NEXT: movsd 8(%esp), %[[VAL2:.*]]
296
304
// CHECK-NEXT: movl %[[VAL1]], (%[[PTR]])
297
- // normal -NEXT: movsd %[[VAL2]], 4(%[[PTR]])
305
+ // linux -NEXT: movsd %[[VAL2]], 4(%[[PTR]])
298
306
// win-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
299
307
* x = get_other_f64 ( ) ;
300
308
}
0 commit comments