| // Copyright 2023 The Tint Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| //////////////////////////////////////////////////////////////////////////////// |
| // File generated by 'tools/src/cmd/gen' using the template: |
| // src/tint/lang/spirv/intrinsic/data/data.cc.tmpl |
| // |
| // To regenerate run: './tools/run gen' |
| // |
| // Do not modify this file directly |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| #include <limits> |
| #include <string> |
| |
| #include "src/tint/lang/core/intrinsic/data/type_matchers.h" |
| #include "src/tint/lang/spirv/intrinsic/data/data.h" |
| #include "src/tint/lang/spirv/intrinsic/data/type_matchers.h" |
| #include "src/tint/utils/text/string_stream.h" |
| |
| namespace tint::spirv::intrinsic::data { |
| |
| using namespace tint::core::intrinsic::data; // NOLINT(build/namespaces) |
| |
| namespace { |
| |
| using ConstEvalFunctionIndex = tint::core::intrinsic::ConstEvalFunctionIndex; |
| using IntrinsicInfo = tint::core::intrinsic::IntrinsicInfo; |
| using MatchState = tint::core::intrinsic::MatchState; |
| using Number = tint::core::intrinsic::Number; |
| using NumberMatcher = tint::core::intrinsic::NumberMatcher; |
| using NumberMatcherIndex = tint::core::intrinsic::NumberMatcherIndex; |
| using NumberMatcherIndicesIndex = tint::core::intrinsic::NumberMatcherIndicesIndex; |
| using OverloadFlag = tint::core::intrinsic::OverloadFlag; |
| using OverloadFlags = tint::core::intrinsic::OverloadFlags; |
| using OverloadIndex = tint::core::intrinsic::OverloadIndex; |
| using OverloadInfo = tint::core::intrinsic::OverloadInfo; |
| using ParameterIndex = tint::core::intrinsic::ParameterIndex; |
| using ParameterInfo = tint::core::intrinsic::ParameterInfo; |
| using StringStream = tint::StringStream; |
| using TemplateNumberIndex = tint::core::intrinsic::TemplateNumberIndex; |
| using TemplateNumberInfo = tint::core::intrinsic::TemplateNumberInfo; |
| using TemplateTypeIndex = tint::core::intrinsic::TemplateTypeIndex; |
| using TemplateTypeInfo = tint::core::intrinsic::TemplateTypeInfo; |
| using Type = tint::core::type::Type; |
| using TypeMatcher = tint::core::intrinsic::TypeMatcher; |
| using TypeMatcherIndex = tint::core::intrinsic::TypeMatcherIndex; |
| using TypeMatcherIndicesIndex = tint::core::intrinsic::TypeMatcherIndicesIndex; |
| |
| template <size_t N> |
| using TemplateNumberMatcher = tint::core::intrinsic::TemplateNumberMatcher<N>; |
| |
| template <size_t N> |
| using TemplateTypeMatcher = tint::core::intrinsic::TemplateTypeMatcher<N>; |
| |
| // clang-format off |
| |
| /// TypeMatcher for 'type bool' |
| constexpr TypeMatcher kBoolMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchBool(state, ty)) { |
| return nullptr; |
| } |
| return BuildBool(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "bool"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type f32' |
| constexpr TypeMatcher kF32Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchF32(state, ty)) { |
| return nullptr; |
| } |
| return BuildF32(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "f32"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type f16' |
| constexpr TypeMatcher kF16Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchF16(state, ty)) { |
| return nullptr; |
| } |
| return BuildF16(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "f16"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type i32' |
| constexpr TypeMatcher kI32Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchI32(state, ty)) { |
| return nullptr; |
| } |
| return BuildI32(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "i32"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type u32' |
| constexpr TypeMatcher kU32Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchU32(state, ty)) { |
| return nullptr; |
| } |
| return BuildU32(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "u32"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type vec2' |
| constexpr TypeMatcher kVec2Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchVec2(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildVec2(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "vec2<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type vec3' |
| constexpr TypeMatcher kVec3Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchVec3(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildVec3(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "vec3<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type vec4' |
| constexpr TypeMatcher kVec4Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchVec4(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildVec4(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "vec4<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat2x2' |
| constexpr TypeMatcher kMat2X2Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat2X2(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat2X2(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat2x2<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat2x3' |
| constexpr TypeMatcher kMat2X3Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat2X3(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat2X3(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat2x3<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat2x4' |
| constexpr TypeMatcher kMat2X4Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat2X4(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat2X4(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat2x4<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat3x2' |
| constexpr TypeMatcher kMat3X2Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat3X2(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat3X2(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat3x2<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat3x3' |
| constexpr TypeMatcher kMat3X3Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat3X3(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat3X3(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat3x3<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat3x4' |
| constexpr TypeMatcher kMat3X4Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat3X4(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat3X4(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat3x4<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat4x2' |
| constexpr TypeMatcher kMat4X2Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat4X2(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat4X2(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat4x2<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat4x3' |
| constexpr TypeMatcher kMat4X3Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat4X3(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat4X3(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat4x3<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat4x4' |
| constexpr TypeMatcher kMat4X4Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchMat4X4(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat4X4(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "mat4x4<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type vec' |
| constexpr TypeMatcher kVecMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| Number N = Number::invalid; |
| const Type* T = nullptr; |
| if (!MatchVec(state, ty, N, T)) { |
| return nullptr; |
| } |
| N = state.Num(N); |
| if (!N.IsValid()) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildVec(state, ty, N, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string N = state->NumName(); |
| const std::string T = state->TypeName(); |
| StringStream ss; |
| ss << "vec" << N << "<" << T << ">"; |
| return ss.str(); |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type mat' |
| constexpr TypeMatcher kMatMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| Number N = Number::invalid; |
| Number M = Number::invalid; |
| const Type* T = nullptr; |
| if (!MatchMat(state, ty, N, M, T)) { |
| return nullptr; |
| } |
| N = state.Num(N); |
| if (!N.IsValid()) { |
| return nullptr; |
| } |
| M = state.Num(M); |
| if (!M.IsValid()) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildMat(state, ty, N, M, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string N = state->NumName(); |
| const std::string M = state->NumName(); |
| const std::string T = state->TypeName(); |
| StringStream ss; |
| ss << "mat" << N << "x" << M << "<" << T << ">"; |
| return ss.str(); |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type atomic' |
| constexpr TypeMatcher kAtomicMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchAtomic(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildAtomic(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "atomic<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type sampler' |
| constexpr TypeMatcher kSamplerMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchSampler(state, ty)) { |
| return nullptr; |
| } |
| return BuildSampler(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "sampler"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type sampler_comparison' |
| constexpr TypeMatcher kSamplerComparisonMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchSamplerComparison(state, ty)) { |
| return nullptr; |
| } |
| return BuildSamplerComparison(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "sampler_comparison"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_1d' |
| constexpr TypeMatcher kTexture1DMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchTexture1D(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildTexture1D(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "texture_1d<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_2d' |
| constexpr TypeMatcher kTexture2DMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchTexture2D(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildTexture2D(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "texture_2d<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_2d_array' |
| constexpr TypeMatcher kTexture2DArrayMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchTexture2DArray(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildTexture2DArray(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "texture_2d_array<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_3d' |
| constexpr TypeMatcher kTexture3DMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchTexture3D(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildTexture3D(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "texture_3d<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_cube' |
| constexpr TypeMatcher kTextureCubeMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchTextureCube(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildTextureCube(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "texture_cube<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_cube_array' |
| constexpr TypeMatcher kTextureCubeArrayMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchTextureCubeArray(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildTextureCubeArray(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "texture_cube_array<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_depth_2d' |
| constexpr TypeMatcher kTextureDepth2DMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchTextureDepth2D(state, ty)) { |
| return nullptr; |
| } |
| return BuildTextureDepth2D(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "texture_depth_2d"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_depth_2d_array' |
| constexpr TypeMatcher kTextureDepth2DArrayMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchTextureDepth2DArray(state, ty)) { |
| return nullptr; |
| } |
| return BuildTextureDepth2DArray(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "texture_depth_2d_array"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_depth_cube' |
| constexpr TypeMatcher kTextureDepthCubeMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchTextureDepthCube(state, ty)) { |
| return nullptr; |
| } |
| return BuildTextureDepthCube(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "texture_depth_cube"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type texture_depth_cube_array' |
| constexpr TypeMatcher kTextureDepthCubeArrayMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchTextureDepthCubeArray(state, ty)) { |
| return nullptr; |
| } |
| return BuildTextureDepthCubeArray(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "texture_depth_cube_array"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type ptr' |
| constexpr TypeMatcher kPtrMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| Number S = Number::invalid; |
| const Type* T = nullptr; |
| Number A = Number::invalid; |
| if (!MatchPtr(state, ty, S, T, A)) { |
| return nullptr; |
| } |
| S = state.Num(S); |
| if (!S.IsValid()) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| A = state.Num(A); |
| if (!A.IsValid()) { |
| return nullptr; |
| } |
| return BuildPtr(state, ty, S, T, A); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string S = state->NumName(); |
| const std::string T = state->TypeName(); |
| const std::string A = state->NumName(); |
| return "ptr<" + S + ", " + T + ", " + A + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type struct_with_runtime_array' |
| constexpr TypeMatcher kStructWithRuntimeArrayMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (!MatchStructWithRuntimeArray(state, ty)) { |
| return nullptr; |
| } |
| return BuildStructWithRuntimeArray(state, ty); |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "struct_with_runtime_array"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'type sampled_image' |
| constexpr TypeMatcher kSampledImageMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| const Type* T = nullptr; |
| if (!MatchSampledImage(state, ty, T)) { |
| return nullptr; |
| } |
| T = state.Type(T); |
| if (T == nullptr) { |
| return nullptr; |
| } |
| return BuildSampledImage(state, ty, T); |
| }, |
| /* string */ [](MatchState* state) -> std::string { |
| const std::string T = state->TypeName(); |
| return "sampled_image<" + T + ">"; |
| } |
| }; |
| |
| |
| /// TypeMatcher for 'match f32_f16' |
| constexpr TypeMatcher kF32F16Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (MatchF32(state, ty)) { |
| return BuildF32(state, ty); |
| } |
| if (MatchF16(state, ty)) { |
| return BuildF16(state, ty); |
| } |
| return nullptr; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| StringStream ss; |
| // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support |
| // template arguments, nor can they match sub-types. As such, they have no use for the MatchState. |
| ss << kF32Matcher.string(nullptr) << " or " << kF16Matcher.string(nullptr); |
| return ss.str(); |
| } |
| }; |
| |
| /// TypeMatcher for 'match iu32' |
| constexpr TypeMatcher kIu32Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (MatchI32(state, ty)) { |
| return BuildI32(state, ty); |
| } |
| if (MatchU32(state, ty)) { |
| return BuildU32(state, ty); |
| } |
| return nullptr; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| StringStream ss; |
| // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support |
| // template arguments, nor can they match sub-types. As such, they have no use for the MatchState. |
| ss << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr); |
| return ss.str(); |
| } |
| }; |
| |
| /// TypeMatcher for 'match fiu32' |
| constexpr TypeMatcher kFiu32Matcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (MatchF32(state, ty)) { |
| return BuildF32(state, ty); |
| } |
| if (MatchI32(state, ty)) { |
| return BuildI32(state, ty); |
| } |
| if (MatchU32(state, ty)) { |
| return BuildU32(state, ty); |
| } |
| return nullptr; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| StringStream ss; |
| // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support |
| // template arguments, nor can they match sub-types. As such, they have no use for the MatchState. |
| ss << kF32Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << " or " << kU32Matcher.string(nullptr); |
| return ss.str(); |
| } |
| }; |
| |
| /// TypeMatcher for 'match scalar' |
| constexpr TypeMatcher kScalarMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (MatchF32(state, ty)) { |
| return BuildF32(state, ty); |
| } |
| if (MatchF16(state, ty)) { |
| return BuildF16(state, ty); |
| } |
| if (MatchI32(state, ty)) { |
| return BuildI32(state, ty); |
| } |
| if (MatchU32(state, ty)) { |
| return BuildU32(state, ty); |
| } |
| if (MatchBool(state, ty)) { |
| return BuildBool(state, ty); |
| } |
| return nullptr; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| StringStream ss; |
| // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support |
| // template arguments, nor can they match sub-types. As such, they have no use for the MatchState. |
| ss << kF32Matcher.string(nullptr) << ", " << kF16Matcher.string(nullptr) << ", " << kI32Matcher.string(nullptr) << ", " << kU32Matcher.string(nullptr) << " or " << kBoolMatcher.string(nullptr); |
| return ss.str(); |
| } |
| }; |
| |
| /// TypeMatcher for 'match samplers' |
| constexpr TypeMatcher kSamplersMatcher { |
| /* match */ [](MatchState& state, const Type* ty) -> const Type* { |
| if (MatchSampler(state, ty)) { |
| return BuildSampler(state, ty); |
| } |
| if (MatchSamplerComparison(state, ty)) { |
| return BuildSamplerComparison(state, ty); |
| } |
| return nullptr; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| StringStream ss; |
| // Note: We pass nullptr to the TypeMatcher::String() functions, as 'matcher's do not support |
| // template arguments, nor can they match sub-types. As such, they have no use for the MatchState. |
| ss << kSamplerMatcher.string(nullptr) << " or " << kSamplerComparisonMatcher.string(nullptr); |
| return ss.str(); |
| } |
| }; |
| |
| /// EnumMatcher for 'match read_write' |
| constexpr NumberMatcher kReadWriteMatcher { |
| /* match */ [](MatchState&, Number number) -> Number { |
| if (number.IsAny() || number.Value() == static_cast<uint32_t>(core::Access::kReadWrite)) { |
| return Number(static_cast<uint32_t>(core::Access::kReadWrite)); |
| } |
| return Number::invalid; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "read_write"; |
| } |
| }; |
| |
| /// EnumMatcher for 'match storage' |
| constexpr NumberMatcher kStorageMatcher { |
| /* match */ [](MatchState&, Number number) -> Number { |
| if (number.IsAny() || number.Value() == static_cast<uint32_t>(core::AddressSpace::kStorage)) { |
| return Number(static_cast<uint32_t>(core::AddressSpace::kStorage)); |
| } |
| return Number::invalid; |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "storage"; |
| } |
| }; |
| |
| /// EnumMatcher for 'match workgroup_or_storage' |
| constexpr NumberMatcher kWorkgroupOrStorageMatcher { |
| /* match */ [](MatchState&, Number number) -> Number { |
| switch (static_cast<core::AddressSpace>(number.Value())) { |
| case core::AddressSpace::kWorkgroup: |
| case core::AddressSpace::kStorage: |
| return number; |
| default: |
| return Number::invalid; |
| } |
| }, |
| /* string */ [](MatchState*) -> std::string { |
| return "workgroup or storage"; |
| } |
| }; |
| |
| /// Type and number matchers |
| |
| /// The template types, types, and type matchers |
| constexpr TypeMatcher kTypeMatchers[] = { |
| /* [0] */ TemplateTypeMatcher<0>::matcher, |
| /* [1] */ TemplateTypeMatcher<1>::matcher, |
| /* [2] */ kBoolMatcher, |
| /* [3] */ kF32Matcher, |
| /* [4] */ kF16Matcher, |
| /* [5] */ kI32Matcher, |
| /* [6] */ kU32Matcher, |
| /* [7] */ kVec2Matcher, |
| /* [8] */ kVec3Matcher, |
| /* [9] */ kVec4Matcher, |
| /* [10] */ kMat2X2Matcher, |
| /* [11] */ kMat2X3Matcher, |
| /* [12] */ kMat2X4Matcher, |
| /* [13] */ kMat3X2Matcher, |
| /* [14] */ kMat3X3Matcher, |
| /* [15] */ kMat3X4Matcher, |
| /* [16] */ kMat4X2Matcher, |
| /* [17] */ kMat4X3Matcher, |
| /* [18] */ kMat4X4Matcher, |
| /* [19] */ kVecMatcher, |
| /* [20] */ kMatMatcher, |
| /* [21] */ kAtomicMatcher, |
| /* [22] */ kSamplerMatcher, |
| /* [23] */ kSamplerComparisonMatcher, |
| /* [24] */ kTexture1DMatcher, |
| /* [25] */ kTexture2DMatcher, |
| /* [26] */ kTexture2DArrayMatcher, |
| /* [27] */ kTexture3DMatcher, |
| /* [28] */ kTextureCubeMatcher, |
| /* [29] */ kTextureCubeArrayMatcher, |
| /* [30] */ kTextureDepth2DMatcher, |
| /* [31] */ kTextureDepth2DArrayMatcher, |
| /* [32] */ kTextureDepthCubeMatcher, |
| /* [33] */ kTextureDepthCubeArrayMatcher, |
| /* [34] */ kPtrMatcher, |
| /* [35] */ kStructWithRuntimeArrayMatcher, |
| /* [36] */ kSampledImageMatcher, |
| /* [37] */ kF32F16Matcher, |
| /* [38] */ kIu32Matcher, |
| /* [39] */ kFiu32Matcher, |
| /* [40] */ kScalarMatcher, |
| /* [41] */ kSamplersMatcher, |
| }; |
| |
| /// The template numbers, and number matchers |
| constexpr NumberMatcher kNumberMatchers[] = { |
| /* [0] */ TemplateNumberMatcher<0>::matcher, |
| /* [1] */ TemplateNumberMatcher<1>::matcher, |
| /* [2] */ TemplateNumberMatcher<2>::matcher, |
| /* [3] */ kReadWriteMatcher, |
| /* [4] */ kStorageMatcher, |
| /* [5] */ kWorkgroupOrStorageMatcher, |
| }; |
| |
| constexpr TypeMatcherIndex kTypeMatcherIndices[] = { |
| /* [0] */ TypeMatcherIndex(34), |
| /* [1] */ TypeMatcherIndex(21), |
| /* [2] */ TypeMatcherIndex(0), |
| /* [3] */ TypeMatcherIndex(36), |
| /* [4] */ TypeMatcherIndex(24), |
| /* [5] */ TypeMatcherIndex(0), |
| /* [6] */ TypeMatcherIndex(36), |
| /* [7] */ TypeMatcherIndex(25), |
| /* [8] */ TypeMatcherIndex(0), |
| /* [9] */ TypeMatcherIndex(36), |
| /* [10] */ TypeMatcherIndex(26), |
| /* [11] */ TypeMatcherIndex(0), |
| /* [12] */ TypeMatcherIndex(36), |
| /* [13] */ TypeMatcherIndex(27), |
| /* [14] */ TypeMatcherIndex(0), |
| /* [15] */ TypeMatcherIndex(36), |
| /* [16] */ TypeMatcherIndex(28), |
| /* [17] */ TypeMatcherIndex(0), |
| /* [18] */ TypeMatcherIndex(36), |
| /* [19] */ TypeMatcherIndex(29), |
| /* [20] */ TypeMatcherIndex(0), |
| /* [21] */ TypeMatcherIndex(34), |
| /* [22] */ TypeMatcherIndex(35), |
| /* [23] */ TypeMatcherIndex(19), |
| /* [24] */ TypeMatcherIndex(0), |
| /* [25] */ TypeMatcherIndex(20), |
| /* [26] */ TypeMatcherIndex(0), |
| /* [27] */ TypeMatcherIndex(36), |
| /* [28] */ TypeMatcherIndex(30), |
| /* [29] */ TypeMatcherIndex(36), |
| /* [30] */ TypeMatcherIndex(31), |
| /* [31] */ TypeMatcherIndex(36), |
| /* [32] */ TypeMatcherIndex(32), |
| /* [33] */ TypeMatcherIndex(36), |
| /* [34] */ TypeMatcherIndex(33), |
| /* [35] */ TypeMatcherIndex(19), |
| /* [36] */ TypeMatcherIndex(2), |
| /* [37] */ TypeMatcherIndex(6), |
| /* [38] */ TypeMatcherIndex(1), |
| }; |
| |
| static_assert(TypeMatcherIndex::CanIndex(kTypeMatcherIndices), |
| "TypeMatcherIndex is not large enough to index kTypeMatcherIndices"); |
| |
| constexpr NumberMatcherIndex kNumberMatcherIndices[] = { |
| /* [0] */ NumberMatcherIndex(4), |
| /* [1] */ NumberMatcherIndex(0), |
| /* [2] */ NumberMatcherIndex(3), |
| /* [3] */ NumberMatcherIndex(1), |
| /* [4] */ NumberMatcherIndex(2), |
| /* [5] */ NumberMatcherIndex(0), |
| /* [6] */ NumberMatcherIndex(2), |
| /* [7] */ NumberMatcherIndex(1), |
| /* [8] */ NumberMatcherIndex(0), |
| /* [9] */ NumberMatcherIndex(1), |
| }; |
| |
| static_assert(NumberMatcherIndex::CanIndex(kNumberMatcherIndices), |
| "NumberMatcherIndex is not large enough to index kNumberMatcherIndices"); |
| |
| constexpr ParameterInfo kParameters[] = { |
| { |
| /* [0] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(0), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| }, |
| { |
| /* [1] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [2] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [3] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [4] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [5] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [6] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(0), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| }, |
| { |
| /* [7] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [8] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [9] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [10] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(36), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [11] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [12] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [13] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(35), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| }, |
| { |
| /* [14] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| }, |
| { |
| /* [15] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| }, |
| { |
| /* [16] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(7), |
| }, |
| { |
| /* [17] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(21), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(0), |
| }, |
| { |
| /* [18] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [19] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(5), |
| }, |
| { |
| /* [20] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(7), |
| }, |
| { |
| /* [21] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(8), |
| }, |
| { |
| /* [22] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [23] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(8), |
| }, |
| { |
| /* [24] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| }, |
| { |
| /* [25] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [26] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(4), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [27] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [28] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(7), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [29] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [30] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(10), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [31] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [32] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(13), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [33] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [34] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(16), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [35] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [36] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(19), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [37] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(38), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [38] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(28), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [39] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [40] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(30), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [41] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [42] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(32), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [43] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [44] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(34), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| { |
| /* [45] */ |
| /* usage */ core::ParameterUsage::kNone, |
| /* type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| }, |
| }; |
| |
| static_assert(ParameterIndex::CanIndex(kParameters), |
| "ParameterIndex is not large enough to index kParameters"); |
| |
| constexpr TemplateTypeInfo kTemplateTypes[] = { |
| { |
| /* [0] */ |
| /* name */ "T", |
| /* matcher_index */ TypeMatcherIndex(38), |
| }, |
| { |
| /* [1] */ |
| /* name */ "U", |
| /* matcher_index */ TypeMatcherIndex(6), |
| }, |
| { |
| /* [2] */ |
| /* name */ "T", |
| /* matcher_index */ TypeMatcherIndex(39), |
| }, |
| { |
| /* [3] */ |
| /* name */ "S", |
| /* matcher_index */ TypeMatcherIndex(41), |
| }, |
| { |
| /* [4] */ |
| /* name */ "I", |
| /* matcher_index */ TypeMatcherIndex(6), |
| }, |
| { |
| /* [5] */ |
| /* name */ "T", |
| /* matcher_index */ TypeMatcherIndex(37), |
| }, |
| { |
| /* [6] */ |
| /* name */ "T", |
| /* matcher_index */ TypeMatcherIndex(40), |
| }, |
| }; |
| |
| static_assert(TemplateTypeIndex::CanIndex(kTemplateTypes), |
| "TemplateTypeIndex is not large enough to index kTemplateTypes"); |
| |
| constexpr TemplateNumberInfo kTemplateNumbers[] = { |
| { |
| /* [0] */ |
| /* name */ "K", |
| /* matcher_index */ NumberMatcherIndex(/* invalid */), |
| }, |
| { |
| /* [1] */ |
| /* name */ "C", |
| /* matcher_index */ NumberMatcherIndex(/* invalid */), |
| }, |
| { |
| /* [2] */ |
| /* name */ "R", |
| /* matcher_index */ NumberMatcherIndex(/* invalid */), |
| }, |
| { |
| /* [3] */ |
| /* name */ "N", |
| /* matcher_index */ NumberMatcherIndex(/* invalid */), |
| }, |
| { |
| /* [4] */ |
| /* name */ "M", |
| /* matcher_index */ NumberMatcherIndex(/* invalid */), |
| }, |
| { |
| /* [5] */ |
| /* name */ "A", |
| /* matcher_index */ NumberMatcherIndex(/* invalid */), |
| }, |
| { |
| /* [6] */ |
| /* name */ "S", |
| /* matcher_index */ NumberMatcherIndex(5), |
| }, |
| }; |
| |
| static_assert(TemplateNumberIndex::CanIndex(kTemplateNumbers), |
| "TemplateNumberIndex is not large enough to index kTemplateNumbers"); |
| |
| constexpr OverloadInfo kOverloads[] = { |
| { |
| /* [0] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(2), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(26), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(3), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [1] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(2), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(28), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(6), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [2] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(2), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(30), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(9), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [3] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(2), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(32), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(12), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [4] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(2), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(34), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(15), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [5] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(2), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(36), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(18), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [6] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(3), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(38), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(27), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [7] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(3), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(40), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(29), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [8] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(3), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(42), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(31), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [9] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(3), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(44), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(33), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [10] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 3, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 0, |
| /* template_types */ TemplateTypeIndex(6), |
| /* template_numbers */ TemplateNumberIndex(/* invalid */), |
| /* parameters */ ParameterIndex(10), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [11] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 3, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(6), |
| /* template_numbers */ TemplateNumberIndex(3), |
| /* parameters */ ParameterIndex(13), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [12] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(4), |
| /* template_numbers */ TemplateNumberIndex(5), |
| /* parameters */ ParameterIndex(17), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(37), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [13] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 4, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(0), |
| /* template_numbers */ TemplateNumberIndex(6), |
| /* parameters */ ParameterIndex(6), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [14] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 6, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(0), |
| /* template_numbers */ TemplateNumberIndex(6), |
| /* parameters */ ParameterIndex(0), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [15] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 3, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(0), |
| /* template_numbers */ TemplateNumberIndex(6), |
| /* parameters */ ParameterIndex(0), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [16] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 4, |
| /* num_template_types */ 2, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(0), |
| /* template_numbers */ TemplateNumberIndex(6), |
| /* parameters */ ParameterIndex(6), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(/* invalid */), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [17] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(5), |
| /* template_numbers */ TemplateNumberIndex(3), |
| /* parameters */ ParameterIndex(14), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(2), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(/* invalid */), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [18] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 3, |
| /* template_types */ TemplateTypeIndex(5), |
| /* template_numbers */ TemplateNumberIndex(0), |
| /* parameters */ ParameterIndex(19), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(3), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [19] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 2, |
| /* template_types */ TemplateTypeIndex(5), |
| /* template_numbers */ TemplateNumberIndex(3), |
| /* parameters */ ParameterIndex(21), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(25), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(8), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [20] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 2, |
| /* template_types */ TemplateTypeIndex(5), |
| /* template_numbers */ TemplateNumberIndex(3), |
| /* parameters */ ParameterIndex(23), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(3), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [21] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 2, |
| /* template_types */ TemplateTypeIndex(5), |
| /* template_numbers */ TemplateNumberIndex(3), |
| /* parameters */ ParameterIndex(15), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(3), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| { |
| /* [22] */ |
| /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline), |
| /* num_parameters */ 2, |
| /* num_template_types */ 1, |
| /* num_template_numbers */ 1, |
| /* template_types */ TemplateTypeIndex(5), |
| /* template_numbers */ TemplateNumberIndex(3), |
| /* parameters */ ParameterIndex(24), |
| /* return_type_matcher_indices */ TypeMatcherIndicesIndex(23), |
| /* return_number_matcher_indices */ NumberMatcherIndicesIndex(1), |
| /* const_eval_fn */ ConstEvalFunctionIndex(/* invalid */), |
| }, |
| }; |
| |
| static_assert(OverloadIndex::CanIndex(kOverloads), |
| "OverloadIndex is not large enough to index kOverloads"); |
| |
| constexpr IntrinsicInfo kBuiltins[] = { |
| { |
| /* [0] */ |
| /* fn array_length<I : u32, A : access>(ptr<storage, struct_with_runtime_array, A>, I) -> u32 */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(12), |
| }, |
| { |
| /* [1] */ |
| /* fn atomic_and<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [2] */ |
| /* fn atomic_compare_exchange<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, U, T, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(14), |
| }, |
| { |
| /* [3] */ |
| /* fn atomic_exchange<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [4] */ |
| /* fn atomic_iadd<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [5] */ |
| /* fn atomic_isub<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [6] */ |
| /* fn atomic_load<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(15), |
| }, |
| { |
| /* [7] */ |
| /* fn atomic_or<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [8] */ |
| /* fn atomic_smax<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [9] */ |
| /* fn atomic_smin<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [10] */ |
| /* fn atomic_store<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(16), |
| }, |
| { |
| /* [11] */ |
| /* fn atomic_umax<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [12] */ |
| /* fn atomic_umin<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [13] */ |
| /* fn atomic_xor<T : iu32, U : u32, S : workgroup_or_storage>(ptr<S, atomic<T>, read_write>, U, U, T) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(13), |
| }, |
| { |
| /* [14] */ |
| /* fn dot<N : num, T : f32_f16>(vec<N, T>, vec<N, T>) -> T */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(17), |
| }, |
| { |
| /* [15] */ |
| /* fn matrix_times_matrix<T : f32_f16, K : num, C : num, R : num>(mat<K, R, T>, mat<C, K, T>) -> mat<C, R, T> */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(18), |
| }, |
| { |
| /* [16] */ |
| /* fn matrix_times_scalar<T : f32_f16, N : num, M : num>(mat<N, M, T>, T) -> mat<N, M, T> */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(19), |
| }, |
| { |
| /* [17] */ |
| /* fn matrix_times_vector<T : f32_f16, N : num, M : num>(mat<N, M, T>, vec<N, T>) -> vec<M, T> */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(20), |
| }, |
| { |
| /* [18] */ |
| /* fn sampled_image<T : fiu32, S : samplers>(texture_1d<T>, S) -> sampled_image<texture_1d<T>> */ |
| /* fn sampled_image<T : fiu32, S : samplers>(texture_2d<T>, S) -> sampled_image<texture_2d<T>> */ |
| /* fn sampled_image<T : fiu32, S : samplers>(texture_2d_array<T>, S) -> sampled_image<texture_2d_array<T>> */ |
| /* fn sampled_image<T : fiu32, S : samplers>(texture_3d<T>, S) -> sampled_image<texture_3d<T>> */ |
| /* fn sampled_image<T : fiu32, S : samplers>(texture_cube<T>, S) -> sampled_image<texture_cube<T>> */ |
| /* fn sampled_image<T : fiu32, S : samplers>(texture_cube_array<T>, S) -> sampled_image<texture_cube_array<T>> */ |
| /* fn sampled_image<S : samplers>(texture_depth_2d, S) -> sampled_image<texture_depth_2d> */ |
| /* fn sampled_image<S : samplers>(texture_depth_2d_array, S) -> sampled_image<texture_depth_2d_array> */ |
| /* fn sampled_image<S : samplers>(texture_depth_cube, S) -> sampled_image<texture_depth_cube> */ |
| /* fn sampled_image<S : samplers>(texture_depth_cube_array, S) -> sampled_image<texture_depth_cube_array> */ |
| /* num overloads */ 10, |
| /* overloads */ OverloadIndex(0), |
| }, |
| { |
| /* [19] */ |
| /* fn select<T : scalar>(bool, T, T) -> T */ |
| /* fn select<N : num, T : scalar>(vec<N, bool>, vec<N, T>, vec<N, T>) -> vec<N, T> */ |
| /* num overloads */ 2, |
| /* overloads */ OverloadIndex(10), |
| }, |
| { |
| /* [20] */ |
| /* fn vector_times_matrix<T : f32_f16, N : num, M : num>(vec<N, T>, mat<M, N, T>) -> vec<M, T> */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(21), |
| }, |
| { |
| /* [21] */ |
| /* fn vector_times_scalar<T : f32_f16, N : num>(vec<N, T>, T) -> vec<N, T> */ |
| /* num overloads */ 1, |
| /* overloads */ OverloadIndex(22), |
| }, |
| }; |
| |
| // clang-format on |
| |
| } // anonymous namespace |
| |
| const core::intrinsic::TableData kData{ |
| /* template_types */ kTemplateTypes, |
| /* template_numbers */ kTemplateNumbers, |
| /* type_matcher_indices */ kTypeMatcherIndices, |
| /* number_matcher_indices */ kNumberMatcherIndices, |
| /* type_matchers */ kTypeMatchers, |
| /* number_matchers */ kNumberMatchers, |
| /* parameters */ kParameters, |
| /* overloads */ kOverloads, |
| /* const_eval_functions */ Empty, |
| /* ctor_conv */ Empty, |
| /* builtins */ kBuiltins, |
| /* binary '+' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '-' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '*' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '/' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '%' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '^' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '&' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '|' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '&&' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '||' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '==' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '!=' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '<' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '>' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '<=' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '>=' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '<<' */ tint::core::intrinsic::kNoOverloads, |
| /* binary '>>' */ tint::core::intrinsic::kNoOverloads, |
| /* unary '!' */ tint::core::intrinsic::kNoOverloads, |
| /* unary '~' */ tint::core::intrinsic::kNoOverloads, |
| /* unary '-' */ tint::core::intrinsic::kNoOverloads, |
| }; |
| |
| } // namespace tint::spirv::intrinsic::data |