LLVM  14.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 MachineFunction;
24 class MachineInstr;
25 class MachineInstrBuilder;
26 class MachineMemOperand;
27 
29 public:
30  explicit AMDGPUInstrInfo(const GCNSubtarget &st);
31 
32  static bool isUniformMMO(const MachineMemOperand *MMO);
33 };
34 
35 namespace AMDGPU {
36 
37 struct RsrcIntrinsic {
38  unsigned Intr;
39  uint8_t RsrcArg;
40  bool IsImage;
41 };
42 const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr);
43 
45  unsigned Intr;
46  unsigned D16HelperIntr;
47 };
49 
51  unsigned Intr;
52  unsigned BaseOpcode;
53  MIMGDim Dim;
54 
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 GradientStart;
64  uint8_t CoordStart;
65  uint8_t LodIndex;
66  uint8_t MipIndex;
67  uint8_t VAddrEnd;
68  uint8_t RsrcIndex;
69  uint8_t SampIndex;
70  uint8_t UnormIndex;
73 
74  uint8_t GradientTyArg;
75  uint8_t CoordTyArg;
76 };
78 
80 getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim);
81 
82 } // end AMDGPU namespace
83 } // End llvm namespace
84 
85 #endif
llvm::AMDGPU::ImageDimIntrinsicInfo::NumVAddrs
uint8_t NumVAddrs
Definition: AMDGPUInstrInfo.h:58
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::AMDGPU::ImageDimIntrinsicInfo::CoordTyArg
uint8_t CoordTyArg
Definition: AMDGPUInstrInfo.h:75
llvm::AMDGPU::ImageDimIntrinsicInfo::NumArgs
uint8_t NumArgs
Definition: AMDGPUInstrInfo.h:59
llvm::AMDGPU::ImageDimIntrinsicInfo
Definition: AMDGPUInstrInfo.h:50
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:68
llvm::MachineMemOperand
A description of a memory reference used in the backend.
Definition: MachineMemOperand.h:128
llvm::AMDGPU::ImageDimIntrinsicInfo::GradientTyArg
uint8_t GradientTyArg
Definition: AMDGPUInstrInfo.h:74
llvm::GCNSubtarget
Definition: GCNSubtarget.h:31
llvm::AMDGPU::D16ImageDimIntrinsic::D16HelperIntr
unsigned D16HelperIntr
Definition: AMDGPUInstrInfo.h:46
llvm::AMDGPU::ImageDimIntrinsicInfo::BaseOpcode
unsigned BaseOpcode
Definition: AMDGPUInstrInfo.h:52
llvm::AMDGPU::ImageDimIntrinsicInfo::CachePolicyIndex
uint8_t CachePolicyIndex
Definition: AMDGPUInstrInfo.h:72
llvm::AMDGPU::ImageDimIntrinsicInfo::Dim
MIMGDim Dim
Definition: AMDGPUInstrInfo.h:53
Intr
unsigned Intr
Definition: AMDGPUBaseInfo.cpp:2005
llvm::AMDGPU::ImageDimIntrinsicInfo::CoordStart
uint8_t CoordStart
Definition: AMDGPUInstrInfo.h:64
llvm::AMDGPU::D16ImageDimIntrinsic::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:45
llvm::AMDGPU::ImageDimIntrinsicInfo::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:51
llvm::AMDGPU::RsrcIntrinsic::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:38
llvm::AMDGPU::ImageDimIntrinsicInfo::SampIndex
uint8_t SampIndex
Definition: AMDGPUInstrInfo.h:69
llvm::AMDGPU::ImageDimIntrinsicInfo::NumDmask
uint8_t NumDmask
Definition: AMDGPUInstrInfo.h:56
llvm::AMDGPU::ImageDimIntrinsicInfo::TexFailCtrlIndex
uint8_t TexFailCtrlIndex
Definition: AMDGPUInstrInfo.h:71
llvm::AMDGPU::ImageDimIntrinsicInfo::LodIndex
uint8_t LodIndex
Definition: AMDGPUInstrInfo.h:65
llvm::AMDGPU::getImageDimIntrinsicByBaseOpcode
const ImageDimIntrinsicInfo * getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim)
llvm::AMDGPU::ImageDimIntrinsicInfo::MipIndex
uint8_t MipIndex
Definition: AMDGPUInstrInfo.h:66
llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrEnd
uint8_t VAddrEnd
Definition: AMDGPUInstrInfo.h:67
llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrStart
uint8_t VAddrStart
Definition: AMDGPUInstrInfo.h:62
llvm::AMDGPU::RsrcIntrinsic::IsImage
bool IsImage
Definition: AMDGPUInstrInfo.h:40
llvm::AMDGPU::lookupRsrcIntrinsic
const RsrcIntrinsic * lookupRsrcIntrinsic(unsigned Intr)
llvm::AMDGPU::RsrcIntrinsic::RsrcArg
uint8_t RsrcArg
Definition: AMDGPUInstrInfo.h:39
llvm::AMDGPU::ImageDimIntrinsicInfo::UnormIndex
uint8_t UnormIndex
Definition: AMDGPUInstrInfo.h:70
llvm::AMDGPU::D16ImageDimIntrinsic
Definition: AMDGPUInstrInfo.h:44
llvm::AMDGPU::getImageDimIntrinsicInfo
const ImageDimIntrinsicInfo * getImageDimIntrinsicInfo(unsigned Intr)
llvm::AMDGPUInstrInfo
Definition: AMDGPUInstrInfo.h:28
llvm::AMDGPU::ImageDimIntrinsicInfo::GradientStart
uint8_t GradientStart
Definition: AMDGPUInstrInfo.h:63
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:37
llvm::AMDGPU::ImageDimIntrinsicInfo::NumGradients
uint8_t NumGradients
Definition: AMDGPUInstrInfo.h:55
AMDGPUBaseInfo.h