// Copyright 2024 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

////////////////////////////////////////////////////////////////////////////////
// File generated by 'tools/src/cmd/gen' using the template:
//   src/tint/lang/hlsl/builtin_fn.cc.tmpl
//
// To regenerate run: './tools/run gen'
//
//                       Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////

#include "src/tint/lang/hlsl/builtin_fn.h"

namespace tint::hlsl {

const char* str(BuiltinFn i) {
    switch (i) {
        case BuiltinFn::kNone:
            return "<none>";
        case BuiltinFn::kAsint:
            return "asint";
        case BuiltinFn::kAsuint:
            return "asuint";
        case BuiltinFn::kAsfloat:
            return "asfloat";
        case BuiltinFn::kDot4AddI8Packed:
            return "dot4add_i8packed";
        case BuiltinFn::kDot4AddU8Packed:
            return "dot4add_u8packed";
        case BuiltinFn::kF32Tof16:
            return "f32tof16";
        case BuiltinFn::kF16Tof32:
            return "f16tof32";
        case BuiltinFn::kInterlockedCompareExchange:
            return "InterlockedCompareExchange";
        case BuiltinFn::kInterlockedExchange:
            return "InterlockedExchange";
        case BuiltinFn::kInterlockedAdd:
            return "InterlockedAdd";
        case BuiltinFn::kInterlockedMax:
            return "InterlockedMax";
        case BuiltinFn::kInterlockedMin:
            return "InterlockedMin";
        case BuiltinFn::kInterlockedAnd:
            return "InterlockedAnd";
        case BuiltinFn::kInterlockedOr:
            return "InterlockedOr";
        case BuiltinFn::kInterlockedXor:
            return "InterlockedXor";
        case BuiltinFn::kMul:
            return "mul";
        case BuiltinFn::kPackU8:
            return "pack_u8";
        case BuiltinFn::kPackS8:
            return "pack_s8";
        case BuiltinFn::kPackClampS8:
            return "pack_clamp_s8";
        case BuiltinFn::kSign:
            return "sign";
        case BuiltinFn::kTextureStore:
            return "textureStore";
        case BuiltinFn::kUnpackS8S32:
            return "unpack_s8s32";
        case BuiltinFn::kUnpackU8U32:
            return "unpack_u8u32";
        case BuiltinFn::kWaveGetLaneIndex:
            return "WaveGetLaneIndex";
        case BuiltinFn::kWaveGetLaneCount:
            return "WaveGetLaneCount";
        case BuiltinFn::kWaveReadLaneAt:
            return "WaveReadLaneAt";
        case BuiltinFn::kLoad:
            return "Load";
        case BuiltinFn::kLoad2:
            return "Load2";
        case BuiltinFn::kLoad3:
            return "Load3";
        case BuiltinFn::kLoad4:
            return "Load4";
        case BuiltinFn::kLoadF16:
            return "LoadF16";
        case BuiltinFn::kLoad2F16:
            return "Load2F16";
        case BuiltinFn::kLoad3F16:
            return "Load3F16";
        case BuiltinFn::kLoad4F16:
            return "Load4F16";
        case BuiltinFn::kStore:
            return "Store";
        case BuiltinFn::kStore2:
            return "Store2";
        case BuiltinFn::kStore3:
            return "Store3";
        case BuiltinFn::kStore4:
            return "Store4";
        case BuiltinFn::kStoreF16:
            return "StoreF16";
        case BuiltinFn::kStore2F16:
            return "Store2F16";
        case BuiltinFn::kStore3F16:
            return "Store3F16";
        case BuiltinFn::kStore4F16:
            return "Store4F16";
        case BuiltinFn::kGatherCmp:
            return "GatherCmp";
        case BuiltinFn::kGather:
            return "Gather";
        case BuiltinFn::kGatherAlpha:
            return "GatherAlpha";
        case BuiltinFn::kGatherBlue:
            return "GatherBlue";
        case BuiltinFn::kGatherGreen:
            return "GatherGreen";
        case BuiltinFn::kGatherRed:
            return "GatherRed";
        case BuiltinFn::kGetDimensions:
            return "GetDimensions";
        case BuiltinFn::kSample:
            return "Sample";
        case BuiltinFn::kSampleBias:
            return "SampleBias";
        case BuiltinFn::kSampleCmp:
            return "SampleCmp";
        case BuiltinFn::kSampleCmpLevelZero:
            return "SampleCmpLevelZero";
        case BuiltinFn::kSampleGrad:
            return "SampleGrad";
        case BuiltinFn::kSampleLevel:
            return "SampleLevel";
    }
    return "<unknown>";
}

}  // namespace tint::hlsl
