@@ -239,6 +239,9 @@ extern "C" {
239
239
240
240
#[ link_name = "llvm.ppc.altivec.vexptefp" ]
241
241
fn vexptefp ( a : vector_float ) -> vector_float ;
242
+
243
+ #[ link_name = "llvm.floor.v4f32" ]
244
+ fn vfloor ( a : vector_float ) -> vector_float ;
242
245
}
243
246
244
247
macro_rules! s_t_l {
@@ -409,6 +412,8 @@ mod sealed {
409
412
}
410
413
}
411
414
415
+ test_impl ! { vec_floor( a: vector_float) -> vector_float [ vfloor, vrfim / xvrspim ] }
416
+
412
417
test_impl ! { vec_vexptefp( a: vector_float) -> vector_float [ vexptefp, vexptefp ] }
413
418
414
419
test_impl ! { vec_vcmpgtub( a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char [ vcmpgtub, vcmpgtub ] }
@@ -1371,6 +1376,13 @@ mod sealed {
1371
1376
vector_mladd ! { vector_signed_short, vector_signed_short, vector_signed_short }
1372
1377
}
1373
1378
1379
+ /// Vector floor.
1380
+ #[ inline]
1381
+ #[ target_feature( enable = "altivec" ) ]
1382
+ pub unsafe fn vec_floor ( a : vector_float ) -> vector_float {
1383
+ sealed:: vec_floor ( a)
1384
+ }
1385
+
1374
1386
/// Vector expte.
1375
1387
#[ inline]
1376
1388
#[ target_feature( enable = "altivec" ) ]
@@ -1800,6 +1812,11 @@ mod tests {
1800
1812
}
1801
1813
}
1802
1814
1815
+ test_vec_1 ! { test_vec_floor, vec_floor, f32x4,
1816
+ [ 1.1 , 1.9 , -0.5 , -0.9 ] ,
1817
+ [ 1.0 , 1.0 , -1.0 , -1.0 ]
1818
+ }
1819
+
1803
1820
test_vec_1 ! { test_vec_expte, vec_expte, f32x4,
1804
1821
[ 0.0 , 2.0 , 2.0 , -1.0 ] ,
1805
1822
~[ 1.0 , 4.0 , 4.0 , 0.5 ]
0 commit comments