mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
Fixup renamed fn for Simd
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
258256697b8550860be0f6194dec532ac616c2c1
|
||||
e95b10ba4ac4564ed25f7eef143e3182c33b3902
|
||||
|
||||
@@ -22,27 +22,27 @@ fn simd_ops_f32() {
|
||||
assert_eq!(a.lanes_ge(f32x4::splat(5.0) * b), Mask::from_array([true, true, false, true]));
|
||||
assert_eq!(a.lanes_gt(f32x4::splat(5.0) * b), Mask::from_array([true, false, false, true]));
|
||||
|
||||
assert_eq!(a.horizontal_sum(), 40.0);
|
||||
assert_eq!(b.horizontal_sum(), 2.0);
|
||||
assert_eq!(a.horizontal_product(), 100.0 * 100.0);
|
||||
assert_eq!(b.horizontal_product(), -24.0);
|
||||
assert_eq!(a.horizontal_max(), 10.0);
|
||||
assert_eq!(b.horizontal_max(), 3.0);
|
||||
assert_eq!(a.horizontal_min(), 10.0);
|
||||
assert_eq!(b.horizontal_min(), -4.0);
|
||||
assert_eq!(a.reduce_sum(), 40.0);
|
||||
assert_eq!(b.reduce_sum(), 2.0);
|
||||
assert_eq!(a.reduce_product(), 100.0 * 100.0);
|
||||
assert_eq!(b.reduce_product(), -24.0);
|
||||
assert_eq!(a.reduce_max(), 10.0);
|
||||
assert_eq!(b.reduce_max(), 3.0);
|
||||
assert_eq!(a.reduce_min(), 10.0);
|
||||
assert_eq!(b.reduce_min(), -4.0);
|
||||
|
||||
assert_eq!(
|
||||
f32x2::from_array([0.0, f32::NAN]).max(f32x2::from_array([f32::NAN, 0.0])),
|
||||
f32x2::from_array([0.0, 0.0])
|
||||
);
|
||||
assert_eq!(f32x2::from_array([0.0, f32::NAN]).horizontal_max(), 0.0);
|
||||
assert_eq!(f32x2::from_array([f32::NAN, 0.0]).horizontal_max(), 0.0);
|
||||
assert_eq!(f32x2::from_array([0.0, f32::NAN]).reduce_max(), 0.0);
|
||||
assert_eq!(f32x2::from_array([f32::NAN, 0.0]).reduce_max(), 0.0);
|
||||
assert_eq!(
|
||||
f32x2::from_array([0.0, f32::NAN]).min(f32x2::from_array([f32::NAN, 0.0])),
|
||||
f32x2::from_array([0.0, 0.0])
|
||||
);
|
||||
assert_eq!(f32x2::from_array([0.0, f32::NAN]).horizontal_min(), 0.0);
|
||||
assert_eq!(f32x2::from_array([f32::NAN, 0.0]).horizontal_min(), 0.0);
|
||||
assert_eq!(f32x2::from_array([0.0, f32::NAN]).reduce_min(), 0.0);
|
||||
assert_eq!(f32x2::from_array([f32::NAN, 0.0]).reduce_min(), 0.0);
|
||||
}
|
||||
|
||||
fn simd_ops_f64() {
|
||||
@@ -66,27 +66,27 @@ fn simd_ops_f64() {
|
||||
assert_eq!(a.lanes_ge(f64x4::splat(5.0) * b), Mask::from_array([true, true, false, true]));
|
||||
assert_eq!(a.lanes_gt(f64x4::splat(5.0) * b), Mask::from_array([true, false, false, true]));
|
||||
|
||||
assert_eq!(a.horizontal_sum(), 40.0);
|
||||
assert_eq!(b.horizontal_sum(), 2.0);
|
||||
assert_eq!(a.horizontal_product(), 100.0 * 100.0);
|
||||
assert_eq!(b.horizontal_product(), -24.0);
|
||||
assert_eq!(a.horizontal_max(), 10.0);
|
||||
assert_eq!(b.horizontal_max(), 3.0);
|
||||
assert_eq!(a.horizontal_min(), 10.0);
|
||||
assert_eq!(b.horizontal_min(), -4.0);
|
||||
assert_eq!(a.reduce_sum(), 40.0);
|
||||
assert_eq!(b.reduce_sum(), 2.0);
|
||||
assert_eq!(a.reduce_product(), 100.0 * 100.0);
|
||||
assert_eq!(b.reduce_product(), -24.0);
|
||||
assert_eq!(a.reduce_max(), 10.0);
|
||||
assert_eq!(b.reduce_max(), 3.0);
|
||||
assert_eq!(a.reduce_min(), 10.0);
|
||||
assert_eq!(b.reduce_min(), -4.0);
|
||||
|
||||
assert_eq!(
|
||||
f64x2::from_array([0.0, f64::NAN]).max(f64x2::from_array([f64::NAN, 0.0])),
|
||||
f64x2::from_array([0.0, 0.0])
|
||||
);
|
||||
assert_eq!(f64x2::from_array([0.0, f64::NAN]).horizontal_max(), 0.0);
|
||||
assert_eq!(f64x2::from_array([f64::NAN, 0.0]).horizontal_max(), 0.0);
|
||||
assert_eq!(f64x2::from_array([0.0, f64::NAN]).reduce_max(), 0.0);
|
||||
assert_eq!(f64x2::from_array([f64::NAN, 0.0]).reduce_max(), 0.0);
|
||||
assert_eq!(
|
||||
f64x2::from_array([0.0, f64::NAN]).min(f64x2::from_array([f64::NAN, 0.0])),
|
||||
f64x2::from_array([0.0, 0.0])
|
||||
);
|
||||
assert_eq!(f64x2::from_array([0.0, f64::NAN]).horizontal_min(), 0.0);
|
||||
assert_eq!(f64x2::from_array([f64::NAN, 0.0]).horizontal_min(), 0.0);
|
||||
assert_eq!(f64x2::from_array([0.0, f64::NAN]).reduce_min(), 0.0);
|
||||
assert_eq!(f64x2::from_array([f64::NAN, 0.0]).reduce_min(), 0.0);
|
||||
}
|
||||
|
||||
fn simd_ops_i32() {
|
||||
@@ -137,21 +137,21 @@ fn simd_ops_i32() {
|
||||
assert_eq!(a.lanes_ge(i32x4::splat(5) * b), Mask::from_array([true, true, false, true]));
|
||||
assert_eq!(a.lanes_gt(i32x4::splat(5) * b), Mask::from_array([true, false, false, true]));
|
||||
|
||||
assert_eq!(a.horizontal_sum(), 40);
|
||||
assert_eq!(b.horizontal_sum(), 2);
|
||||
assert_eq!(a.horizontal_product(), 100 * 100);
|
||||
assert_eq!(b.horizontal_product(), -24);
|
||||
assert_eq!(a.horizontal_max(), 10);
|
||||
assert_eq!(b.horizontal_max(), 3);
|
||||
assert_eq!(a.horizontal_min(), 10);
|
||||
assert_eq!(b.horizontal_min(), -4);
|
||||
assert_eq!(a.reduce_sum(), 40);
|
||||
assert_eq!(b.reduce_sum(), 2);
|
||||
assert_eq!(a.reduce_product(), 100 * 100);
|
||||
assert_eq!(b.reduce_product(), -24);
|
||||
assert_eq!(a.reduce_max(), 10);
|
||||
assert_eq!(b.reduce_max(), 3);
|
||||
assert_eq!(a.reduce_min(), 10);
|
||||
assert_eq!(b.reduce_min(), -4);
|
||||
|
||||
assert_eq!(a.horizontal_and(), 10);
|
||||
assert_eq!(b.horizontal_and(), 0);
|
||||
assert_eq!(a.horizontal_or(), 10);
|
||||
assert_eq!(b.horizontal_or(), -1);
|
||||
assert_eq!(a.horizontal_xor(), 0);
|
||||
assert_eq!(b.horizontal_xor(), -4);
|
||||
assert_eq!(a.reduce_and(), 10);
|
||||
assert_eq!(b.reduce_and(), 0);
|
||||
assert_eq!(a.reduce_or(), 10);
|
||||
assert_eq!(b.reduce_or(), -1);
|
||||
assert_eq!(a.reduce_xor(), 0);
|
||||
assert_eq!(b.reduce_xor(), -4);
|
||||
}
|
||||
|
||||
fn simd_mask() {
|
||||
|
||||
Reference in New Issue
Block a user