chromium/third_party/spirv-tools/src/source/opcode.cpp

// Copyright (c) 2015-2022 The Khronos Group Inc.
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights
// reserved.
//
// 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.

#include "source/opcode.h"

#include <assert.h>
#include <string.h>

#include <algorithm>
#include <cstdlib>

#include "source/instruction.h"
#include "source/macro.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
#include "source/spirv_target_env.h"
#include "spirv-tools/libspirv.h"

namespace {
struct OpcodeDescPtrLen {};

#include "core.insts-unified1.inc"

static const spv_opcode_table_t kOpcodeTable =;

// Represents a vendor tool entry in the SPIR-V XML Registry.
struct VendorTool {};

const VendorTool vendor_tools[] =;

}  // anonymous namespace

// TODO(dneto): Move this to another file.  It doesn't belong with opcode
// processing.
const char* spvGeneratorStr(uint32_t generator) {}

uint32_t spvOpcodeMake(uint16_t wordCount, spv::Op opcode) {}

void spvOpcodeSplit(const uint32_t word, uint16_t* pWordCount,
                    uint16_t* pOpcode) {}

spv_result_t spvOpcodeTableGet(spv_opcode_table* pInstTable, spv_target_env) {}

spv_result_t spvOpcodeTableNameLookup(spv_target_env env,
                                      const spv_opcode_table table,
                                      const char* name,
                                      spv_opcode_desc* pEntry) {}

spv_result_t spvOpcodeTableValueLookup(spv_target_env env,
                                       const spv_opcode_table table,
                                       const spv::Op opcode,
                                       spv_opcode_desc* pEntry) {}

void spvInstructionCopy(const uint32_t* words, const spv::Op opcode,
                        const uint16_t wordCount, const spv_endianness_t endian,
                        spv_instruction_t* pInst) {}

const char* spvOpcodeString(const uint32_t opcode) {}

const char* spvOpcodeString(const spv::Op opcode) {}

int32_t spvOpcodeIsScalarType(const spv::Op opcode) {}

int32_t spvOpcodeIsSpecConstant(const spv::Op opcode) {}

int32_t spvOpcodeIsConstant(const spv::Op opcode) {}

bool spvOpcodeIsConstantOrUndef(const spv::Op opcode) {}

bool spvOpcodeIsScalarSpecConstant(const spv::Op opcode) {}

int32_t spvOpcodeIsComposite(const spv::Op opcode) {}

bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode) {}

int32_t spvOpcodeReturnsLogicalPointer(const spv::Op opcode) {}

int32_t spvOpcodeGeneratesType(spv::Op op) {}

bool spvOpcodeIsDecoration(const spv::Op opcode) {}

bool spvOpcodeIsLoad(const spv::Op opcode) {}

bool spvOpcodeIsBranch(spv::Op opcode) {}

bool spvOpcodeIsAtomicWithLoad(const spv::Op opcode) {}

bool spvOpcodeIsAtomicOp(const spv::Op opcode) {}

bool spvOpcodeIsReturn(spv::Op opcode) {}

bool spvOpcodeIsAbort(spv::Op opcode) {}

bool spvOpcodeIsReturnOrAbort(spv::Op opcode) {}

bool spvOpcodeIsBlockTerminator(spv::Op opcode) {}

bool spvOpcodeIsBaseOpaqueType(spv::Op opcode) {}

bool spvOpcodeIsNonUniformGroupOperation(spv::Op opcode) {}

bool spvOpcodeIsScalarizable(spv::Op opcode) {}

bool spvOpcodeIsDebug(spv::Op opcode) {}

bool spvOpcodeIsCommutativeBinaryOperator(spv::Op opcode) {}

bool spvOpcodeIsLinearAlgebra(spv::Op opcode) {}

bool spvOpcodeIsImageSample(const spv::Op opcode) {}

bool spvIsExtendedInstruction(const spv::Op opcode) {}

std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode) {}

bool spvOpcodeIsAccessChain(spv::Op opcode) {}

bool spvOpcodeIsBit(spv::Op opcode) {}

bool spvOpcodeGeneratesUntypedPointer(spv::Op opcode) {}