]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AMDGPU / AMDGPUInstrInfo.h
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 "AMDGPU.h"
19 #include "Utils/AMDGPUBaseInfo.h"
20 #include "llvm/CodeGen/TargetInstrInfo.h"
21
22 namespace llvm {
23
24 class GCNSubtarget;
25 class MachineFunction;
26 class MachineInstr;
27 class MachineInstrBuilder;
28
29 class AMDGPUInstrInfo {
30 public:
31   explicit AMDGPUInstrInfo(const GCNSubtarget &st);
32
33   static bool isUniformMMO(const MachineMemOperand *MMO);
34 };
35
36 namespace AMDGPU {
37
38 struct RsrcIntrinsic {
39   unsigned Intr;
40   uint8_t RsrcArg;
41   bool IsImage;
42 };
43 const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr);
44
45 struct D16ImageDimIntrinsic {
46   unsigned Intr;
47   unsigned D16HelperIntr;
48 };
49 const D16ImageDimIntrinsic *lookupD16ImageDimIntrinsic(unsigned Intr);
50
51 struct ImageDimIntrinsicInfo {
52   unsigned Intr;
53   unsigned BaseOpcode;
54   MIMGDim Dim;
55 };
56 const ImageDimIntrinsicInfo *getImageDimIntrinsicInfo(unsigned Intr);
57
58 } // end AMDGPU namespace
59 } // End llvm namespace
60
61 #endif