3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ fn fn_abi_new_uncached<'tcx>(
371
371
let target = & cx. tcx . sess . target ;
372
372
let target_env_gnu_like = matches ! ( & target. env[ ..] , "gnu" | "musl" | "uclibc" ) ;
373
373
let win_x64_gnu = target. os == "windows" && target. arch == "x86_64" && target. env == "gnu" ;
374
+ let x86_32 = target. arch == "x86" ;
374
375
let linux_s390x_gnu_like =
375
376
target. os == "linux" && target. arch == "s390x" && target_env_gnu_like;
376
377
let linux_sparc64_gnu_like =
@@ -415,6 +416,10 @@ fn fn_abi_new_uncached<'tcx>(
415
416
is_return,
416
417
drop_target_pointee,
417
418
) ;
419
+ // Use SSE instead of x87 registers for return values when available
420
+ if x86_32 && rust_abi && is_return && matches ! ( scalar. primitive( ) , F32 | F64 ) {
421
+ attrs. set ( ArgAttribute :: InReg ) ;
422
+ }
418
423
attrs
419
424
} ) ;
420
425
Original file line number Diff line number Diff line change @@ -315,7 +315,6 @@ fn test_is_sign_negative() {
315
315
assert ! ( ( -f32 :: NAN ) . is_sign_negative( ) ) ;
316
316
}
317
317
318
- #[ allow( unused_macros) ]
319
318
macro_rules! assert_f32_biteq {
320
319
( $left : expr, $right : expr) => {
321
320
let l: & f32 = & $left;
@@ -326,9 +325,6 @@ macro_rules! assert_f32_biteq {
326
325
} ;
327
326
}
328
327
329
- // Ignore test on x87 floating point, these platforms do not guarantee NaN
330
- // payloads are preserved and flush denormals to zero, failing the tests.
331
- #[ cfg( not( target_arch = "x86" ) ) ]
332
328
#[ test]
333
329
fn test_next_up ( ) {
334
330
let tiny = f32:: from_bits ( 1 ) ;
@@ -359,9 +355,6 @@ fn test_next_up() {
359
355
assert_f32_biteq ! ( nan2. next_up( ) , nan2) ;
360
356
}
361
357
362
- // Ignore test on x87 floating point, these platforms do not guarantee NaN
363
- // payloads are preserved and flush denormals to zero, failing the tests.
364
- #[ cfg( not( target_arch = "x86" ) ) ]
365
358
#[ test]
366
359
fn test_next_down ( ) {
367
360
let tiny = f32:: from_bits ( 1 ) ;
Original file line number Diff line number Diff line change @@ -305,7 +305,6 @@ fn test_is_sign_negative() {
305
305
assert ! ( ( -f64 :: NAN ) . is_sign_negative( ) ) ;
306
306
}
307
307
308
- #[ allow( unused_macros) ]
309
308
macro_rules! assert_f64_biteq {
310
309
( $left : expr, $right : expr) => {
311
310
let l: & f64 = & $left;
@@ -316,9 +315,6 @@ macro_rules! assert_f64_biteq {
316
315
} ;
317
316
}
318
317
319
- // Ignore test on x87 floating point, these platforms do not guarantee NaN
320
- // payloads are preserved and flush denormals to zero, failing the tests.
321
- #[ cfg( not( target_arch = "x86" ) ) ]
322
318
#[ test]
323
319
fn test_next_up ( ) {
324
320
let tiny = f64:: from_bits ( 1 ) ;
@@ -348,9 +344,6 @@ fn test_next_up() {
348
344
assert_f64_biteq ! ( nan2. next_up( ) , nan2) ;
349
345
}
350
346
351
- // Ignore test on x87 floating point, these platforms do not guarantee NaN
352
- // payloads are preserved and flush denormals to zero, failing the tests.
353
- #[ cfg( not( target_arch = "x86" ) ) ]
354
347
#[ test]
355
348
fn test_next_down ( ) {
356
349
let tiny = f64:: from_bits ( 1 ) ;
0 commit comments