{{- /*
--------------------------------------------------------------------------------
Template file for use with tools/src/cmd/gen to generate builtin_fn.cc

To update the generated file, run:
    ./tools/run gen

See:
* tools/src/cmd/gen for structures used by this template
* https://golang.org/pkg/text/template/ for documentation on the template syntax
--------------------------------------------------------------------------------
*/ -}}

{{- $I := LoadIntrinsics "src/tint/lang/wgsl/wgsl.def" -}}
#include "src/tint/lang/wgsl/builtin_fn.h"

namespace tint::wgsl {

BuiltinFn ParseBuiltinFn(std::string_view name) {
{{- range $I.Sem.Builtins  }}
    if (name == "{{.Name}}") {
        return BuiltinFn::k{{PascalCase .Name}};
    }
{{- end  }}
    return BuiltinFn::kNone;
}

const char* str(BuiltinFn i) {
    switch (i) {
        case BuiltinFn::kNone:
            return "<none>";
{{- range $I.Sem.Builtins  }}
        case BuiltinFn::k{{PascalCase .Name}}:
            return "{{.Name}}";
{{- end  }}
    }
    return "<unknown>";
}

bool IsCoarseDerivative(BuiltinFn f) {
    return f == BuiltinFn::kDpdxCoarse || f == BuiltinFn::kDpdyCoarse ||
           f == BuiltinFn::kFwidthCoarse;
}

bool IsFineDerivative(BuiltinFn f) {
    return f == BuiltinFn::kDpdxFine || f == BuiltinFn::kDpdyFine ||
           f == BuiltinFn::kFwidthFine;
}

bool IsDerivative(BuiltinFn f) {
    return f == BuiltinFn::kDpdx || f == BuiltinFn::kDpdy ||
           f == BuiltinFn::kFwidth || IsCoarseDerivative(f) ||
           IsFineDerivative(f);
}

bool IsTexture(BuiltinFn f) {
    return IsImageQuery(f) ||                                //
           f == BuiltinFn::kTextureGather ||                 //
           f == BuiltinFn::kTextureGatherCompare ||          //
           f == BuiltinFn::kTextureLoad ||                   //
           f == BuiltinFn::kTextureSample ||                 //
           f == BuiltinFn::kTextureSampleBaseClampToEdge ||  //
           f == BuiltinFn::kTextureSampleBias ||             //
           f == BuiltinFn::kTextureSampleCompare ||          //
           f == BuiltinFn::kTextureSampleCompareLevel ||     //
           f == BuiltinFn::kTextureSampleGrad ||             //
           f == BuiltinFn::kTextureSampleLevel ||            //
           f == BuiltinFn::kTextureStore || f == BuiltinFn::kInputAttachmentLoad;
}

bool IsImageQuery(BuiltinFn f) {
    return f == BuiltinFn::kTextureDimensions ||
           f == BuiltinFn::kTextureNumLayers || f == BuiltinFn::kTextureNumLevels ||
           f == BuiltinFn::kTextureNumSamples;
}

bool IsDataPacking(BuiltinFn f) {
    return f == BuiltinFn::kPack4X8Snorm || f == BuiltinFn::kPack4X8Unorm ||
           f == BuiltinFn::kPack2X16Snorm || f == BuiltinFn::kPack2X16Unorm ||
           f == BuiltinFn::kPack2X16Float;
}

bool IsDataUnpacking(BuiltinFn f) {
    return f == BuiltinFn::kUnpack4X8Snorm || f == BuiltinFn::kUnpack4X8Unorm ||
           f == BuiltinFn::kUnpack2X16Snorm || f == BuiltinFn::kUnpack2X16Unorm ||
           f == BuiltinFn::kUnpack2X16Float;
}

bool IsBarrier(BuiltinFn f) {
    return f == BuiltinFn::kWorkgroupBarrier || f == BuiltinFn::kStorageBarrier ||
           f == BuiltinFn::kTextureBarrier;
}

bool IsAtomic(BuiltinFn f) {
    return f == BuiltinFn::kAtomicLoad || f == BuiltinFn::kAtomicStore ||
           f == BuiltinFn::kAtomicAdd || f == BuiltinFn::kAtomicSub ||
           f == BuiltinFn::kAtomicMax || f == BuiltinFn::kAtomicMin ||
           f == BuiltinFn::kAtomicAnd || f == BuiltinFn::kAtomicOr ||
           f == BuiltinFn::kAtomicXor || f == BuiltinFn::kAtomicExchange ||
           f == BuiltinFn::kAtomicCompareExchangeWeak;
}

bool IsPacked4x8IntegerDotProductBuiltin(BuiltinFn f) {
    return f == BuiltinFn::kDot4I8Packed || f == BuiltinFn::kDot4U8Packed ||
           f == BuiltinFn::kPack4XI8 || f == BuiltinFn::kPack4XU8 ||
           f == BuiltinFn::kPack4XI8Clamp || f == BuiltinFn::kPack4XU8Clamp ||
           f == BuiltinFn::kUnpack4XI8 || f == BuiltinFn::kUnpack4XU8;
}

bool IsSubgroup(BuiltinFn f) {
    switch (f) {
        case BuiltinFn::kSubgroupBallot:
        case BuiltinFn::kSubgroupElect:
        case BuiltinFn::kSubgroupBroadcast:
        case BuiltinFn::kSubgroupBroadcastFirst:
        case BuiltinFn::kSubgroupShuffle:
        case BuiltinFn::kSubgroupShuffleXor:
        case BuiltinFn::kSubgroupShuffleUp:
        case BuiltinFn::kSubgroupShuffleDown:
        case BuiltinFn::kSubgroupAdd:
        case BuiltinFn::kSubgroupInclusiveAdd:
        case BuiltinFn::kSubgroupExclusiveAdd:
        case BuiltinFn::kSubgroupMul:
        case BuiltinFn::kSubgroupInclusiveMul:
        case BuiltinFn::kSubgroupExclusiveMul:
        case BuiltinFn::kSubgroupAnd:
        case BuiltinFn::kSubgroupOr:
        case BuiltinFn::kSubgroupXor:
        case BuiltinFn::kSubgroupMin:
        case BuiltinFn::kSubgroupMax:
        case BuiltinFn::kSubgroupAll:
        case BuiltinFn::kSubgroupAny:
        case BuiltinFn::kQuadBroadcast:
        case BuiltinFn::kQuadSwapX:
        case BuiltinFn::kQuadSwapY:
        case BuiltinFn::kQuadSwapDiagonal:
            return true;
        default:
            return false;
    }
}

bool IsQuadSwap(BuiltinFn f) {
    switch (f) {
        case BuiltinFn::kQuadSwapX:
        case BuiltinFn::kQuadSwapY:
        case BuiltinFn::kQuadSwapDiagonal:
            return true;
        default:
            return false;
    }
}

bool HasSideEffects(BuiltinFn f) {
    switch (f) {
        case BuiltinFn::kAtomicAdd:
        case BuiltinFn::kAtomicAnd:
        case BuiltinFn::kAtomicCompareExchangeWeak:
        case BuiltinFn::kAtomicExchange:
        case BuiltinFn::kAtomicMax:
        case BuiltinFn::kAtomicMin:
        case BuiltinFn::kAtomicOr:
        case BuiltinFn::kAtomicStore:
        case BuiltinFn::kAtomicSub:
        case BuiltinFn::kAtomicXor:
        case BuiltinFn::kDpdx:
        case BuiltinFn::kDpdxCoarse:
        case BuiltinFn::kDpdxFine:
        case BuiltinFn::kDpdy:
        case BuiltinFn::kDpdyCoarse:
        case BuiltinFn::kDpdyFine:
        case BuiltinFn::kFwidth:
        case BuiltinFn::kFwidthCoarse:
        case BuiltinFn::kFwidthFine:
        case BuiltinFn::kTextureSample:
        case BuiltinFn::kTextureSampleBias:
        case BuiltinFn::kTextureSampleCompare:
        case BuiltinFn::kTextureStore:
        case BuiltinFn::kWorkgroupUniformLoad:
            return true;
        default:
            break;
    }
    return false;
}

}  // namespace tint::wgsl
