@@ -51,22 +51,22 @@ pub mod reimpls {
51
51
// match here what LLVM expects from us. This is only
52
52
// required for the return type!
53
53
#[ cfg( not( stage0) ) ]
54
- #[ cfg( windows) ]
54
+ #[ cfg( all ( windows, target_pointer_width= "64" ) ) ]
55
55
#[ repr( simd) ]
56
56
pub struct u64x2 ( u64 , u64 ) ;
57
57
58
58
#[ cfg( not( stage0) ) ]
59
- #[ cfg( windows) ]
59
+ #[ cfg( all ( windows, target_pointer_width= "64" ) ]
60
60
type u128ret = u64x2;
61
61
62
- #[ cfg( any( not( windows) , stage0) ) ]
62
+ #[ cfg( any( not( all ( windows, target_pointer_width= "64" ) ) , stage0) ) ]
63
63
type u128ret = u128_;
64
64
65
65
#[ cfg( not( stage0) ) ]
66
- #[ cfg( windows) ]
66
+ #[ cfg( all ( windows, target_pointer_width= "64" ) ]
67
67
type i128ret = u64x2;
68
68
69
- #[ cfg( any( not( windows) , stage0) ) ]
69
+ #[ cfg( any( not( all ( windows, target_pointer_width= "64" ) ) , stage0) ) ]
70
70
type i128ret = i128_;
71
71
72
72
macro_rules! ashl {
@@ -477,11 +477,11 @@ pub mod reimpls {
477
477
#[ repr( C , packed) ] struct Parts ( u64 , u64 ) ;
478
478
unsafe { :: core:: mem:: transmute( Parts ( low, high) ) }
479
479
}
480
- #[ cfg( not( windows) ) ]
480
+ #[ cfg( not( all ( windows, target_pointer_width= "64" ) ) ) ]
481
481
fn to_ret( self ) -> u128ret {
482
482
self
483
483
}
484
- #[ cfg( windows) ]
484
+ #[ cfg( all ( windows, target_pointer_width= "64" ) ) ]
485
485
fn to_ret( self ) -> u128ret {
486
486
u64x2( self . low( ) , self . high( ) )
487
487
}
@@ -501,11 +501,11 @@ pub mod reimpls {
501
501
fn from_parts( low: u64 , high: i64 ) -> i128 {
502
502
u128 :: from_parts( low, high as u64 ) as i128
503
503
}
504
- #[ cfg( not( windows) ) ]
504
+ #[ cfg( not( all ( windows, target_pointer_width= "64" ) ) ) ]
505
505
fn to_ret( self ) -> i128ret {
506
506
self
507
507
}
508
- #[ cfg( windows) ]
508
+ #[ cfg( all ( windows, target_pointer_width= "64" ) ) ]
509
509
fn to_ret( self ) -> i128ret {
510
510
u64x2( self . low( ) , self . high( ) as u64 )
511
511
}
@@ -693,30 +693,35 @@ pub mod reimpls {
693
693
// LLVM expectations for ABI on windows are pure madness.
694
694
695
695
#[ cfg( not( stage0) ) ]
696
- #[ cfg_attr( windows, export_name="__floattidf" ) ]
697
- pub extern "C" fn i128_as_f64_win ( alow : u64 , ahigh : i64 ) -> f64 {
698
- i128_as_f64 ( i128_:: from_parts ( alow, ahigh) )
699
- }
696
+ #[ cfg( all( windows, target_pointer_width="64" ) ) ]
697
+ mod windows_64_workarounds {
698
+ #[ export_name="__floattidf" ]
699
+ pub extern "C" fn i128_as_f64_win( alow: u64 , ahigh: i64 ) -> f64 {
700
+ :: i128_as_f64( i128_:: from_parts( alow, ahigh) )
701
+ }
700
702
701
- #[ cfg( not( stage0) ) ]
702
- #[ cfg_attr( windows, export_name="__floattisf" ) ]
703
- pub extern "C" fn i128_as_f32_win ( alow : u64 , ahigh : i64 ) -> f32 {
704
- i128_as_f32 ( i128_:: from_parts ( alow, ahigh) )
705
- }
703
+ #[ export_name="__floattisf" ]
704
+ pub extern "C" fn i128_as_f32_win( alow: u64 , ahigh: i64 ) -> f32 {
705
+ :: i128_as_f32( i128_:: from_parts( alow, ahigh) )
706
+ }
706
707
707
- #[ cfg( not( stage0) ) ]
708
- #[ cfg_attr( windows, export_name="__floatuntidf" ) ]
709
- pub extern "C" fn u128_as_f64_win ( alow : u64 , ahigh : u64 ) -> f64 {
710
- u128_as_f64 ( u128_:: from_parts ( alow, ahigh) )
711
- }
708
+ #[ export_name="__floatuntidf" ]
709
+ pub extern "C" fn u128_as_f64_win( alow: u64 , ahigh: u64 ) -> f64 {
710
+ :: u128_as_f64( u128_:: from_parts( alow, ahigh) )
711
+ }
712
712
713
- # [ cfg ( not ( stage0 ) ) ]
714
- # [ cfg_attr ( windows , export_name= "__floatuntisf" ) ]
715
- pub extern "C" fn u128_as_f32_win ( alow : u64 , ahigh : u64 ) -> f32 {
716
- u128_as_f32 ( u128_ :: from_parts ( alow , ahigh ) )
713
+ # [ export_name= "__floatuntisf" ]
714
+ pub extern "C" fn u128_as_f32_win ( alow : u64 , ahigh : u64 ) -> f32 {
715
+ :: u128_as_f32 ( u128_ :: from_parts ( alow , ahigh) )
716
+ }
717
717
}
718
+ #[ cfg( not( stage0) ) ]
719
+ #[ cfg( all( windows, target_pointer_width="64" ) ) ]
720
+ pub use windows_64_workarounds:: * ;
721
+
718
722
719
- #[ cfg_attr( any( not( windows) , stage0) , export_name="__floattidf" ) ]
723
+ #[ cfg_attr( not( all( windows, target_pointer_width="64" , not( stage0) ) ) ,
724
+ export_name="__floattidf" ) ]
720
725
pub extern "C" fn i128_as_f64( a: i128_) -> f64 {
721
726
match a. signum( ) {
722
727
1 => u128_as_f64( a. uabs( ) ) ,
@@ -725,7 +730,8 @@ pub mod reimpls {
725
730
}
726
731
}
727
732
728
- #[ cfg_attr( any( not( windows) , stage0) , export_name="__floattisf" ) ]
733
+ #[ cfg_attr( not( all( windows, target_pointer_width="64" , not( stage0) ) ) ,
734
+ export_name="__floattisf" ) ]
729
735
pub extern "C" fn i128_as_f32( a: i128_) -> f32 {
730
736
match a. signum( ) {
731
737
1 => u128_as_f32( a. uabs( ) ) ,
@@ -734,7 +740,8 @@ pub mod reimpls {
734
740
}
735
741
}
736
742
737
- #[ cfg_attr( any( not( windows) , stage0) , export_name="__floatuntidf" ) ]
743
+ #[ cfg_attr( not( all( windows, target_pointer_width="64" , not( stage0) ) ) ,
744
+ export_name="__floatuntidf" ) ]
738
745
pub extern "C" fn u128_as_f64( mut a: u128_) -> f64 {
739
746
use :: core:: f64 :: MANTISSA_DIGITS ;
740
747
if a == 0 { return 0.0 ; }
@@ -770,7 +777,8 @@ pub mod reimpls {
770
777
}
771
778
}
772
779
773
- #[ cfg_attr( any( not( windows) , stage0) , export_name="__floatuntisf" ) ]
780
+ #[ cfg_attr( not( all( windows, target_pointer_width="64" , not( stage0) ) ) ,
781
+ export_name="__floatuntisf" ) ]
774
782
pub extern "C" fn u128_as_f32( mut a: u128_) -> f32 {
775
783
use :: core:: f32 :: MANTISSA_DIGITS ;
776
784
if a == 0 { return 0.0 ; }
0 commit comments