Tom Stellard | 347ac79 | 2015-06-26 21:15:07 +0000 | [diff] [blame] | 1 | //===-- AMDGPUBaseInfo.h - Top level definitions for AMDGPU -----*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H |
| 11 | #define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H |
| 12 | |
| 13 | #include "AMDKernelCodeT.h" |
| 14 | |
| 15 | namespace llvm { |
| 16 | |
| 17 | class FeatureBitset; |
Tom Stellard | ac00eb5 | 2015-12-15 16:26:16 +0000 | [diff] [blame] | 18 | class Function; |
Tom Stellard | e3b5aea | 2015-12-02 17:00:42 +0000 | [diff] [blame] | 19 | class GlobalValue; |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 20 | class MCContext; |
| 21 | class MCSection; |
Tom Stellard | 2b65ed3 | 2015-12-21 18:44:27 +0000 | [diff] [blame] | 22 | class MCSubtargetInfo; |
Tom Stellard | 347ac79 | 2015-06-26 21:15:07 +0000 | [diff] [blame] | 23 | |
| 24 | namespace AMDGPU { |
| 25 | |
| 26 | struct IsaVersion { |
| 27 | unsigned Major; |
| 28 | unsigned Minor; |
| 29 | unsigned Stepping; |
| 30 | }; |
| 31 | |
| 32 | IsaVersion getIsaVersion(const FeatureBitset &Features); |
Tom Stellard | ff7416b | 2015-06-26 21:58:31 +0000 | [diff] [blame] | 33 | void initDefaultAMDKernelCodeT(amd_kernel_code_t &Header, |
| 34 | const FeatureBitset &Features); |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 35 | MCSection *getHSATextSection(MCContext &Ctx); |
Tom Stellard | 347ac79 | 2015-06-26 21:15:07 +0000 | [diff] [blame] | 36 | |
Tom Stellard | 00f2f91 | 2015-12-02 19:47:57 +0000 | [diff] [blame] | 37 | MCSection *getHSADataGlobalAgentSection(MCContext &Ctx); |
| 38 | |
| 39 | MCSection *getHSADataGlobalProgramSection(MCContext &Ctx); |
| 40 | |
Tom Stellard | 9760f03 | 2015-12-03 03:34:32 +0000 | [diff] [blame] | 41 | MCSection *getHSARodataReadonlyAgentSection(MCContext &Ctx); |
| 42 | |
Tom Stellard | e3b5aea | 2015-12-02 17:00:42 +0000 | [diff] [blame] | 43 | bool isGroupSegment(const GlobalValue *GV); |
Tom Stellard | 00f2f91 | 2015-12-02 19:47:57 +0000 | [diff] [blame] | 44 | bool isGlobalSegment(const GlobalValue *GV); |
| 45 | bool isReadOnlySegment(const GlobalValue *GV); |
Tom Stellard | e3b5aea | 2015-12-02 17:00:42 +0000 | [diff] [blame] | 46 | |
Tom Stellard | ac00eb5 | 2015-12-15 16:26:16 +0000 | [diff] [blame] | 47 | unsigned getShaderType(const Function &F); |
Marek Olsak | fccabaf | 2016-01-13 11:45:36 +0000 | [diff] [blame] | 48 | unsigned getInitialPSInputAddr(const Function &F); |
| 49 | |
Tom Stellard | ac00eb5 | 2015-12-15 16:26:16 +0000 | [diff] [blame] | 50 | |
Tom Stellard | 2b65ed3 | 2015-12-21 18:44:27 +0000 | [diff] [blame] | 51 | bool isSI(const MCSubtargetInfo &STI); |
| 52 | bool isCI(const MCSubtargetInfo &STI); |
| 53 | bool isVI(const MCSubtargetInfo &STI); |
| 54 | |
| 55 | /// If \p Reg is a pseudo reg, return the correct hardware register given |
| 56 | /// \p STI otherwise return \p Reg. |
| 57 | unsigned getMCReg(unsigned Reg, const MCSubtargetInfo &STI); |
| 58 | |
Tom Stellard | 347ac79 | 2015-06-26 21:15:07 +0000 | [diff] [blame] | 59 | } // end namespace AMDGPU |
| 60 | } // end namespace llvm |
| 61 | |
| 62 | #endif |