LLVM  16.0.0git
AMDGPUInstrInfo.h
Go to the documentation of this file.
1 //===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// Contains the definition of a TargetInstrInfo class that is common
11 /// to all AMD GPUs.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
17 
18 #include "Utils/AMDGPUBaseInfo.h"
19 
20 namespace llvm {
21 
22 class GCNSubtarget;
23 class MachineMemOperand;
24 
26 public:
27  explicit AMDGPUInstrInfo(const GCNSubtarget &st);
28 
29  static bool isUniformMMO(const MachineMemOperand *MMO);
30 };
31 
32 namespace AMDGPU {
33 
34 struct RsrcIntrinsic {
35  unsigned Intr;
36  uint8_t RsrcArg;
37  bool IsImage;
38 };
39 const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr);
40 
42  unsigned Intr;
43  unsigned D16HelperIntr;
44 };
46 
48  unsigned Intr;
49  unsigned BaseOpcode;
50  MIMGDim Dim;
51 
52  uint8_t NumOffsetArgs;
53  uint8_t NumBiasArgs;
54  uint8_t NumZCompareArgs;
55  uint8_t NumGradients;
56  uint8_t NumDmask;
57  uint8_t NumData;
58  uint8_t NumVAddrs;
59  uint8_t NumArgs;
60 
61  uint8_t DMaskIndex;
62  uint8_t VAddrStart;
63  uint8_t OffsetIndex;
64  uint8_t BiasIndex;
65  uint8_t ZCompareIndex;
66  uint8_t GradientStart;
67  uint8_t CoordStart;
68  uint8_t LodIndex;
69  uint8_t MipIndex;
70  uint8_t VAddrEnd;
71  uint8_t RsrcIndex;
72  uint8_t SampIndex;
73  uint8_t UnormIndex;
76 
77  uint8_t BiasTyArg;
78  uint8_t GradientTyArg;
79  uint8_t CoordTyArg;
80 };
82 
84 getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim);
85 
86 } // end AMDGPU namespace
87 } // End llvm namespace
88 
89 #endif
llvm::AMDGPU::ImageDimIntrinsicInfo::NumVAddrs
uint8_t NumVAddrs
Definition: AMDGPUInstrInfo.h:58
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::AMDGPU::ImageDimIntrinsicInfo::CoordTyArg
uint8_t CoordTyArg
Definition: AMDGPUInstrInfo.h:79
llvm::AMDGPU::ImageDimIntrinsicInfo::NumArgs
uint8_t NumArgs
Definition: AMDGPUInstrInfo.h:59
llvm::AMDGPU::ImageDimIntrinsicInfo
Definition: AMDGPUInstrInfo.h:47
llvm::AMDGPUInstrInfo::AMDGPUInstrInfo
AMDGPUInstrInfo(const GCNSubtarget &st)
Definition: AMDGPUInstrInfo.cpp:27
llvm::AMDGPUInstrInfo::isUniformMMO
static bool isUniformMMO(const MachineMemOperand *MMO)
Definition: AMDGPUInstrInfo.cpp:31
llvm::AMDGPU::ImageDimIntrinsicInfo::RsrcIndex
uint8_t RsrcIndex
Definition: AMDGPUInstrInfo.h:71
llvm::AMDGPU::ImageDimIntrinsicInfo::OffsetIndex
uint8_t OffsetIndex
Definition: AMDGPUInstrInfo.h:63
llvm::AMDGPU::ImageDimIntrinsicInfo::NumBiasArgs
uint8_t NumBiasArgs
Definition: AMDGPUInstrInfo.h:53
llvm::MachineMemOperand
A description of a memory reference used in the backend.
Definition: MachineMemOperand.h:127
llvm::AMDGPU::ImageDimIntrinsicInfo::GradientTyArg
uint8_t GradientTyArg
Definition: AMDGPUInstrInfo.h:78
llvm::GCNSubtarget
Definition: GCNSubtarget.h:31
llvm::AMDGPU::D16ImageDimIntrinsic::D16HelperIntr
unsigned D16HelperIntr
Definition: AMDGPUInstrInfo.h:43
llvm::AMDGPU::ImageDimIntrinsicInfo::BaseOpcode
unsigned BaseOpcode
Definition: AMDGPUInstrInfo.h:49
llvm::AMDGPU::ImageDimIntrinsicInfo::CachePolicyIndex
uint8_t CachePolicyIndex
Definition: AMDGPUInstrInfo.h:75
llvm::AMDGPU::ImageDimIntrinsicInfo::Dim
MIMGDim Dim
Definition: AMDGPUInstrInfo.h:50
llvm::AMDGPU::ImageDimIntrinsicInfo::BiasIndex
uint8_t BiasIndex
Definition: AMDGPUInstrInfo.h:64
Intr
unsigned Intr
Definition: AMDGPUBaseInfo.cpp:2491
llvm::AMDGPU::ImageDimIntrinsicInfo::BiasTyArg
uint8_t BiasTyArg
Definition: AMDGPUInstrInfo.h:77
llvm::AMDGPU::ImageDimIntrinsicInfo::CoordStart
uint8_t CoordStart
Definition: AMDGPUInstrInfo.h:67
AMDGPU
Definition: AMDGPUReplaceLDSUseWithPointer.cpp:114
llvm::AMDGPU::ImageDimIntrinsicInfo::NumZCompareArgs
uint8_t NumZCompareArgs
Definition: AMDGPUInstrInfo.h:54
llvm::AMDGPU::D16ImageDimIntrinsic::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:42
llvm::AMDGPU::ImageDimIntrinsicInfo::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:48
llvm::AMDGPU::RsrcIntrinsic::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:35
llvm::AMDGPU::ImageDimIntrinsicInfo::SampIndex
uint8_t SampIndex
Definition: AMDGPUInstrInfo.h:72
llvm::AMDGPU::ImageDimIntrinsicInfo::NumDmask
uint8_t NumDmask
Definition: AMDGPUInstrInfo.h:56
llvm::AMDGPU::ImageDimIntrinsicInfo::TexFailCtrlIndex
uint8_t TexFailCtrlIndex
Definition: AMDGPUInstrInfo.h:74
llvm::AMDGPU::ImageDimIntrinsicInfo::LodIndex
uint8_t LodIndex
Definition: AMDGPUInstrInfo.h:68
llvm::AMDGPU::getImageDimIntrinsicByBaseOpcode
const ImageDimIntrinsicInfo * getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim)
llvm::AMDGPU::ImageDimIntrinsicInfo::MipIndex
uint8_t MipIndex
Definition: AMDGPUInstrInfo.h:69
llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrEnd
uint8_t VAddrEnd
Definition: AMDGPUInstrInfo.h:70
llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrStart
uint8_t VAddrStart
Definition: AMDGPUInstrInfo.h:62
llvm::AMDGPU::RsrcIntrinsic::IsImage
bool IsImage
Definition: AMDGPUInstrInfo.h:37
llvm::AMDGPU::lookupRsrcIntrinsic
const RsrcIntrinsic * lookupRsrcIntrinsic(unsigned Intr)
llvm::AMDGPU::RsrcIntrinsic::RsrcArg
uint8_t RsrcArg
Definition: AMDGPUInstrInfo.h:36
llvm::AMDGPU::ImageDimIntrinsicInfo::UnormIndex
uint8_t UnormIndex
Definition: AMDGPUInstrInfo.h:73
llvm::AMDGPU::ImageDimIntrinsicInfo::ZCompareIndex
uint8_t ZCompareIndex
Definition: AMDGPUInstrInfo.h:65
llvm::AMDGPU::D16ImageDimIntrinsic
Definition: AMDGPUInstrInfo.h:41
llvm::AMDGPU::getImageDimIntrinsicInfo
const ImageDimIntrinsicInfo * getImageDimIntrinsicInfo(unsigned Intr)
llvm::AMDGPUInstrInfo
Definition: AMDGPUInstrInfo.h:25
llvm::AMDGPU::ImageDimIntrinsicInfo::NumOffsetArgs
uint8_t NumOffsetArgs
Definition: AMDGPUInstrInfo.h:52
llvm::AMDGPU::ImageDimIntrinsicInfo::GradientStart
uint8_t GradientStart
Definition: AMDGPUInstrInfo.h:66
llvm::AMDGPU::lookupD16ImageDimIntrinsic
const D16ImageDimIntrinsic * lookupD16ImageDimIntrinsic(unsigned Intr)
llvm::AMDGPU::ImageDimIntrinsicInfo::NumData
uint8_t NumData
Definition: AMDGPUInstrInfo.h:57
llvm::AMDGPU::ImageDimIntrinsicInfo::DMaskIndex
uint8_t DMaskIndex
Definition: AMDGPUInstrInfo.h:61
llvm::AMDGPU::RsrcIntrinsic
Definition: AMDGPUInstrInfo.h:34
llvm::AMDGPU::ImageDimIntrinsicInfo::NumGradients
uint8_t NumGradients
Definition: AMDGPUInstrInfo.h:55
AMDGPUBaseInfo.h