From 92259a4a6c20b02e87e0589a286bef7b71cd95a9 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Mon, 10 Apr 2023 00:11:37 -0700 Subject: [PATCH] Clarify elementwise cmp reduces Saying "elementwise (non-)equal" may suggest it returns a vector. The comments should be clear that it instead reduces to a scalar. Co-authored-by: Jacob Lifshay --- crates/core_simd/src/vector.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs index 154b467752b..b7b5e0b002f 100644 --- a/crates/core_simd/src/vector.rs +++ b/crates/core_simd/src/vector.rs @@ -709,7 +709,7 @@ where Mask::from_int_unchecked(tfvec) }; - // Two vectors are equal if they are elementwise equal + // Two vectors are equal if all elements are equal when compared elementwise mask.all() } @@ -722,7 +722,7 @@ where Mask::from_int_unchecked(tfvec) }; - // Two vectors are non-equal if they are elementwise non-equal + // Two vectors are non-equal if any elements are non-equal when compared elementwise mask.any() } }