@@ -7,6 +7,7 @@ macro_rules! no_mangle {
7
7
( $( fn $fun: ident( $( $iid: ident : $ity: ty) ,+) -> $oty: ty; ) +) => {
8
8
intrinsics! {
9
9
$(
10
+ #[ cfg_attr( all( not( windows) , not( target_vendor = "apple" ) ) , weak) ]
10
11
pub extern "C" fn $fun( $( $iid: $ity) ,+) -> $oty {
11
12
self :: libm:: $fun( $( $iid) ,+)
12
13
}
@@ -15,17 +16,7 @@ macro_rules! no_mangle {
15
16
}
16
17
}
17
18
18
- #[ cfg( any(
19
- all(
20
- target_family = "wasm" ,
21
- target_os = "unknown" ,
22
- not( target_env = "wasi" )
23
- ) ,
24
- target_os = "xous" ,
25
- target_os = "uefi" ,
26
- all( target_arch = "xtensa" , target_os = "none" ) ,
27
- all( target_vendor = "fortanix" , target_env = "sgx" )
28
- ) ) ]
19
+ #[ cfg( all( not( windows) , not( target_vendor = "apple" ) ) ) ]
29
20
no_mangle ! {
30
21
fn acos( x: f64 ) -> f64 ;
31
22
fn asin( x: f64 ) -> f64 ;
@@ -41,19 +32,13 @@ no_mangle! {
41
32
fn log10f( x: f32 ) -> f32 ;
42
33
fn log( x: f64 ) -> f64 ;
43
34
fn logf( x: f32 ) -> f32 ;
44
- fn fmin( x: f64 , y: f64 ) -> f64 ;
45
- fn fminf( x: f32 , y: f32 ) -> f32 ;
46
- fn fmax( x: f64 , y: f64 ) -> f64 ;
47
- fn fmaxf( x: f32 , y: f32 ) -> f32 ;
48
35
fn round( x: f64 ) -> f64 ;
49
36
fn roundf( x: f32 ) -> f32 ;
50
37
fn rint( x: f64 ) -> f64 ;
51
38
fn rintf( x: f32 ) -> f32 ;
52
39
fn sin( x: f64 ) -> f64 ;
53
40
fn pow( x: f64 , y: f64 ) -> f64 ;
54
41
fn powf( x: f32 , y: f32 ) -> f32 ;
55
- fn fmod( x: f64 , y: f64 ) -> f64 ;
56
- fn fmodf( x: f32 , y: f32 ) -> f32 ;
57
42
fn acosf( n: f32 ) -> f32 ;
58
43
fn atan2f( a: f32 , b: f32 ) -> f32 ;
59
44
fn atanf( n: f32 ) -> f32 ;
@@ -85,67 +70,17 @@ no_mangle! {
85
70
fn cbrtf( n: f32 ) -> f32 ;
86
71
fn hypotf( x: f32 , y: f32 ) -> f32 ;
87
72
fn tanf( n: f32 ) -> f32 ;
88
- }
89
-
90
- #[ cfg( any(
91
- all(
92
- target_family = "wasm" ,
93
- target_os = "unknown" ,
94
- not( target_env = "wasi" )
95
- ) ,
96
- target_os = "xous" ,
97
- target_os = "uefi" ,
98
- all( target_arch = "xtensa" , target_os = "none" ) ,
99
- all( target_vendor = "fortanix" , target_env = "sgx" ) ,
100
- target_os = "windows"
101
- ) ) ]
102
- intrinsics ! {
103
- pub extern "C" fn lgamma_r( x: f64 , s: & mut i32 ) -> f64 {
104
- let r = self :: libm:: lgamma_r( x) ;
105
- * s = r. 1 ;
106
- r. 0
107
- }
108
-
109
- pub extern "C" fn lgammaf_r( x: f32 , s: & mut i32 ) -> f32 {
110
- let r = self :: libm:: lgammaf_r( x) ;
111
- * s = r. 1 ;
112
- r. 0
113
- }
114
- }
115
73
116
- #[ cfg( any(
117
- target_os = "xous" ,
118
- target_os = "uefi" ,
119
- all( target_arch = "xtensa" , target_os = "none" ) ,
120
- ) ) ]
121
- no_mangle ! {
122
74
fn sqrtf( x: f32 ) -> f32 ;
123
75
fn sqrt( x: f64 ) -> f64 ;
124
- }
125
76
126
- #[ cfg( any(
127
- all( target_vendor = "fortanix" , target_env = "sgx" ) ,
128
- all( target_arch = "xtensa" , target_os = "none" ) ,
129
- target_os = "xous" ,
130
- target_os = "uefi"
131
- ) ) ]
132
- no_mangle ! {
133
77
fn ceil( x: f64 ) -> f64 ;
134
78
fn ceilf( x: f32 ) -> f32 ;
135
79
fn floor( x: f64 ) -> f64 ;
136
80
fn floorf( x: f32 ) -> f32 ;
137
81
fn trunc( x: f64 ) -> f64 ;
138
82
fn truncf( x: f32 ) -> f32 ;
139
- }
140
83
141
- // only for the thumb*-none-eabi*, riscv32*-none-elf, x86_64-unknown-none and mips*-unknown-none targets that lack the floating point instruction set
142
- #[ cfg( any(
143
- all( target_arch = "arm" , target_os = "none" ) ,
144
- all( target_arch = "riscv32" , not( target_feature = "f" ) , target_os = "none" ) ,
145
- all( target_arch = "x86_64" , target_os = "none" ) ,
146
- all( target_arch = "mips" , target_os = "none" ) ,
147
- ) ) ]
148
- no_mangle ! {
149
84
fn fmin( x: f64 , y: f64 ) -> f64 ;
150
85
fn fminf( x: f32 , y: f32 ) -> f32 ;
151
86
fn fmax( x: f64 , y: f64 ) -> f64 ;
@@ -155,3 +90,19 @@ no_mangle! {
155
90
// `f32 % f32`
156
91
fn fmodf( x: f32 , y: f32 ) -> f32 ;
157
92
}
93
+
94
+ intrinsics ! {
95
+ #[ cfg_attr( all( not( windows) , not( target_vendor = "apple" ) ) , weak) ]
96
+ pub extern "C" fn lgamma_r( x: f64 , s: & mut i32 ) -> f64 {
97
+ let r = self :: libm:: lgamma_r( x) ;
98
+ * s = r. 1 ;
99
+ r. 0
100
+ }
101
+
102
+ #[ cfg_attr( all( not( windows) , not( target_vendor = "apple" ) ) , weak) ]
103
+ pub extern "C" fn lgammaf_r( x: f32 , s: & mut i32 ) -> f32 {
104
+ let r = self :: libm:: lgammaf_r( x) ;
105
+ * s = r. 1 ;
106
+ r. 0
107
+ }
108
+ }
0 commit comments