| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===// |
| 2 | // |
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | /// \file |
| Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 10 | /// Contains the definition of a TargetInstrInfo class that is common |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 11 | /// to all AMD GPUs. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| Matt Arsenault | 6b6a2c3 | 2016-03-11 08:00:27 +0000 | [diff] [blame] | 15 | #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H |
| 16 | #define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 17 | |
| Yaxun Liu | 1a14bfa | 2017-03-27 14:04:01 +0000 | [diff] [blame] | 18 | #include "AMDGPU.h" |
| Sam Kolton | a3ec5c1 | 2016-10-07 14:46:06 +0000 | [diff] [blame] | 19 | #include "Utils/AMDGPUBaseInfo.h" |
| David Blaikie | 3f833ed | 2017-11-08 01:01:31 +0000 | [diff] [blame] | 20 | #include "llvm/CodeGen/TargetInstrInfo.h" |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 21 | |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 22 | namespace llvm { |
| 23 | |
| Tom Stellard | 5bfbae5 | 2018-07-11 20:59:01 +0000 | [diff] [blame] | 24 | class GCNSubtarget; |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 25 | class MachineFunction; |
| 26 | class MachineInstr; |
| 27 | class MachineInstrBuilder; |
| 28 | |
| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 29 | class AMDGPUInstrInfo { |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 30 | public: |
| Tom Stellard | 5bfbae5 | 2018-07-11 20:59:01 +0000 | [diff] [blame] | 31 | explicit AMDGPUInstrInfo(const GCNSubtarget &st); |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 32 | |
| Matt Arsenault | bcf7bec | 2018-02-09 16:57:48 +0000 | [diff] [blame] | 33 | static bool isUniformMMO(const MachineMemOperand *MMO); |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 34 | }; |
| Nicolai Haehnle | 5d0d303 | 2018-04-01 17:09:07 +0000 | [diff] [blame] | 35 | |
| 36 | namespace AMDGPU { |
| 37 | |
| 38 | struct RsrcIntrinsic { |
| 39 | unsigned Intr; |
| 40 | uint8_t RsrcArg; |
| 41 | bool IsImage; |
| 42 | }; |
| Nicolai Haehnle | e741d7e | 2018-06-21 13:36:33 +0000 | [diff] [blame] | 43 | const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr); |
| Nicolai Haehnle | 5d0d303 | 2018-04-01 17:09:07 +0000 | [diff] [blame] | 44 | |
| Nicolai Haehnle | 2f5a738 | 2018-04-04 10:58:54 +0000 | [diff] [blame] | 45 | struct D16ImageDimIntrinsic { |
| 46 | unsigned Intr; |
| 47 | unsigned D16HelperIntr; |
| 48 | }; |
| Nicolai Haehnle | e741d7e | 2018-06-21 13:36:33 +0000 | [diff] [blame] | 49 | const D16ImageDimIntrinsic *lookupD16ImageDimIntrinsic(unsigned Intr); |
| Nicolai Haehnle | 2f5a738 | 2018-04-04 10:58:54 +0000 | [diff] [blame] | 50 | |
| Nicolai Haehnle | 7a9c03f | 2018-06-21 13:36:57 +0000 | [diff] [blame] | 51 | struct ImageDimIntrinsicInfo { |
| 52 | unsigned Intr; |
| 53 | unsigned BaseOpcode; |
| 54 | MIMGDim Dim; |
| 55 | }; |
| 56 | const ImageDimIntrinsicInfo *getImageDimIntrinsicInfo(unsigned Intr); |
| 57 | |
| Nicolai Haehnle | 5d0d303 | 2018-04-01 17:09:07 +0000 | [diff] [blame] | 58 | } // end AMDGPU namespace |
| Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 59 | } // End llvm namespace |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 60 | |
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 61 | #endif |