@@ -63,69 +63,253 @@ pub extern "rust-intrinsic" {
63
63
64
64
pub fn memmove32 ( dst : * mut u8 , src : * u8 , size : u32 ) ;
65
65
pub fn memmove64 ( dst : * mut u8 , src : * u8 , size : u64 ) ;
66
+ }
66
67
68
+ #[ nolink]
69
+ pub extern mod llvm {
70
+ #[ nomangle]
71
+ #[ rust_stack]
72
+ #[ inline( always) ]
73
+ #[ link_name="llvm.sqrt.f32" ]
67
74
pub fn sqrtf32 ( x : f32 ) -> f32 ;
75
+
76
+ #[ nomangle]
77
+ #[ rust_stack]
78
+ #[ inline( always) ]
79
+ #[ link_name="llvm.sqrt.f64" ]
68
80
pub fn sqrtf64 ( x : f64 ) -> f64 ;
69
81
82
+ #[ nomangle]
83
+ #[ rust_stack]
84
+ #[ inline( always) ]
85
+ #[ link_name="llvm.powi.f32" ]
70
86
pub fn powif32 ( a : f32 , x : i32 ) -> f32 ;
87
+
88
+ #[ nomangle]
89
+ #[ rust_stack]
90
+ #[ inline( always) ]
91
+ #[ link_name="llvm.powi.f64" ]
71
92
pub fn powif64 ( a : f64 , x : i32 ) -> f64 ;
72
93
94
+ #[ nomangle]
95
+ #[ rust_stack]
96
+ #[ inline( always) ]
97
+ #[ link_name="llvm.sin.f32" ]
73
98
pub fn sinf32 ( x : f32 ) -> f32 ;
99
+
100
+ #[ nomangle]
101
+ #[ rust_stack]
102
+ #[ inline( always) ]
103
+ #[ link_name="llvm.sin.f64" ]
74
104
pub fn sinf64 ( x : f64 ) -> f64 ;
75
105
106
+ #[ nomangle]
107
+ #[ rust_stack]
108
+ #[ inline( always) ]
109
+ #[ link_name="llvm.cos.f32" ]
76
110
pub fn cosf32 ( x : f32 ) -> f32 ;
111
+
112
+ #[ nomangle]
113
+ #[ rust_stack]
114
+ #[ inline( always) ]
115
+ #[ link_name="llvm.cos.f64" ]
77
116
pub fn cosf64 ( x : f64 ) -> f64 ;
78
117
118
+ #[ nomangle]
119
+ #[ rust_stack]
120
+ #[ inline( always) ]
121
+ #[ link_name="llvm.pow.f32" ]
79
122
pub fn powf32 ( a : f32 , x : f32 ) -> f32 ;
123
+
124
+ #[ nomangle]
125
+ #[ rust_stack]
126
+ #[ inline( always) ]
127
+ #[ link_name="llvm.pow.f64" ]
80
128
pub fn powf64 ( a : f64 , x : f64 ) -> f64 ;
81
129
130
+ #[ nomangle]
131
+ #[ rust_stack]
132
+ #[ inline( always) ]
133
+ #[ link_name="llvm.exp.f32" ]
82
134
pub fn expf32 ( x : f32 ) -> f32 ;
135
+
136
+ #[ nomangle]
137
+ #[ rust_stack]
138
+ #[ inline( always) ]
139
+ #[ link_name="llvm.exp.f64" ]
83
140
pub fn expf64 ( x : f64 ) -> f64 ;
84
141
142
+ #[ nomangle]
143
+ #[ rust_stack]
144
+ #[ inline( always) ]
145
+ #[ link_name="llvm.log.f32" ]
146
+ pub fn logf32 ( x : f32 ) -> f32 ;
147
+
148
+ #[ nomangle]
149
+ #[ rust_stack]
150
+ #[ inline( always) ]
151
+ #[ link_name="llvm.log.f64" ]
152
+ pub fn logf64 ( x : f64 ) -> f64 ;
153
+
154
+ /* TODO: Do these intrinsics even exist?
85
155
pub fn exp2f32(x: f32) -> f32;
86
156
pub fn exp2f64(x: f64) -> f64;
87
157
88
- pub fn logf32 ( x : f32 ) -> f32 ;
89
- pub fn logf64 ( x : f64 ) -> f64 ;
90
158
91
159
pub fn log10f32(x: f32) -> f32;
92
160
pub fn log10f64(x: f64) -> f64;
93
161
94
162
pub fn log2f32(x: f32) -> f32;
95
163
pub fn log2f64(x: f64) -> f64;
164
+ */
96
165
166
+ #[ nomangle]
167
+ #[ rust_stack]
168
+ #[ inline( always) ]
169
+ #[ link_name="llvm.fma.f32" ]
97
170
pub fn fmaf32 ( a : f32 , b : f32 , c : f32 ) -> f32 ;
171
+
172
+ #[ nomangle]
173
+ #[ rust_stack]
174
+ #[ inline( always) ]
175
+ #[ link_name="llvm.fma.f64" ]
98
176
pub fn fmaf64 ( a : f64 , b : f64 , c : f64 ) -> f64 ;
99
177
178
+ #[ nomangle]
179
+ #[ rust_stack]
180
+ #[ inline( always) ]
181
+ #[ link_name="llvm.fabs.f32" ]
100
182
pub fn fabsf32 ( x : f32 ) -> f32 ;
183
+
184
+ #[ nomangle]
185
+ #[ rust_stack]
186
+ #[ inline( always) ]
187
+ #[ link_name="llvm.fabs.f64" ]
101
188
pub fn fabsf64 ( x : f64 ) -> f64 ;
102
189
190
+ #[ nomangle]
191
+ #[ rust_stack]
192
+ #[ inline( always) ]
193
+ #[ link_name="llvm.floor.f32" ]
103
194
pub fn floorf32 ( x : f32 ) -> f32 ;
195
+
196
+ #[ nomangle]
197
+ #[ rust_stack]
198
+ #[ inline( always) ]
199
+ #[ link_name="llvm.floor.f64" ]
104
200
pub fn floorf64 ( x : f64 ) -> f64 ;
105
201
202
+ /* TODO: Needs LLVM 3.3
203
+ #[nomangle]
204
+ #[rust_stack]
205
+ #[link_name="llvm.ceil.f32"]
106
206
pub fn ceilf32(x: f32) -> f32;
207
+
208
+ #[nomangle]
209
+ #[rust_stack]
210
+ #[link_name="llvm.ceil.f64"]
107
211
pub fn ceilf64(x: f64) -> f64;
108
212
213
+ #[nomangle]
214
+ #[rust_stack]
215
+ #[link_name="llvm.trunc.f32"]
109
216
pub fn truncf32(x: f32) -> f32;
217
+
218
+ #[nomangle]
219
+ #[rust_stack]
220
+ #[link_name="llvm.trunc.f64"]
110
221
pub fn truncf64(x: f64) -> f64;
222
+ */
111
223
224
+ #[ nomangle]
225
+ #[ rust_stack]
226
+ #[ inline( always) ]
227
+ #[ link_name="llvm.ctpop.i8" ]
112
228
pub fn ctpop8 ( x : i8 ) -> i8 ;
229
+
230
+ #[ nomangle]
231
+ #[ rust_stack]
232
+ #[ inline( always) ]
233
+ #[ link_name="llvm.ctpop.i16" ]
113
234
pub fn ctpop16 ( x : i16 ) -> i16 ;
114
- pub fn ctpop32 ( x : i32 ) -> i32 ;
115
- pub fn ctpop64 ( x : i64 ) -> i64 ;
116
235
117
- pub fn ctlz8 ( x : i8 ) -> i8 ;
118
- pub fn ctlz16 ( x : i16 ) -> i16 ;
119
- pub fn ctlz32 ( x : i32 ) -> i32 ;
120
- pub fn ctlz64 ( x : i64 ) -> i64 ;
236
+ #[ nomangle]
237
+ #[ rust_stack]
238
+ #[ inline( always) ]
239
+ #[ link_name="llvm.ctpop.i32" ]
240
+ pub fn ctpop32 ( x : i32 ) -> i32 ;
121
241
122
- pub fn cttz8 ( x : i8 ) -> i8 ;
123
- pub fn cttz16 ( x : i16 ) -> i16 ;
124
- pub fn cttz32 ( x : i32 ) -> i32 ;
125
- pub fn cttz64 ( x : i64 ) -> i64 ;
242
+ #[ nomangle]
243
+ #[ rust_stack]
244
+ #[ inline( always) ]
245
+ #[ link_name="llvm.ctpop.i64" ]
246
+ pub fn ctpop64 ( x : i64 ) -> i64 ;
126
247
248
+ /* TODO: Needs bool constants
249
+ #[nomangle]
250
+ #[rust_stack]
251
+ #[inline(always)]
252
+ #[link_name="llvm.ctlz.i8"]
253
+ pub fn ctlz8(x: i8, is_zero_undef: bool) -> i8;
254
+
255
+ #[nomangle]
256
+ #[rust_stack]
257
+ #[inline(always)]
258
+ #[link_name="llvm.ctlz.i16"]
259
+ pub fn ctlz16(x: i16, is_zero_undef: bool) -> i16;
260
+
261
+ #[nomangle]
262
+ #[rust_stack]
263
+ #[inline(always)]
264
+ #[link_name="llvm.ctlz.i32"]
265
+ pub fn ctlz32(x: i32, is_zero_undef: bool) -> i32;
266
+
267
+ #[nomangle]
268
+ #[rust_stack]
269
+ #[inline(always)]
270
+ #[link_name="llvm.ctlz.i64"]
271
+ pub fn ctlz64(x: i64, is_zero_undef: bool) -> i64;
272
+
273
+ #[nomangle]
274
+ #[rust_stack]
275
+ #[inline(always)]
276
+ #[link_name="llvm.cttz.i8"]
277
+ pub fn cttz8(x: i8, is_zero_undef: bool) -> i8;
278
+
279
+ #[nomangle]
280
+ #[rust_stack]
281
+ #[inline(always)]
282
+ #[link_name="llvm.cttz.i16"]
283
+ pub fn cttz16(x: i16, is_zero_undef: bool) -> i16;
284
+
285
+ #[nomangle]
286
+ #[rust_stack]
287
+ #[inline(always)]
288
+ #[link_name="llvm.cttz.i32"]
289
+ pub fn cttz32(x: i32, is_zero_undef: bool) -> i32;
290
+
291
+ #[nomangle]
292
+ #[rust_stack]
293
+ #[inline(always)]
294
+ #[link_name="llvm.cttz.i64"]
295
+ pub fn cttz64(x: i64, is_zero_undef: bool) -> i64;
296
+ */
297
+
298
+ #[ nomangle]
299
+ #[ rust_stack]
300
+ #[ inline( always) ]
301
+ #[ link_name="llvm.bswap.i16" ]
127
302
pub fn bswap16 ( x : i16 ) -> i16 ;
303
+
304
+ #[ nomangle]
305
+ #[ rust_stack]
306
+ #[ inline( always) ]
307
+ #[ link_name="llvm.bswap.i32" ]
128
308
pub fn bswap32 ( x : i32 ) -> i32 ;
309
+
310
+ #[ nomangle]
311
+ #[ rust_stack]
312
+ #[ inline( always) ]
313
+ #[ link_name="llvm.bswap.i64" ]
129
314
pub fn bswap64 ( x : i64 ) -> i64 ;
130
315
}
131
-
0 commit comments