diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index e224ebd317..7269a30165 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -1252,6 +1252,8 @@ uint32_t Builder::GenerateIntrinsic(const std::string& name, op = spv::Op::OpAll; } else if (name == "is_nan") { op = spv::Op::OpIsNan; + } else if (name == "is_inf") { + op = spv::Op::OpIsInf; } if (op == spv::Op::OpNop) { error_ = "unable to determine operator for: " + name; diff --git a/src/writer/spirv/builder_intrinsic_test.cc b/src/writer/spirv/builder_intrinsic_test.cc index ba40b10096..f5151dabfe 100644 --- a/src/writer/spirv/builder_intrinsic_test.cc +++ b/src/writer/spirv/builder_intrinsic_test.cc @@ -167,7 +167,8 @@ TEST_P(IntrinsicFloatTest, Call_Float_Vector) { } INSTANTIATE_TEST_SUITE_P(BuilderTest, IntrinsicFloatTest, - testing::Values(IntrinsicData{"is_nan", "OpIsNan"})); + testing::Values(IntrinsicData{"is_nan", "OpIsNan"}, + IntrinsicData{"is_inf", "OpIsInf"})); } // namespace } // namespace spirv