1 //===-- R600Defines.h - R600 Helper Macros ----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef R600DEFINES_H_
12 #define R600DEFINES_H_
14 #include "llvm/MC/MCRegisterInfo.h"
17 #define MO_FLAG_CLAMP (1 << 0)
18 #define MO_FLAG_NEG (1 << 1)
19 #define MO_FLAG_ABS (1 << 2)
20 #define MO_FLAG_MASK (1 << 3)
21 #define MO_FLAG_PUSH (1 << 4)
22 #define MO_FLAG_NOT_LAST (1 << 5)
23 #define MO_FLAG_LAST (1 << 6)
24 #define NUM_MO_FLAGS 7
26 /// \brief Helper for getting the operand index for the instruction flags
28 #define GET_FLAG_OPERAND_IDX(Flags) (((Flags) >> 7) & 0x3)
30 namespace R600_InstFlag {
32 TRANS_ONLY = (1 << 0),
39 //FlagOperand bits 7, 8
40 NATIVE_OPERANDS = (1 << 9),
49 #define HAS_NATIVE_OPERANDS(Flags) ((Flags) & R600_InstFlag::NATIVE_OPERANDS)
51 /// \brief Defines for extracting register infomation from register encoding
52 #define HW_REG_MASK 0x1ff
53 #define HW_CHAN_SHIFT 9
55 #define GET_REG_CHAN(reg) ((reg) >> HW_CHAN_SHIFT)
56 #define GET_REG_INDEX(reg) ((reg) & HW_REG_MASK)
58 #define IS_VTX(desc) ((desc).TSFlags & R600_InstFlag::VTX_INST)
59 #define IS_TEX(desc) ((desc).TSFlags & R600_InstFlag::TEX_INST)
139 //===----------------------------------------------------------------------===//
140 // Config register definitions
141 //===----------------------------------------------------------------------===//
143 #define R_02880C_DB_SHADER_CONTROL 0x02880C
144 #define S_02880C_KILL_ENABLE(x) (((x) & 0x1) << 6)
146 // These fields are the same for all shader types and families.
147 #define S_NUM_GPRS(x) (((x) & 0xFF) << 0)
148 #define S_STACK_SIZE(x) (((x) & 0xFF) << 8)
149 //===----------------------------------------------------------------------===//
150 // R600, R700 Registers
151 //===----------------------------------------------------------------------===//
153 #define R_028850_SQ_PGM_RESOURCES_PS 0x028850
154 #define R_028868_SQ_PGM_RESOURCES_VS 0x028868
156 //===----------------------------------------------------------------------===//
157 // Evergreen, Northern Islands Registers
158 //===----------------------------------------------------------------------===//
160 #define R_028844_SQ_PGM_RESOURCES_PS 0x028844
161 #define R_028860_SQ_PGM_RESOURCES_VS 0x028860
162 #define R_028878_SQ_PGM_RESOURCES_GS 0x028878
163 #define R_0288D4_SQ_PGM_RESOURCES_LS 0x0288d4
165 #endif // R600DEFINES_H_