Skip to content

Commit

Permalink
Auto merge of #2025 - workingjubilee:fix-nightly-simd, r=RalfJung
Browse files Browse the repository at this point in the history
Fixup renamed fn for Simd

This fixes rust-lang/rust#94910
  • Loading branch information
bors committed Mar 14, 2022
2 parents a12a48b + 61bfa8a commit 7bc0c98
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
258256697b8550860be0f6194dec532ac616c2c1
e95b10ba4ac4564ed25f7eef143e3182c33b3902
76 changes: 38 additions & 38 deletions tests/run-pass/portable-simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 7bc0c98

Please sign in to comment.