Path: blob/main/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h
35269 views
//===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8/// \file9/// Contains the definition of a TargetInstrInfo class that is common10/// to all AMD GPUs.11//12//===----------------------------------------------------------------------===//1314#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H15#define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H1617#include "Utils/AMDGPUBaseInfo.h"1819namespace llvm {2021class GCNSubtarget;22class MachineMemOperand;23class MachineInstr;2425class AMDGPUInstrInfo {26public:27explicit AMDGPUInstrInfo(const GCNSubtarget &st);2829static bool isUniformMMO(const MachineMemOperand *MMO);30};3132namespace AMDGPU {3334/// Return the intrinsic ID for opcodes with the G_AMDGPU_INTRIN_ prefix.35///36/// These opcodes have an Intrinsic::ID operand similar to a GIntrinsic. But37/// they are not actual instances of GIntrinsics, so we cannot use38/// GIntrinsic::getIntrinsicID() on them.39Intrinsic::ID getIntrinsicID(const MachineInstr &I);4041struct RsrcIntrinsic {42unsigned Intr;43uint8_t RsrcArg;44bool IsImage;45};46const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr);4748struct D16ImageDimIntrinsic {49unsigned Intr;50unsigned D16HelperIntr;51};52const D16ImageDimIntrinsic *lookupD16ImageDimIntrinsic(unsigned Intr);5354struct ImageDimIntrinsicInfo {55unsigned Intr;56unsigned BaseOpcode;57MIMGDim Dim;5859uint8_t NumOffsetArgs;60uint8_t NumBiasArgs;61uint8_t NumZCompareArgs;62uint8_t NumGradients;63uint8_t NumDmask;64uint8_t NumData;65uint8_t NumVAddrs;66uint8_t NumArgs;6768uint8_t DMaskIndex;69uint8_t VAddrStart;70uint8_t OffsetIndex;71uint8_t BiasIndex;72uint8_t ZCompareIndex;73uint8_t GradientStart;74uint8_t CoordStart;75uint8_t LodIndex;76uint8_t MipIndex;77uint8_t VAddrEnd;78uint8_t RsrcIndex;79uint8_t SampIndex;80uint8_t UnormIndex;81uint8_t TexFailCtrlIndex;82uint8_t CachePolicyIndex;8384uint8_t BiasTyArg;85uint8_t GradientTyArg;86uint8_t CoordTyArg;87};88const ImageDimIntrinsicInfo *getImageDimIntrinsicInfo(unsigned Intr);8990const ImageDimIntrinsicInfo *91getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim);9293} // end AMDGPU namespace94} // End llvm namespace9596#endif979899