@@ -1774,6 +1774,17 @@ mod tests {
1774
1774
}
1775
1775
1776
1776
macro_rules! test_vec_1 {
1777
+ { $name: ident, $fn: ident, f32x4, [ $( $a: expr) ,+] , ~[ $( $d: expr) ,+] } => {
1778
+ #[ simd_test( enable = "altivec" ) ]
1779
+ unsafe fn $name( ) {
1780
+ let a: vector_float = transmute( f32x4:: new( $( $a) ,+) ) ;
1781
+
1782
+ let d: vector_float = transmute( f32x4:: new( $( $d) ,+) ) ;
1783
+ let r = transmute( vec_cmple( vec_abs( vec_sub( $fn( a) , d) ) , vec_splats( std:: f32 :: EPSILON ) ) ) ;
1784
+ let e = m32x4:: new( true , true , true , true ) ;
1785
+ assert_eq!( e, r) ;
1786
+ }
1787
+ } ;
1777
1788
{ $name: ident, $fn: ident, $ty: ident, [ $( $a: expr) ,+] , [ $( $d: expr) ,+] } => {
1778
1789
test_vec_1! { $name, $fn, $ty -> $ty, [ $( $a) ,+] , [ $( $d) ,+] }
1779
1790
} ;
@@ -1790,8 +1801,8 @@ mod tests {
1790
1801
}
1791
1802
1792
1803
test_vec_1 ! { test_vec_expte, vec_expte, f32x4,
1793
- [ 0.0 , 2.0 , 4 .0, -1.0 ] ,
1794
- [ 1.0 , 4.0 , 16 .0, 0.5 ]
1804
+ [ 0.0 , 2.0 , 2 .0, -1.0 ] ,
1805
+ ~ [ 1.0 , 4.0 , 4 .0, 0.5 ]
1795
1806
}
1796
1807
1797
1808
test_vec_2 ! { test_vec_cmpgt_i8, vec_cmpgt, i8x16 -> m8x16,
0 commit comments