From 7bca4d72938a96abd493438e8ca0e1423ea5f20b Mon Sep 17 00:00:00 2001 From: James Price Date: Mon, 13 Mar 2023 19:05:16 +0000 Subject: [PATCH] tint: Remove constant::Value::AllEqual() The only uses of this method were to check for splats when emitting vector constants in some backends, and they can just check for constant::Splat instead. Change-Id: I12f5ecdd4a7c1191a3a516d4fd3f349230e42631 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122803 Commit-Queue: James Price Reviewed-by: Ben Clayton Kokoro: Kokoro --- src/tint/constant/composite.h | 3 - src/tint/constant/composite_test.cc | 14 - src/tint/constant/scalar.h | 3 - src/tint/constant/scalar_test.cc | 66 ----- src/tint/constant/splat.h | 2 - src/tint/constant/splat_test.cc | 16 -- src/tint/constant/value.h | 3 - .../resolver/const_eval_construction_test.cc | 256 ------------------ .../resolver/const_eval_conversion_test.cc | 34 --- src/tint/resolver/const_eval_indexing_test.cc | 22 -- .../resolver/const_eval_member_access_test.cc | 6 - src/tint/sem/value_expression_test.cc | 1 - src/tint/writer/glsl/generator_impl.cc | 4 +- src/tint/writer/hlsl/generator_impl.cc | 4 +- src/tint/writer/msl/generator_impl.cc | 4 +- 15 files changed, 6 insertions(+), 432 deletions(-) diff --git a/src/tint/constant/composite.h b/src/tint/constant/composite.h index 5bfa2cb658..ef7233c5a3 100644 --- a/src/tint/constant/composite.h +++ b/src/tint/constant/composite.h @@ -55,9 +55,6 @@ class Composite : public Castable { /// @copydoc Value::AnyZero() bool AnyZero() const override { return any_zero; } - /// @copydoc Value::AllEqual() - bool AllEqual() const override { return false; } - /// @copydoc Value::Hash() size_t Hash() const override { return hash; } diff --git a/src/tint/constant/composite_test.cc b/src/tint/constant/composite_test.cc index 6fc532d0e3..fd083db7a0 100644 --- a/src/tint/constant/composite_test.cc +++ b/src/tint/constant/composite_test.cc @@ -56,20 +56,6 @@ TEST_F(ConstantTest_Composite, AnyZero) { EXPECT_FALSE(compositeNone->AnyZero()); } -TEST_F(ConstantTest_Composite, AllEqual) { - auto* f32 = create(); - - auto* fPos0 = create>(f32, 0_f); - auto* fNeg0 = create>(f32, -0_f); - auto* fPos1 = create>(f32, 1_f); - - auto* compositeEq = create(f32, utils::Vector{fPos0, fPos0}); - auto* compositeNe = create(f32, utils::Vector{fNeg0, fPos1, fPos0}); - - EXPECT_TRUE(compositeEq->AllEqual()); - EXPECT_FALSE(compositeNe->AllZero()); -} - TEST_F(ConstantTest_Composite, Index) { auto* f32 = create(); diff --git a/src/tint/constant/scalar.h b/src/tint/constant/scalar.h index 2a6f6a79fb..fc6aef06de 100644 --- a/src/tint/constant/scalar.h +++ b/src/tint/constant/scalar.h @@ -55,9 +55,6 @@ class Scalar : public Castable, Value> { /// @copydoc Value::AnyZero() bool AnyZero() const override { return IsPositiveZero(); } - /// @copydoc Value::AllEqual() - bool AllEqual() const override { return true; } - /// @copydoc Value::Hash() size_t Hash() const override { return utils::Hash(type, ValueOf()); } diff --git a/src/tint/constant/scalar_test.cc b/src/tint/constant/scalar_test.cc index e05cca0f52..6dedf75b5f 100644 --- a/src/tint/constant/scalar_test.cc +++ b/src/tint/constant/scalar_test.cc @@ -155,72 +155,6 @@ TEST_F(ConstantTest_Scalar, AnyZero) { EXPECT_FALSE(aiNeg1->AnyZero()); } -TEST_F(ConstantTest_Scalar, AllEqual) { - auto* i32 = create(); - auto* u32 = create(); - auto* f16 = create(); - auto* f32 = create(); - auto* bool_ = create(); - - auto* i0 = create>(i32, 0_i); - auto* iPos1 = create>(i32, 1_i); - auto* iNeg1 = create>(i32, -1_i); - - auto* u0 = create>(u32, 0_u); - auto* u1 = create>(u32, 1_u); - - auto* fPos0 = create>(f32, 0_f); - auto* fNeg0 = create>(f32, -0_f); - auto* fPos1 = create>(f32, 1_f); - auto* fNeg1 = create>(f32, -1_f); - - auto* f16Pos0 = create>(f16, 0_h); - auto* f16Neg0 = create>(f16, -0_h); - auto* f16Pos1 = create>(f16, 1_h); - auto* f16Neg1 = create>(f16, -1_h); - - auto* bf = create>(bool_, false); - auto* bt = create>(bool_, true); - - auto* afPos0 = create>(f32, 0.0_a); - auto* afNeg0 = create>(f32, -0.0_a); - auto* afPos1 = create>(f32, 1.0_a); - auto* afNeg1 = create>(f32, -1.0_a); - - auto* ai0 = create>(i32, 0_a); - auto* aiPos1 = create>(i32, 1_a); - auto* aiNeg1 = create>(i32, -1_a); - - EXPECT_TRUE(i0->AllEqual()); - EXPECT_TRUE(iPos1->AllEqual()); - EXPECT_TRUE(iNeg1->AllEqual()); - - EXPECT_TRUE(u0->AllEqual()); - EXPECT_TRUE(u1->AllEqual()); - - EXPECT_TRUE(fPos0->AllEqual()); - EXPECT_TRUE(fNeg0->AllEqual()); - EXPECT_TRUE(fPos1->AllEqual()); - EXPECT_TRUE(fNeg1->AllEqual()); - - EXPECT_TRUE(f16Pos0->AllEqual()); - EXPECT_TRUE(f16Neg0->AllEqual()); - EXPECT_TRUE(f16Pos1->AllEqual()); - EXPECT_TRUE(f16Neg1->AllEqual()); - - EXPECT_TRUE(bf->AllEqual()); - EXPECT_TRUE(bt->AllEqual()); - - EXPECT_TRUE(afPos0->AllEqual()); - EXPECT_TRUE(afNeg0->AllEqual()); - EXPECT_TRUE(afPos1->AllEqual()); - EXPECT_TRUE(afNeg1->AllEqual()); - - EXPECT_TRUE(ai0->AllEqual()); - EXPECT_TRUE(aiPos1->AllEqual()); - EXPECT_TRUE(aiNeg1->AllEqual()); -} - TEST_F(ConstantTest_Scalar, ValueOf) { auto* i32 = create(); auto* u32 = create(); diff --git a/src/tint/constant/splat.h b/src/tint/constant/splat.h index 480512424a..a496235d32 100644 --- a/src/tint/constant/splat.h +++ b/src/tint/constant/splat.h @@ -50,8 +50,6 @@ class Splat : public Castable { bool AllZero() const override { return el->AllZero(); } /// @returns true if the element is zero bool AnyZero() const override { return el->AnyZero(); } - /// @returns true - bool AllEqual() const override { return true; } /// @returns the hash for the splat size_t Hash() const override { return utils::Hash(type, el->Hash(), count); } diff --git a/src/tint/constant/splat_test.cc b/src/tint/constant/splat_test.cc index 5c897cb790..fe8aeda090 100644 --- a/src/tint/constant/splat_test.cc +++ b/src/tint/constant/splat_test.cc @@ -56,22 +56,6 @@ TEST_F(ConstantTest_Splat, AnyZero) { EXPECT_FALSE(SpfPos1->AnyZero()); } -TEST_F(ConstantTest_Splat, AllEqual) { - auto* f32 = create(); - - auto* fPos0 = create>(f32, 0_f); - auto* fNeg0 = create>(f32, -0_f); - auto* fPos1 = create>(f32, 1_f); - - auto* SpfPos0 = create(f32, fPos0, 2); - auto* SpfNeg0 = create(f32, fNeg0, 2); - auto* SpfPos1 = create(f32, fPos1, 2); - - EXPECT_TRUE(SpfPos0->AllEqual()); - EXPECT_TRUE(SpfNeg0->AllEqual()); - EXPECT_TRUE(SpfPos1->AllEqual()); -} - TEST_F(ConstantTest_Splat, Index) { auto* f32 = create(); diff --git a/src/tint/constant/value.h b/src/tint/constant/value.h index 594091dfec..eb29998fcc 100644 --- a/src/tint/constant/value.h +++ b/src/tint/constant/value.h @@ -56,9 +56,6 @@ class Value : public Castable { /// @returns true if any child elements are positive-zero valued. virtual bool AnyZero() const = 0; - /// @returns true if all child elements have the same value and type. - virtual bool AllEqual() const = 0; - /// @returns a hash of the value. virtual size_t Hash() const = 0; diff --git a/src/tint/resolver/const_eval_construction_test.cc b/src/tint/resolver/const_eval_construction_test.cc index 55c2cf5584..e98d21f7e1 100644 --- a/src/tint/resolver/const_eval_construction_test.cc +++ b/src/tint/resolver/const_eval_construction_test.cc @@ -30,7 +30,6 @@ TEST_F(ResolverConstEvalTest, Scalar_AFloat) { ASSERT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 99.0f); @@ -47,7 +46,6 @@ TEST_F(ResolverConstEvalTest, Scalar_AInt) { ASSERT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 99); @@ -63,7 +61,6 @@ TEST_F(ResolverConstEvalTest, Scalar_i32) { ASSERT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 99); @@ -79,7 +76,6 @@ TEST_F(ResolverConstEvalTest, Scalar_u32) { ASSERT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 99u); @@ -95,7 +91,6 @@ TEST_F(ResolverConstEvalTest, Scalar_f32) { ASSERT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs().value, 9.9f); @@ -113,7 +108,6 @@ TEST_F(ResolverConstEvalTest, Scalar_f16) { EXPECT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); // 9.9 is not exactly representable by f16, and should be quantized to 9.8984375 @@ -130,7 +124,6 @@ TEST_F(ResolverConstEvalTest, Scalar_bool) { ASSERT_NE(sem, nullptr); EXPECT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), true); @@ -158,7 +151,6 @@ TEST_P(ResolverConstEvalZeroInitTest, Test) { auto* sem = Sem().Get(expr); ASSERT_NE(sem, nullptr); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); @@ -167,18 +159,15 @@ TEST_P(ResolverConstEvalZeroInitTest, Test) { EXPECT_EQ(sem->ConstantValue()->ValueAs(), 0.0f); } else if (auto* vec = sem->Type()->As()) { for (size_t i = 0; i < vec->Width(); ++i) { - EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(i)->ValueAs(), 0.0f); } } else if (auto* mat = sem->Type()->As()) { for (size_t i = 0; i < mat->columns(); ++i) { - EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllZero()); for (size_t j = 0; j < mat->rows(); ++j) { - EXPECT_TRUE(sem->ConstantValue()->Index(i)->Index(j)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->Index(j)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->Index(j)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(i)->Index(j)->ValueAs(), 0.0f); @@ -186,7 +175,6 @@ TEST_P(ResolverConstEvalZeroInitTest, Test) { } } else if (auto* arr = sem->Type()->As()) { for (size_t i = 0; i < *(arr->ConstantCount()); ++i) { - EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(i)->ValueAs(), 0.0f); @@ -229,21 +217,17 @@ TEST_F(ResolverConstEvalTest, Vec3_ZeroInit_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0); @@ -262,21 +246,17 @@ TEST_F(ResolverConstEvalTest, Vec3_ZeroInit_u32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0u); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0u); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0u); @@ -295,21 +275,17 @@ TEST_F(ResolverConstEvalTest, Vec3_ZeroInit_f32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0._a); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0._a); @@ -330,21 +306,17 @@ TEST_F(ResolverConstEvalTest, Vec3_ZeroInit_f16) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0._a); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0._a); @@ -363,21 +335,17 @@ TEST_F(ResolverConstEvalTest, Vec3_ZeroInit_bool) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), false); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), false); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), false); @@ -396,21 +364,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Splat_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 99); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 99); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 99); @@ -429,21 +393,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Splat_u32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 99u); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 99u); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 99u); @@ -462,21 +422,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Splat_f32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 9.9f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 9.9f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 9.9f); @@ -497,22 +453,18 @@ TEST_F(ResolverConstEvalTest, Vec3_Splat_f16) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); // 9.9 is not exactly representable by f16, and should be quantized to 9.8984375 - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 9.8984375f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 9.8984375f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 9.8984375f); @@ -531,21 +483,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Splat_bool) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), true); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), true); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), true); @@ -565,21 +513,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_AInt) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3); @@ -599,21 +543,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_AFloat) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1.0f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2.0f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3.0f); @@ -632,21 +572,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3); @@ -665,21 +601,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_u32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3); @@ -698,21 +630,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_f32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1.f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2.f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3.f); @@ -733,21 +661,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_f16) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1.f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2.f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3.f); @@ -766,21 +690,17 @@ TEST_F(ResolverConstEvalTest, Vec3_FullConstruct_bool) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), true); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), false); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), true); @@ -799,21 +719,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3); @@ -832,21 +748,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_u32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3); @@ -865,21 +777,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1.f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2.f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3.f); @@ -898,21 +806,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f32_all_10) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 10_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 10_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 10_f); @@ -931,21 +835,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f32_all_positive_0) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0_f); @@ -964,21 +864,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f32_all_negative_0) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), -0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), -0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), -0_f); @@ -997,21 +893,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f32_mixed_sign_0) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), -0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0_f); @@ -1032,21 +924,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f16) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1.f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2.f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3.f); @@ -1067,21 +955,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f16_all_10) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 10_h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 10_h); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 10_h); @@ -1102,21 +986,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f16_all_positive_0) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0_h); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0_h); @@ -1137,21 +1017,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f16_all_negative_0) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), -0_h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), -0_h); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), -0_h); @@ -1172,21 +1048,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_f16_mixed_sign_0) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), -0_h); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0_h); @@ -1205,21 +1077,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_bool) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), true); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), false); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), true); @@ -1238,21 +1106,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_all_true) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), true); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), true); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), true); @@ -1271,21 +1135,17 @@ TEST_F(ResolverConstEvalTest, Vec3_MixConstruct_all_false) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), false); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), false); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), false); @@ -1305,36 +1165,29 @@ TEST_F(ResolverConstEvalTest, Mat2x3_ZeroInit_f32) { EXPECT_EQ(mat->columns(), 2u); EXPECT_EQ(mat->rows(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(2)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(2)->ValueAs(), 0._f); @@ -1356,36 +1209,29 @@ TEST_F(ResolverConstEvalTest, Mat2x3_ZeroInit_f16) { EXPECT_EQ(mat->columns(), 2u); EXPECT_EQ(mat->rows(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(2)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(2)->ValueAs(), 0._h); @@ -1405,36 +1251,29 @@ TEST_F(ResolverConstEvalTest, Mat3x2_Construct_Scalars_af) { EXPECT_EQ(mat->columns(), 3u); EXPECT_EQ(mat->rows(), 2u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 1._a); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 2._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 3._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 4._a); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(0)->ValueAs(), 5._a); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(1)->ValueAs(), 6._a); @@ -1457,36 +1296,29 @@ TEST_F(ResolverConstEvalTest, Mat3x2_Construct_Columns_af) { EXPECT_EQ(mat->columns(), 3u); EXPECT_EQ(mat->rows(), 2u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 1._a); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 2._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 3._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 4._a); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(0)->ValueAs(), 5._a); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(1)->ValueAs(), 6._a); @@ -1504,26 +1336,21 @@ TEST_F(ResolverConstEvalTest, Array_i32_Zero) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(3)->ValueAs(), 0_i); @@ -1541,26 +1368,21 @@ TEST_F(ResolverConstEvalTest, Array_f32_Zero) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(3)->ValueAs(), 0_f); @@ -1578,36 +1400,29 @@ TEST_F(ResolverConstEvalTest, Array_vec3_f32_Zero) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(2)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(2)->ValueAs(), 0_f); @@ -1629,26 +1444,21 @@ TEST_F(ResolverConstEvalTest, Array_Struct_f32_Zero) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 0_f); @@ -1666,26 +1476,21 @@ TEST_F(ResolverConstEvalTest, Array_i32_Elements) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 10_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 20_i); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 30_i); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(3)->ValueAs(), 40_i); @@ -1765,17 +1570,13 @@ TEST_F(ResolverConstEvalTest, ArrayInit_Nested_f32) { EXPECT_TRUE(outer_arr->ElemType()->As()->ElemType()->Is()); auto* arr = sem->ConstantValue(); - EXPECT_FALSE(arr->AllEqual()); EXPECT_FALSE(arr->AnyZero()); EXPECT_FALSE(arr->AllZero()); - EXPECT_FALSE(arr->Index(0)->AllEqual()); EXPECT_FALSE(arr->Index(0)->AnyZero()); EXPECT_FALSE(arr->Index(0)->AllZero()); - EXPECT_FALSE(arr->Index(1)->AllEqual()); EXPECT_FALSE(arr->Index(1)->AnyZero()); EXPECT_FALSE(arr->Index(1)->AllZero()); - EXPECT_FALSE(arr->Index(2)->AllEqual()); EXPECT_FALSE(arr->Index(2)->AnyZero()); EXPECT_FALSE(arr->Index(2)->AllZero()); @@ -1799,26 +1600,21 @@ TEST_F(ResolverConstEvalTest, Array_f32_Elements) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 10_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 20_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 30_f); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(3)->ValueAs(), 40_f); @@ -1837,7 +1633,6 @@ TEST_F(ResolverConstEvalTest, Array_vec3_f32_Elements) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 1_f); @@ -1866,26 +1661,21 @@ TEST_F(ResolverConstEvalTest, Array_Struct_f32_Elements) { ASSERT_NE(arr, nullptr); EXPECT_TRUE(arr->ElemType()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 1_f); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 2_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(0)->ValueAs(), 3_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 4_f); @@ -1914,7 +1704,6 @@ TEST_F(ResolverConstEvalTest, Struct_ZeroInit) { EXPECT_EQ(str->Members().Length(), 5u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); @@ -1930,7 +1719,6 @@ TEST_F(ResolverConstEvalTest, Struct_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(4)->ValueAs(), false); for (size_t i = 0; i < str->Members().Length(); ++i) { - EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(i)->AllZero()); } @@ -1962,12 +1750,10 @@ TEST_F(ResolverConstEvalTest, Struct_Nested_ZeroInit) { ASSERT_NE(str, nullptr); EXPECT_EQ(str->Members().Length(), 1u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); auto* inner_struct = sem->ConstantValue()->Index(0); - EXPECT_FALSE(inner_struct->AllEqual()); EXPECT_TRUE(inner_struct->AnyZero()); EXPECT_TRUE(inner_struct->AllZero()); @@ -1983,7 +1769,6 @@ TEST_F(ResolverConstEvalTest, Struct_Nested_ZeroInit) { EXPECT_EQ(inner_struct->Index(4)->ValueAs(), false); for (size_t i = 0; i < str->Members().Length(); ++i) { - EXPECT_TRUE(inner_struct->Index(i)->AllEqual()); EXPECT_TRUE(inner_struct->Index(i)->AnyZero()); EXPECT_TRUE(inner_struct->Index(i)->AllZero()); } @@ -2004,23 +1789,19 @@ TEST_F(ResolverConstEvalTest, Struct_I32s_ZeroInit) { EXPECT_EQ(str->Members().Length(), 3u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->Type()->Is()); @@ -2049,35 +1830,29 @@ TEST_F(ResolverConstEvalTest, Struct_MixedScalars_ZeroInit) { EXPECT_EQ(str->Members().Length(), 5u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 0_u); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(3)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->Type()->Is()); @@ -2102,11 +1877,9 @@ TEST_F(ResolverConstEvalTest, Struct_VectorF32s_ZeroInit) { EXPECT_EQ(str->Members().Length(), 3u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); @@ -2116,7 +1889,6 @@ TEST_F(ResolverConstEvalTest, Struct_VectorF32s_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0._f); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(2)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); @@ -2126,7 +1898,6 @@ TEST_F(ResolverConstEvalTest, Struct_VectorF32s_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 0._f); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(2)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->Type()->Is()); @@ -2159,11 +1930,9 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_ZeroInit) { EXPECT_EQ(str->Members().Length(), 5u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); @@ -2172,7 +1941,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 0_i); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); @@ -2182,7 +1950,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 0_u); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(2)->ValueAs(), 0_u); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->Type()->Is()); @@ -2193,7 +1960,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(2)->ValueAs(), 0._f); EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(3)->ValueAs(), 0._f); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->Type()->Is()); @@ -2203,7 +1969,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(1)->ValueAs(), 0._h); EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(2)->ValueAs(), 0._h); - EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->Type()->Is()); @@ -2236,11 +2001,9 @@ TEST_F(ResolverConstEvalTest, Struct_Struct_ZeroInit) { EXPECT_EQ(str->Members().Length(), 2u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->AllZero()); - EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); @@ -2248,7 +2011,6 @@ TEST_F(ResolverConstEvalTest, Struct_Struct_ZeroInit) { EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0_u); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(2)->ValueAs(), 0_f); - EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); @@ -2279,35 +2041,29 @@ TEST_F(ResolverConstEvalTest, Struct_MixedScalars_Construct) { EXPECT_EQ(str->Members().Length(), 5u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2_u); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3._f); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(3)->ValueAs(), 4._h); - EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->Type()->Is()); @@ -2337,11 +2093,9 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_Construct) { EXPECT_EQ(str->Members().Length(), 5u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); @@ -2350,7 +2104,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_Construct) { EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 1_i); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 1_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); @@ -2360,7 +2113,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_Construct) { EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(1)->ValueAs(), 2_u); EXPECT_EQ(sem->ConstantValue()->Index(1)->Index(2)->ValueAs(), 2_u); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->Type()->Is()); @@ -2371,7 +2123,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_Construct) { EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(2)->ValueAs(), 3._f); EXPECT_EQ(sem->ConstantValue()->Index(2)->Index(3)->ValueAs(), 3._f); - EXPECT_TRUE(sem->ConstantValue()->Index(3)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(3)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(3)->Type()->Is()); @@ -2381,7 +2132,6 @@ TEST_F(ResolverConstEvalTest, Struct_MixedVectors_Construct) { EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(1)->ValueAs(), 4._h); EXPECT_EQ(sem->ConstantValue()->Index(3)->Index(2)->ValueAs(), 4._h); - EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(4)->Type()->Is()); @@ -2415,11 +2165,9 @@ TEST_F(ResolverConstEvalTest, Struct_Struct_Construct) { EXPECT_EQ(str->Members().Length(), 2u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); @@ -2427,7 +2175,6 @@ TEST_F(ResolverConstEvalTest, Struct_Struct_Construct) { EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 2_u); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(2)->ValueAs(), 3_f); - EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); @@ -2454,18 +2201,15 @@ TEST_F(ResolverConstEvalTest, Struct_Array_Construct) { EXPECT_EQ(str->Members().Length(), 2u); ASSERT_NE(sem->ConstantValue(), nullptr); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->Type()->Is()); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(0)->ValueAs(), 1_i); EXPECT_EQ(sem->ConstantValue()->Index(0)->Index(1)->ValueAs(), 2_i); - EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->Type()->Is()); diff --git a/src/tint/resolver/const_eval_conversion_test.cc b/src/tint/resolver/const_eval_conversion_test.cc index 331eb9207a..350afb2226 100644 --- a/src/tint/resolver/const_eval_conversion_test.cc +++ b/src/tint/resolver/const_eval_conversion_test.cc @@ -236,21 +236,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_f32_to_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3); @@ -269,21 +265,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_u32_to_f32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 10.f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 20.f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 30.f); @@ -304,21 +296,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_f16_to_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 1_i); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 2_i); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 3_i); @@ -339,21 +327,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_u32_to_f16) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 10.f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 20.f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 30.f); @@ -372,21 +356,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_Large_f32_to_i32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), i32::Highest()); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), i32::Lowest()); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), i32::Highest()); @@ -405,21 +385,17 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_Large_f32_to_u32) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), u32::Highest()); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), u32::Lowest()); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), u32::Highest()); @@ -450,23 +426,19 @@ TEST_F(ResolverConstEvalTest, Vec3_Convert_Small_f32_to_f16) { EXPECT_TRUE(vec->type()->Is()); EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_FALSE(sem->ConstantValue()->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 0.0); EXPECT_FALSE(std::signbit(sem->ConstantValue()->Index(0)->ValueAs().value)); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), -0.0); EXPECT_TRUE(std::signbit(sem->ConstantValue()->Index(1)->ValueAs().value)); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 0.0); @@ -487,17 +459,14 @@ TEST_F(ResolverConstEvalTest, StructAbstractSplat_to_StructDifferentTypes) { auto* c = Sem().Get(expr_c); ASSERT_NE(c, nullptr); EXPECT_TRUE(c->ConstantValue()->Is()); - EXPECT_TRUE(c->ConstantValue()->AllEqual()); EXPECT_TRUE(c->ConstantValue()->AnyZero()); EXPECT_TRUE(c->ConstantValue()->AllZero()); - EXPECT_TRUE(c->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(c->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(c->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(c->ConstantValue()->Index(0)->Type()->Is()); EXPECT_EQ(c->ConstantValue()->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(c->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(c->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(c->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(c->ConstantValue()->Index(1)->Type()->Is()); @@ -507,17 +476,14 @@ TEST_F(ResolverConstEvalTest, StructAbstractSplat_to_StructDifferentTypes) { ASSERT_NE(v, nullptr); EXPECT_TRUE(v->Is()); EXPECT_TRUE(v->ConstantValue()->Is()); - EXPECT_TRUE(v->ConstantValue()->AllEqual()); EXPECT_TRUE(v->ConstantValue()->AnyZero()); EXPECT_TRUE(v->ConstantValue()->AllZero()); - EXPECT_TRUE(v->ConstantValue()->Index(0)->AllEqual()); EXPECT_TRUE(v->ConstantValue()->Index(0)->AnyZero()); EXPECT_TRUE(v->ConstantValue()->Index(0)->AllZero()); EXPECT_TRUE(v->ConstantValue()->Index(0)->Type()->Is()); EXPECT_EQ(v->ConstantValue()->Index(0)->ValueAs(), 0_f); - EXPECT_TRUE(v->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(v->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(v->ConstantValue()->Index(1)->AllZero()); EXPECT_TRUE(v->ConstantValue()->Index(1)->Type()->Is()); diff --git a/src/tint/resolver/const_eval_indexing_test.cc b/src/tint/resolver/const_eval_indexing_test.cc index 4d8c8cb216..d311d30b34 100644 --- a/src/tint/resolver/const_eval_indexing_test.cc +++ b/src/tint/resolver/const_eval_indexing_test.cc @@ -29,7 +29,6 @@ TEST_F(ResolverConstEvalTest, Vec3_Index) { ASSERT_NE(sem, nullptr); ASSERT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 3_i); @@ -133,7 +132,6 @@ TEST_F(ResolverConstEvalTest, Vec3_Swizzle_Scalar) { ASSERT_NE(sem, nullptr); ASSERT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 2_i); @@ -152,12 +150,10 @@ TEST_F(ResolverConstEvalTest, Vec3_Swizzle_Vector) { EXPECT_EQ(vec->Width(), 2u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 3._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 1._a); @@ -174,7 +170,6 @@ TEST_F(ResolverConstEvalTest, Vec3_Swizzle_Chain) { ASSERT_NE(sem, nullptr); ASSERT_TRUE(sem->Type()->Is()); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->AllZero()); EXPECT_EQ(sem->ConstantValue()->ValueAs(), 2_i); @@ -194,12 +189,10 @@ TEST_F(ResolverConstEvalTest, Mat3x2_Index) { EXPECT_EQ(vec->Width(), 2u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 5._a); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 6._a); @@ -241,17 +234,14 @@ TEST_F(ResolverConstEvalTest, Array_vec3_f32_Index) { EXPECT_EQ(vec->Width(), 3u); EXPECT_TYPE(sem->ConstantValue()->Type(), sem->Type()); - EXPECT_TRUE(sem->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(0)->ValueAs(), 4_f); - EXPECT_TRUE(sem->ConstantValue()->Index(1)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(1)->ValueAs(), 5_f); - EXPECT_TRUE(sem->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(sem->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(sem->ConstantValue()->Index(2)->ValueAs(), 6_f); @@ -310,36 +300,29 @@ TEST_F(ResolverConstEvalTest, ChainedIndex) { EXPECT_EQ(ty->columns(), 2u); EXPECT_EQ(ty->rows(), 3u); EXPECT_EQ(mat->ConstantValue()->Type(), mat->Type()); - EXPECT_FALSE(mat->ConstantValue()->AllEqual()); EXPECT_TRUE(mat->ConstantValue()->AnyZero()); EXPECT_FALSE(mat->ConstantValue()->AllZero()); - EXPECT_TRUE(mat->ConstantValue()->Index(0)->Index(0)->AllEqual()); EXPECT_FALSE(mat->ConstantValue()->Index(0)->Index(0)->AnyZero()); EXPECT_FALSE(mat->ConstantValue()->Index(0)->Index(0)->AllZero()); EXPECT_EQ(mat->ConstantValue()->Index(0)->Index(0)->ValueAs(), 7_f); - EXPECT_TRUE(mat->ConstantValue()->Index(0)->Index(1)->AllEqual()); EXPECT_TRUE(mat->ConstantValue()->Index(0)->Index(1)->AnyZero()); EXPECT_TRUE(mat->ConstantValue()->Index(0)->Index(1)->AllZero()); EXPECT_EQ(mat->ConstantValue()->Index(0)->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(mat->ConstantValue()->Index(0)->Index(2)->AllEqual()); EXPECT_FALSE(mat->ConstantValue()->Index(0)->Index(2)->AnyZero()); EXPECT_FALSE(mat->ConstantValue()->Index(0)->Index(2)->AllZero()); EXPECT_EQ(mat->ConstantValue()->Index(0)->Index(2)->ValueAs(), 9_f); - EXPECT_TRUE(mat->ConstantValue()->Index(1)->Index(0)->AllEqual()); EXPECT_FALSE(mat->ConstantValue()->Index(1)->Index(0)->AnyZero()); EXPECT_FALSE(mat->ConstantValue()->Index(1)->Index(0)->AllZero()); EXPECT_EQ(mat->ConstantValue()->Index(1)->Index(0)->ValueAs(), 10_f); - EXPECT_TRUE(mat->ConstantValue()->Index(1)->Index(1)->AllEqual()); EXPECT_FALSE(mat->ConstantValue()->Index(1)->Index(1)->AnyZero()); EXPECT_FALSE(mat->ConstantValue()->Index(1)->Index(1)->AllZero()); EXPECT_EQ(mat->ConstantValue()->Index(1)->Index(1)->ValueAs(), 11_f); - EXPECT_TRUE(mat->ConstantValue()->Index(1)->Index(2)->AllEqual()); EXPECT_FALSE(mat->ConstantValue()->Index(1)->Index(2)->AnyZero()); EXPECT_FALSE(mat->ConstantValue()->Index(1)->Index(2)->AllZero()); EXPECT_EQ(mat->ConstantValue()->Index(1)->Index(2)->ValueAs(), 12_f); @@ -352,21 +335,17 @@ TEST_F(ResolverConstEvalTest, ChainedIndex) { EXPECT_TRUE(ty->type()->Is()); EXPECT_EQ(ty->Width(), 3u); EXPECT_EQ(vec->ConstantValue()->Type(), vec->Type()); - EXPECT_FALSE(vec->ConstantValue()->AllEqual()); EXPECT_TRUE(vec->ConstantValue()->AnyZero()); EXPECT_FALSE(vec->ConstantValue()->AllZero()); - EXPECT_TRUE(vec->ConstantValue()->Index(0)->AllEqual()); EXPECT_FALSE(vec->ConstantValue()->Index(0)->AnyZero()); EXPECT_FALSE(vec->ConstantValue()->Index(0)->AllZero()); EXPECT_EQ(vec->ConstantValue()->Index(0)->ValueAs(), 7_f); - EXPECT_TRUE(vec->ConstantValue()->Index(1)->AllEqual()); EXPECT_TRUE(vec->ConstantValue()->Index(1)->AnyZero()); EXPECT_TRUE(vec->ConstantValue()->Index(1)->AllZero()); EXPECT_EQ(vec->ConstantValue()->Index(1)->ValueAs(), 0_f); - EXPECT_TRUE(vec->ConstantValue()->Index(2)->AllEqual()); EXPECT_FALSE(vec->ConstantValue()->Index(2)->AnyZero()); EXPECT_FALSE(vec->ConstantValue()->Index(2)->AllZero()); EXPECT_EQ(vec->ConstantValue()->Index(2)->ValueAs(), 9_f); @@ -376,7 +355,6 @@ TEST_F(ResolverConstEvalTest, ChainedIndex) { EXPECT_NE(f, nullptr); EXPECT_TRUE(f->Type()->Is()); EXPECT_EQ(f->ConstantValue()->Type(), f->Type()); - EXPECT_TRUE(f->ConstantValue()->AllEqual()); EXPECT_FALSE(f->ConstantValue()->AnyZero()); EXPECT_FALSE(f->ConstantValue()->AllZero()); EXPECT_EQ(f->ConstantValue()->ValueAs(), 9_f); diff --git a/src/tint/resolver/const_eval_member_access_test.cc b/src/tint/resolver/const_eval_member_access_test.cc index 4fcba8b893..9a74e6c443 100644 --- a/src/tint/resolver/const_eval_member_access_test.cc +++ b/src/tint/resolver/const_eval_member_access_test.cc @@ -46,13 +46,11 @@ TEST_F(ResolverConstEvalTest, StructMemberAccess) { EXPECT_EQ(str->Members().Length(), 2u); ASSERT_NE(outer->ConstantValue(), nullptr); EXPECT_TYPE(outer->ConstantValue()->Type(), outer->Type()); - EXPECT_FALSE(outer->ConstantValue()->AllEqual()); EXPECT_TRUE(outer->ConstantValue()->AnyZero()); EXPECT_FALSE(outer->ConstantValue()->AllZero()); auto* o1 = Sem().Get(o1_expr); ASSERT_NE(o1->ConstantValue(), nullptr); - EXPECT_FALSE(o1->ConstantValue()->AllEqual()); EXPECT_FALSE(o1->ConstantValue()->AnyZero()); EXPECT_FALSE(o1->ConstantValue()->AllZero()); EXPECT_TRUE(o1->ConstantValue()->Type()->Is()); @@ -63,7 +61,6 @@ TEST_F(ResolverConstEvalTest, StructMemberAccess) { auto* i2 = Sem().Get(i2_expr); ASSERT_NE(i2->ConstantValue(), nullptr); - EXPECT_TRUE(i2->ConstantValue()->AllEqual()); EXPECT_FALSE(i2->ConstantValue()->AnyZero()); EXPECT_FALSE(i2->ConstantValue()->AllZero()); EXPECT_TRUE(i2->ConstantValue()->Type()->Is()); @@ -85,7 +82,6 @@ TEST_F(ResolverConstEvalTest, Matrix_AFloat_Construct_From_AInt_Vectors) { EXPECT_TYPE(cv->Type(), sem->Type()); EXPECT_TRUE(cv->Index(0)->Type()->Is()); EXPECT_TRUE(cv->Index(0)->Index(0)->Type()->Is()); - EXPECT_FALSE(cv->AllEqual()); EXPECT_FALSE(cv->AnyZero()); EXPECT_FALSE(cv->AllZero()); auto* c0 = cv->Index(0); @@ -124,7 +120,6 @@ TEST_F(ResolverConstEvalTest, MatrixMemberAccess_AFloat) { EXPECT_TYPE(cv->Type(), sem->Type()); EXPECT_TRUE(cv->Index(0)->Type()->Is()); EXPECT_TRUE(cv->Index(0)->Index(0)->Type()->Is()); - EXPECT_FALSE(cv->AllEqual()); EXPECT_FALSE(cv->AnyZero()); EXPECT_FALSE(cv->AllZero()); @@ -201,7 +196,6 @@ TEST_F(ResolverConstEvalTest, MatrixMemberAccess_f32) { EXPECT_TYPE(cv->Type(), sem->Type()); EXPECT_TRUE(cv->Index(0)->Type()->Is()); EXPECT_TRUE(cv->Index(0)->Index(0)->Type()->Is()); - EXPECT_FALSE(cv->AllEqual()); EXPECT_FALSE(cv->AnyZero()); EXPECT_FALSE(cv->AllZero()); diff --git a/src/tint/sem/value_expression_test.cc b/src/tint/sem/value_expression_test.cc index 5386ffca3a..0a2c9efc1c 100644 --- a/src/tint/sem/value_expression_test.cc +++ b/src/tint/sem/value_expression_test.cc @@ -32,7 +32,6 @@ class MockConstant : public constant::Value { size_t NumElements() const override { return 0; } bool AllZero() const override { return {}; } bool AnyZero() const override { return {}; } - bool AllEqual() const override { return {}; } size_t Hash() const override { return 0; } MockConstant* Clone(constant::CloneContext&) const override { return nullptr; } diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc index e1600e99ae..29c28ff6f3 100644 --- a/src/tint/writer/glsl/generator_impl.cc +++ b/src/tint/writer/glsl/generator_impl.cc @@ -2404,8 +2404,8 @@ bool GeneratorImpl::EmitConstant(utils::StringStream& out, const constant::Value ScopedParen sp(out); - if (constant->AllEqual()) { - return EmitConstant(out, constant->Index(0)); + if (auto* splat = constant->As()) { + return EmitConstant(out, splat->el); } for (size_t i = 0; i < v->Width(); i++) { diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc index 74b9972adb..84543ab65e 100644 --- a/src/tint/writer/hlsl/generator_impl.cc +++ b/src/tint/writer/hlsl/generator_impl.cc @@ -3323,10 +3323,10 @@ bool GeneratorImpl::EmitConstant(utils::StringStream& out, return true; }, [&](const type::Vector* v) { - if (constant->AllEqual()) { + if (auto* splat = constant->As()) { { ScopedParen sp(out); - if (!EmitConstant(out, constant->Index(0), is_variable_initializer)) { + if (!EmitConstant(out, splat->el, is_variable_initializer)) { return false; } } diff --git a/src/tint/writer/msl/generator_impl.cc b/src/tint/writer/msl/generator_impl.cc index 5dae0552bb..397c96185f 100644 --- a/src/tint/writer/msl/generator_impl.cc +++ b/src/tint/writer/msl/generator_impl.cc @@ -1709,8 +1709,8 @@ bool GeneratorImpl::EmitConstant(utils::StringStream& out, const constant::Value ScopedParen sp(out); - if (constant->AllEqual()) { - if (!EmitConstant(out, constant->Index(0))) { + if (auto* splat = constant->As()) { + if (!EmitConstant(out, splat->el)) { return false; } return true;