[spirv-writer] Add support for is_inf

This CL adds support for generating OpIsInf.

Bug: tint:5
Change-Id: Ia208695d78f9914000e893435f37be45adb81022
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22623
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-06-04 17:05:55 +00:00 committed by dan sinclair
parent c31903d2ad
commit 3c3cf3cc21
2 changed files with 4 additions and 1 deletions

View File

@ -1252,6 +1252,8 @@ uint32_t Builder::GenerateIntrinsic(const std::string& name,
op = spv::Op::OpAll; op = spv::Op::OpAll;
} else if (name == "is_nan") { } else if (name == "is_nan") {
op = spv::Op::OpIsNan; op = spv::Op::OpIsNan;
} else if (name == "is_inf") {
op = spv::Op::OpIsInf;
} }
if (op == spv::Op::OpNop) { if (op == spv::Op::OpNop) {
error_ = "unable to determine operator for: " + name; error_ = "unable to determine operator for: " + name;

View File

@ -167,7 +167,8 @@ TEST_P(IntrinsicFloatTest, Call_Float_Vector) {
} }
INSTANTIATE_TEST_SUITE_P(BuilderTest, INSTANTIATE_TEST_SUITE_P(BuilderTest,
IntrinsicFloatTest, IntrinsicFloatTest,
testing::Values(IntrinsicData{"is_nan", "OpIsNan"})); testing::Values(IntrinsicData{"is_nan", "OpIsNan"},
IntrinsicData{"is_inf", "OpIsInf"}));
} // namespace } // namespace
} // namespace spirv } // namespace spirv