@@ -212,14 +212,6 @@ extern "C" {
212
212
fn llvm_i64x2_all_true ( x : simd:: i64x2 ) -> i32 ;
213
213
#[ link_name = "llvm.wasm.bitmask.v2i64" ]
214
214
fn llvm_bitmask_i64x2 ( a : simd:: i64x2 ) -> i32 ;
215
- #[ link_name = "llvm.wasm.extend.low.signed" ]
216
- fn llvm_i64x2_extend_low_i32x4_s ( a : simd:: i32x4 ) -> simd:: i64x2 ;
217
- #[ link_name = "llvm.wasm.extend.high.signed" ]
218
- fn llvm_i64x2_extend_high_i32x4_s ( a : simd:: i32x4 ) -> simd:: i64x2 ;
219
- #[ link_name = "llvm.wasm.extend.low.unsigned" ]
220
- fn llvm_i64x2_extend_low_i32x4_u ( a : simd:: i32x4 ) -> simd:: i64x2 ;
221
- #[ link_name = "llvm.wasm.extend.high.unsigned" ]
222
- fn llvm_i64x2_extend_high_i32x4_u ( a : simd:: i32x4 ) -> simd:: i64x2 ;
223
215
#[ link_name = "llvm.wasm.extmul.low.signed.v2i64" ]
224
216
fn llvm_i64x2_extmul_low_i32x4_s ( a : simd:: i32x4 , b : simd:: i32x4 ) -> simd:: i64x2 ;
225
217
#[ link_name = "llvm.wasm.extmul.high.signed.v2i64" ]
@@ -229,13 +221,13 @@ extern "C" {
229
221
#[ link_name = "llvm.wasm.extmul.high.unsigned.v2i64" ]
230
222
fn llvm_i64x2_extmul_high_i32x4_u ( a : simd:: i32x4 , b : simd:: i32x4 ) -> simd:: i64x2 ;
231
223
232
- #[ link_name = "llvm.wasm. ceil.v4f32" ]
224
+ #[ link_name = "llvm.ceil.v4f32" ]
233
225
fn llvm_f32x4_ceil ( x : simd:: f32x4 ) -> simd:: f32x4 ;
234
- #[ link_name = "llvm.wasm. floor.v4f32" ]
226
+ #[ link_name = "llvm.floor.v4f32" ]
235
227
fn llvm_f32x4_floor ( x : simd:: f32x4 ) -> simd:: f32x4 ;
236
- #[ link_name = "llvm.wasm. trunc.v4f32" ]
228
+ #[ link_name = "llvm.trunc.v4f32" ]
237
229
fn llvm_f32x4_trunc ( x : simd:: f32x4 ) -> simd:: f32x4 ;
238
- #[ link_name = "llvm.wasm.nearest .v4f32" ]
230
+ #[ link_name = "llvm.nearbyint .v4f32" ]
239
231
fn llvm_f32x4_nearest ( x : simd:: f32x4 ) -> simd:: f32x4 ;
240
232
#[ link_name = "llvm.fabs.v4f32" ]
241
233
fn llvm_f32x4_abs ( x : simd:: f32x4 ) -> simd:: f32x4 ;
@@ -250,13 +242,13 @@ extern "C" {
250
242
#[ link_name = "llvm.wasm.pmax.v4f32" ]
251
243
fn llvm_f32x4_pmax ( x : simd:: f32x4 , y : simd:: f32x4 ) -> simd:: f32x4 ;
252
244
253
- #[ link_name = "llvm.wasm. ceil.v2f64" ]
245
+ #[ link_name = "llvm.ceil.v2f64" ]
254
246
fn llvm_f64x2_ceil ( x : simd:: f64x2 ) -> simd:: f64x2 ;
255
- #[ link_name = "llvm.wasm. floor.v2f64" ]
247
+ #[ link_name = "llvm.floor.v2f64" ]
256
248
fn llvm_f64x2_floor ( x : simd:: f64x2 ) -> simd:: f64x2 ;
257
- #[ link_name = "llvm.wasm. trunc.v2f64" ]
249
+ #[ link_name = "llvm.trunc.v2f64" ]
258
250
fn llvm_f64x2_trunc ( x : simd:: f64x2 ) -> simd:: f64x2 ;
259
- #[ link_name = "llvm.wasm.nearest .v2f64" ]
251
+ #[ link_name = "llvm.nearbyint .v2f64" ]
260
252
fn llvm_f64x2_nearest ( x : simd:: f64x2 ) -> simd:: f64x2 ;
261
253
#[ link_name = "llvm.fabs.v2f64" ]
262
254
fn llvm_f64x2_abs ( x : simd:: f64x2 ) -> simd:: f64x2 ;
@@ -271,18 +263,14 @@ extern "C" {
271
263
#[ link_name = "llvm.wasm.pmax.v2f64" ]
272
264
fn llvm_f64x2_pmax ( x : simd:: f64x2 , y : simd:: f64x2 ) -> simd:: f64x2 ;
273
265
274
- #[ link_name = "llvm.wasm.trunc.saturate.signed .v4i32.v4f32" ]
266
+ #[ link_name = "llvm.fptosi.sat .v4i32.v4f32" ]
275
267
fn llvm_i32x4_trunc_sat_f32x4_s ( x : simd:: f32x4 ) -> simd:: i32x4 ;
276
- #[ link_name = "llvm.wasm.trunc.saturate.unsigned .v4i32.v4f32" ]
268
+ #[ link_name = "llvm.fptoui.sat .v4i32.v4f32" ]
277
269
fn llvm_i32x4_trunc_sat_f32x4_u ( x : simd:: f32x4 ) -> simd:: i32x4 ;
278
- #[ link_name = "llvm.wasm.convert.low.signed" ]
279
- fn llvm_f64x2_convert_low_i32x4_s ( x : simd:: i32x4 ) -> simd:: f64x2 ;
280
- #[ link_name = "llvm.wasm.convert.low.unsigned" ]
281
- fn llvm_f64x2_convert_low_i32x4_u ( x : simd:: i32x4 ) -> simd:: f64x2 ;
282
- #[ link_name = "llvm.wasm.trunc.sat.zero.signed" ]
283
- fn llvm_i32x4_trunc_sat_f64x2_s_zero ( x : simd:: f64x2 ) -> simd:: i32x4 ;
284
- #[ link_name = "llvm.wasm.trunc.sat.zero.unsigned" ]
285
- fn llvm_i32x4_trunc_sat_f64x2_u_zero ( x : simd:: f64x2 ) -> simd:: i32x4 ;
270
+ #[ link_name = "llvm.fptosi.sat.v2i32.v2f64" ]
271
+ fn llvm_i32x2_trunc_sat_f64x2_s ( x : simd:: f64x2 ) -> simd:: i32x2 ;
272
+ #[ link_name = "llvm.fptoui.sat.v2i32.v2f64" ]
273
+ fn llvm_i32x2_trunc_sat_f64x2_u ( x : simd:: f64x2 ) -> simd:: i32x2 ;
286
274
#[ link_name = "llvm.wasm.demote.zero" ]
287
275
fn llvm_f32x4_demote_f64x2_zero ( x : simd:: f64x2 ) -> simd:: f32x4 ;
288
276
#[ link_name = "llvm.wasm.promote.low" ]
@@ -1836,7 +1824,7 @@ pub unsafe fn v128_bitselect(v1: v128, v2: v128, c: v128) -> v128 {
1836
1824
1837
1825
/// Returns true if any lane is nonzero or false if all lanes are zero.
1838
1826
#[ inline]
1839
- // #[cfg_attr(test, assert_instr(v128.any_true))] // FIXME llvm
1827
+ #[ cfg_attr( test, assert_instr( v128. any_true) ) ]
1840
1828
#[ target_feature( enable = "simd128" ) ]
1841
1829
pub unsafe fn v128_any_true ( a : v128 ) -> bool {
1842
1830
llvm_any_true_i8x16 ( a. as_i8x16 ( ) ) != 0
@@ -2688,7 +2676,9 @@ pub unsafe fn i64x2_bitmask(a: v128) -> i32 {
2688
2676
// #[cfg_attr(test, assert_instr(i64x2.extend_low_i32x4_s))] // FIXME wasmtime
2689
2677
#[ target_feature( enable = "simd128" ) ]
2690
2678
pub unsafe fn i64x2_extend_low_i32x4 ( a : v128 ) -> v128 {
2691
- transmute ( llvm_i64x2_extend_low_i32x4_s ( a. as_i32x4 ( ) ) )
2679
+ transmute ( simd_cast :: < _ , simd:: i64x2 > (
2680
+ simd_shuffle2 :: < _ , simd:: i32x2 > ( a. as_i32x4 ( ) , a. as_i32x4 ( ) , [ 0 , 1 ] ) ,
2681
+ ) )
2692
2682
}
2693
2683
2694
2684
/// Converts high half of the smaller lane vector to a larger lane
@@ -2697,7 +2687,9 @@ pub unsafe fn i64x2_extend_low_i32x4(a: v128) -> v128 {
2697
2687
// #[cfg_attr(test, assert_instr(i64x2.extend_high_i32x4_s))] // FIXME wasmtime
2698
2688
#[ target_feature( enable = "simd128" ) ]
2699
2689
pub unsafe fn i64x2_extend_high_i32x4 ( a : v128 ) -> v128 {
2700
- transmute ( llvm_i64x2_extend_high_i32x4_s ( a. as_i32x4 ( ) ) )
2690
+ transmute ( simd_cast :: < _ , simd:: i64x2 > (
2691
+ simd_shuffle2 :: < _ , simd:: i32x2 > ( a. as_i32x4 ( ) , a. as_i32x4 ( ) , [ 2 , 3 ] ) ,
2692
+ ) )
2701
2693
}
2702
2694
2703
2695
/// Converts low half of the smaller lane vector to a larger lane
@@ -2706,7 +2698,9 @@ pub unsafe fn i64x2_extend_high_i32x4(a: v128) -> v128 {
2706
2698
// #[cfg_attr(test, assert_instr(i64x2.extend_low_i32x4_u))] // FIXME wasmtime
2707
2699
#[ target_feature( enable = "simd128" ) ]
2708
2700
pub unsafe fn i64x2_extend_low_u32x4 ( a : v128 ) -> v128 {
2709
- transmute ( llvm_i64x2_extend_low_i32x4_u ( a. as_i32x4 ( ) ) )
2701
+ transmute ( simd_cast :: < _ , simd:: i64x2 > (
2702
+ simd_shuffle2 :: < _ , simd:: u32x2 > ( a. as_u32x4 ( ) , a. as_u32x4 ( ) , [ 0 , 1 ] ) ,
2703
+ ) )
2710
2704
}
2711
2705
2712
2706
/// Converts high half of the smaller lane vector to a larger lane
@@ -2715,7 +2709,9 @@ pub unsafe fn i64x2_extend_low_u32x4(a: v128) -> v128 {
2715
2709
// #[cfg_attr(test, assert_instr(i64x2.extend_high_i32x4_u))] // FIXME wasmtime
2716
2710
#[ target_feature( enable = "simd128" ) ]
2717
2711
pub unsafe fn i64x2_extend_high_u32x4 ( a : v128 ) -> v128 {
2718
- transmute ( llvm_i64x2_extend_low_i32x4_u ( a. as_i32x4 ( ) ) )
2712
+ transmute ( simd_cast :: < _ , simd:: i64x2 > (
2713
+ simd_shuffle2 :: < _ , simd:: u32x2 > ( a. as_u32x4 ( ) , a. as_u32x4 ( ) , [ 2 , 3 ] ) ,
2714
+ ) )
2719
2715
}
2720
2716
2721
2717
/// Shifts each lane to the left by the specified number of bits.
@@ -3137,7 +3133,11 @@ pub unsafe fn f32x4_convert_u32x4(a: v128) -> v128 {
3137
3133
// #[cfg_attr(test, assert_instr(i32x4.trunc_sat_f64x2_s_zero))] // FIXME wasmtime
3138
3134
#[ target_feature( enable = "simd128" ) ]
3139
3135
pub unsafe fn i32x4_trunc_sat_f64x2_zero ( a : v128 ) -> v128 {
3140
- transmute ( llvm_i32x4_trunc_sat_f64x2_s_zero ( a. as_f64x2 ( ) ) )
3136
+ transmute ( simd_shuffle4 :: < simd:: i32x2 , simd:: i32x4 > (
3137
+ llvm_i32x2_trunc_sat_f64x2_s ( a. as_f64x2 ( ) ) ,
3138
+ simd:: i32x2:: splat ( 0 ) ,
3139
+ [ 0 , 1 , 2 , 3 ] ,
3140
+ ) )
3141
3141
}
3142
3142
3143
3143
/// Saturating conversion of the two double-precision floating point lanes to
@@ -3152,23 +3152,41 @@ pub unsafe fn i32x4_trunc_sat_f64x2_zero(a: v128) -> v128 {
3152
3152
// #[cfg_attr(test, assert_instr(i32x4.trunc_sat_f64x2_u_zero))] // FIXME wasmtime
3153
3153
#[ target_feature( enable = "simd128" ) ]
3154
3154
pub unsafe fn u32x4_trunc_sat_f64x2_zero ( a : v128 ) -> v128 {
3155
- transmute ( llvm_i32x4_trunc_sat_f64x2_u_zero ( a. as_f64x2 ( ) ) )
3155
+ transmute ( simd_shuffle4 :: < simd:: i32x2 , simd:: i32x4 > (
3156
+ llvm_i32x2_trunc_sat_f64x2_u ( a. as_f64x2 ( ) ) ,
3157
+ simd:: i32x2:: splat ( 0 ) ,
3158
+ [ 0 , 1 , 2 , 3 ] ,
3159
+ ) )
3156
3160
}
3157
3161
3158
3162
/// Lane-wise conversion from integer to floating point.
3159
3163
#[ inline]
3160
3164
#[ cfg_attr( test, assert_instr( f64x2. convert_low_i32x4_s) ) ]
3161
3165
#[ target_feature( enable = "simd128" ) ]
3162
3166
pub unsafe fn f64x2_convert_low_i32x4 ( a : v128 ) -> v128 {
3163
- transmute ( llvm_f64x2_convert_low_i32x4_s ( a. as_i32x4 ( ) ) )
3167
+ transmute ( simd_cast :: < _ , simd:: f64x2 > ( simd_shuffle2 :: <
3168
+ simd:: i32x4 ,
3169
+ simd:: i32x2 ,
3170
+ > (
3171
+ a. as_i32x4 ( ) ,
3172
+ a. as_i32x4 ( ) ,
3173
+ [ 0 , 1 ] ,
3174
+ ) ) )
3164
3175
}
3165
3176
3166
3177
/// Lane-wise conversion from integer to floating point.
3167
3178
#[ inline]
3168
3179
// #[cfg_attr(test, assert_instr(f64x2.convert_low_i32x4_u))] // FIXME wasmtime
3169
3180
#[ target_feature( enable = "simd128" ) ]
3170
3181
pub unsafe fn f64x2_convert_low_u32x4 ( a : v128 ) -> v128 {
3171
- transmute ( llvm_f64x2_convert_low_i32x4_u ( a. as_i32x4 ( ) ) )
3182
+ transmute ( simd_cast :: < _ , simd:: f64x2 > ( simd_shuffle2 :: <
3183
+ simd:: u32x4 ,
3184
+ simd:: u32x2 ,
3185
+ > (
3186
+ a. as_u32x4 ( ) ,
3187
+ a. as_u32x4 ( ) ,
3188
+ [ 0 , 1 ] ,
3189
+ ) ) )
3172
3190
}
3173
3191
3174
3192
/// Conversion of the two double-precision floating point lanes to two lower
0 commit comments