[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:
parent
c31903d2ad
commit
3c3cf3cc21
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue