@@ -163,8 +163,7 @@ mod sealed {
163
163
164
164
#[ inline]
165
165
#[ target_feature( enable = "vector" ) ]
166
- // FIXME: "vfasb" is part of vector enhancements 1, add a test for it when possible
167
- // #[cfg_attr(test, assert_instr(vfasb))]
166
+ #[ cfg_attr( all( test, target_feature = "vector-enhancements-1" ) , assert_instr( vfasb) ) ]
168
167
pub unsafe fn va_float ( a : vector_float , b : vector_float ) -> vector_float {
169
168
transmute ( simd_add ( a, b) )
170
169
}
@@ -247,8 +246,7 @@ mod sealed {
247
246
248
247
#[ inline]
249
248
#[ target_feature( enable = "vector" ) ]
250
- // FIXME: "vfssb" is part of vector enhancements 1, add a test for it when possible
251
- // #[cfg_attr(test, assert_instr(vfasb))]
249
+ #[ cfg_attr( all( test, target_feature = "vector-enhancements-1" ) , assert_instr( vfssb) ) ]
252
250
pub unsafe fn vs_float ( a : vector_float , b : vector_float ) -> vector_float {
253
251
transmute ( simd_sub ( a, b) )
254
252
}
@@ -335,9 +333,8 @@ mod sealed {
335
333
336
334
impl_vec_trait ! { [ VectorMax vec_max] ~( vmxlb, vmxb, vmxlh, vmxh, vmxlf, vmxf, vmxlg, vmxg) }
337
335
338
- // FIXME(vector-enhancements-1) test for the `vfmaxsb` etc. instruction
339
- test_impl ! { vec_vfmaxsb ( a: vector_float, b: vector_float) -> vector_float [ simd_fmax, _] }
340
- test_impl ! { vec_vfmaxdb ( a: vector_double, b: vector_double) -> vector_double [ simd_fmax, _] }
336
+ test_impl ! { vec_vfmaxsb ( a: vector_float, b: vector_float) -> vector_float [ simd_fmax, "vector-enhancements-1" vfmaxsb ] }
337
+ test_impl ! { vec_vfmaxdb ( a: vector_double, b: vector_double) -> vector_double [ simd_fmax, "vector-enhancements-1" vfmaxdb] }
341
338
342
339
impl_vec_trait ! ( [ VectorMax vec_max] vec_vfmaxsb ( vector_float, vector_float) -> vector_float) ;
343
340
impl_vec_trait ! ( [ VectorMax vec_max] vec_vfmaxdb ( vector_double, vector_double) -> vector_double) ;
@@ -360,9 +357,8 @@ mod sealed {
360
357
361
358
impl_vec_trait ! { [ VectorMin vec_min] ~( vmxlb, vmxb, vmxlh, vmxh, vmxlf, vmxf, vmxlg, vmxg) }
362
359
363
- // FIXME(vector-enhancements-1) test for the `vfminsb` etc. instruction
364
- test_impl ! { vec_vfminsb ( a: vector_float, b: vector_float) -> vector_float [ simd_fmin, _] }
365
- test_impl ! { vec_vfmindb ( a: vector_double, b: vector_double) -> vector_double [ simd_fmin, _] }
360
+ test_impl ! { vec_vfminsb ( a: vector_float, b: vector_float) -> vector_float [ simd_fmin, "vector-enhancements-1" vfminsb] }
361
+ test_impl ! { vec_vfmindb ( a: vector_double, b: vector_double) -> vector_double [ simd_fmin, "vector-enhancements-1" vfmindb] }
366
362
367
363
impl_vec_trait ! ( [ VectorMin vec_min] vec_vfminsb ( vector_float, vector_float) -> vector_float) ;
368
364
impl_vec_trait ! ( [ VectorMin vec_min] vec_vfmindb ( vector_double, vector_double) -> vector_double) ;
@@ -389,8 +385,7 @@ mod sealed {
389
385
impl_abs ! { vec_abs_i32, i32x4 }
390
386
impl_abs ! { vec_abs_i64, i64x2 }
391
387
392
- // FIXME(vector-enhancements-1)
393
- test_impl ! { vec_abs_f32 ( v: vector_float) -> vector_float [ simd_fabs, _ ] }
388
+ test_impl ! { vec_abs_f32 ( v: vector_float) -> vector_float [ simd_fabs, "vector-enhancements-1" vflpsb ] }
394
389
test_impl ! { vec_abs_f64 ( v: vector_double) -> vector_double [ simd_fabs, vflpdb ] }
395
390
396
391
impl_vec_trait ! { [ VectorAbs vec_abs] vec_abs_f32 ( vector_float) }
@@ -527,10 +522,15 @@ mod sealed {
527
522
test_impl ! { vec_ctzf_unsigned +( a: vector_unsigned_int) -> vector_unsigned_int [ simd_cttz, vctzf] }
528
523
test_impl ! { vec_ctzg_unsigned +( a: vector_unsigned_long_long) -> vector_unsigned_long_long [ simd_cttz, vctzg] }
529
524
530
- // FIXME(vector-enhancements-1) other integer types are emulated, but get their own
531
- // instructions in later facilities. Add tests when possible.
532
- test_impl ! { vec_popcnt_signed +( a: vector_signed_char) -> vector_signed_char [ simd_ctpop, vpopctb] }
533
- test_impl ! { vec_popcnt_unsigned +( a: vector_unsigned_char) -> vector_unsigned_char [ simd_ctpop, vpopctb] }
525
+ test_impl ! { vec_vpopctb_signed +( a: vector_signed_char) -> vector_signed_char [ simd_ctpop, vpopctb] }
526
+ test_impl ! { vec_vpopcth_signed +( a: vector_signed_short) -> vector_signed_short [ simd_ctpop, "vector-enhancements-1" vpopcth] }
527
+ test_impl ! { vec_vpopctf_signed +( a: vector_signed_int) -> vector_signed_int [ simd_ctpop, "vector-enhancements-1" vpopctf] }
528
+ test_impl ! { vec_vpopctg_signed +( a: vector_signed_long_long) -> vector_signed_long_long [ simd_ctpop, "vector-enhancements-1" vpopctg] }
529
+
530
+ test_impl ! { vec_vpopctb_unsigned +( a: vector_unsigned_char) -> vector_unsigned_char [ simd_ctpop, vpopctb] }
531
+ test_impl ! { vec_vpopcth_unsigned +( a: vector_unsigned_short) -> vector_unsigned_short [ simd_ctpop, "vector-enhancements-1" vpopcth] }
532
+ test_impl ! { vec_vpopctf_unsigned +( a: vector_unsigned_int) -> vector_unsigned_int [ simd_ctpop, "vector-enhancements-1" vpopctf] }
533
+ test_impl ! { vec_vpopctg_unsigned +( a: vector_unsigned_long_long) -> vector_unsigned_long_long [ simd_ctpop, "vector-enhancements-1" vpopctg] }
534
534
535
535
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
536
536
pub trait VectorAnd < Other > {
@@ -558,7 +558,7 @@ mod sealed {
558
558
559
559
#[ inline]
560
560
#[ target_feature( enable = "vector" ) ]
561
- // FIXME( vector-enhancements-1) #[cfg_attr(test , assert_instr(vno))]
561
+ # [ cfg_attr ( all ( test , target_feature = " vector-enhancements-1" ) , assert_instr( vno) ) ]
562
562
unsafe fn nor ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char {
563
563
let a: u8x16 = transmute ( a) ;
564
564
let b: u8x16 = transmute ( b) ;
@@ -575,7 +575,7 @@ mod sealed {
575
575
576
576
#[ inline]
577
577
#[ target_feature( enable = "vector" ) ]
578
- // FIXME( vector-enhancements-1) #[cfg_attr(test , assert_instr(vnn))]
578
+ # [ cfg_attr ( all ( test , target_feature = " vector-enhancements-1" ) , assert_instr( vnn) ) ]
579
579
unsafe fn nand ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char {
580
580
let a: u8x16 = transmute ( a) ;
581
581
let b: u8x16 = transmute ( b) ;
@@ -592,7 +592,7 @@ mod sealed {
592
592
593
593
#[ inline]
594
594
#[ target_feature( enable = "vector" ) ]
595
- // FIXME( vector-enhancements-1) #[cfg_attr(test , assert_instr(vnx))]
595
+ # [ cfg_attr ( all ( test , target_feature = " vector-enhancements-1" ) , assert_instr( vnx) ) ]
596
596
unsafe fn eqv ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char {
597
597
let a: u8x16 = transmute ( a) ;
598
598
let b: u8x16 = transmute ( b) ;
@@ -609,7 +609,7 @@ mod sealed {
609
609
610
610
#[ inline]
611
611
#[ target_feature( enable = "vector" ) ]
612
- // FIXME( vector-enhancements-1) #[cfg_attr(test , assert_instr(vnc))]
612
+ # [ cfg_attr ( all ( test , target_feature = " vector-enhancements-1" ) , assert_instr( vnc) ) ]
613
613
unsafe fn andc ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char {
614
614
let a = transmute ( a) ;
615
615
let b = transmute ( b) ;
@@ -626,7 +626,7 @@ mod sealed {
626
626
627
627
#[ inline]
628
628
#[ target_feature( enable = "vector" ) ]
629
- // FIXME( vector-enhancements-1) #[cfg_attr(test , assert_instr(voc))]
629
+ # [ cfg_attr ( all ( test , target_feature = " vector-enhancements-1" ) , assert_instr( voc) ) ]
630
630
unsafe fn orc ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char {
631
631
let a = transmute ( a) ;
632
632
let b = transmute ( b) ;
@@ -641,15 +641,14 @@ mod sealed {
641
641
642
642
impl_vec_trait ! { [ VectorOrc vec_orc] + 2 c ( orc) }
643
643
644
- // FIXME(vector-enhancements-1) add instr tests for f32
645
- test_impl ! { vec_roundc_f32 ( a: vector_float) -> vector_float [ nearbyint_v4f32, _] }
644
+ test_impl ! { vec_roundc_f32 ( a: vector_float) -> vector_float [ nearbyint_v4f32, "vector-enhancements-1" vfisb] }
646
645
test_impl ! { vec_roundc_f64 ( a: vector_double) -> vector_double [ nearbyint_v2f64, vfidb] }
647
646
648
647
// FIXME(llvm) roundeven does not yet lower to vfidb (but should in the future)
649
648
test_impl ! { vec_round_f32 ( a: vector_float) -> vector_float [ roundeven_v4f32, _] }
650
649
test_impl ! { vec_round_f64 ( a: vector_double) -> vector_double [ roundeven_v2f64, _] }
651
650
652
- test_impl ! { vec_rint_f32 ( a: vector_float) -> vector_float [ rint_v4f32, _ ] }
651
+ test_impl ! { vec_rint_f32 ( a: vector_float) -> vector_float [ rint_v4f32, "vector-enhancements-1" vfisb ] }
653
652
test_impl ! { vec_rint_f64 ( a: vector_double) -> vector_double [ rint_v2f64, vfidb] }
654
653
655
654
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
0 commit comments