1 //===-- SIDefines.h - SI Helper Macros ----------------------*- 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 /// \file 9 //===----------------------------------------------------------------------===// 10 11 #ifndef SIDEFINES_H_ 12 #define SIDEFINES_H_ 13 14 namespace SIInstrFlags { 15 enum { 16 MIMG = 1 << 3, 17 SMRD = 1 << 4, 18 VOP1 = 1 << 5, 19 VOP2 = 1 << 6, 20 VOP3 = 1 << 7, 21 VOPC = 1 << 8, 22 SALU = 1 << 9 23 }; 24 } 25 26 #define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028 27 #define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C 28 #define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8) 29 #define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128 30 #define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228 31 #define R_00B848_COMPUTE_PGM_RSRC1 0x00B848 32 #define S_00B028_VGPRS(x) (((x) & 0x3F) << 0) 33 #define S_00B028_SGPRS(x) (((x) & 0x0F) << 6) 34 #define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C 35 #define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15) 36 #define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC 37 38 39 #define R_00B848_COMPUTE_PGM_RSRC1 0x00B848 40 #define S_00B848_VGPRS(x) (((x) & 0x3F) << 0) 41 #define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F) 42 #define C_00B848_VGPRS 0xFFFFFFC0 43 #define S_00B848_SGPRS(x) (((x) & 0x0F) << 6) 44 #define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F) 45 #define C_00B848_SGPRS 0xFFFFFC3F 46 #define S_00B848_PRIORITY(x) (((x) & 0x03) << 10) 47 #define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03) 48 #define C_00B848_PRIORITY 0xFFFFF3FF 49 #define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12) 50 #define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF) 51 #define C_00B848_FLOAT_MODE 0xFFF00FFF 52 #define S_00B848_PRIV(x) (((x) & 0x1) << 20) 53 #define G_00B848_PRIV(x) (((x) >> 20) & 0x1) 54 #define C_00B848_PRIV 0xFFEFFFFF 55 #define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21) 56 #define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1) 57 #define C_00B848_DX10_CLAMP 0xFFDFFFFF 58 #define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22) 59 #define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1) 60 #define C_00B848_DEBUG_MODE 0xFFBFFFFF 61 #define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23) 62 #define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1) 63 #define C_00B848_IEEE_MODE 0xFF7FFFFF 64 65 66 // Helpers for setting FLOAT_MODE 67 #define FP_ROUND_ROUND_TO_NEAREST 0 68 #define FP_ROUND_ROUND_TO_INF 1 69 #define FP_ROUND_ROUND_TO_NEGINF 2 70 #define FP_ROUND_ROUND_TO_ZERO 3 71 72 // Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double 73 // precision. 74 #define FP_ROUND_MODE_SP(x) ((x) & 0x3) 75 #define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2) 76 77 #define FP_DENORM_FLUSH_IN_FLUSH_OUT 0 78 #define FP_DENORM_FLUSH_OUT 1 79 #define FP_DENORM_FLUSH_IN 2 80 #define FP_DENORM_FLUSH_NONE 3 81 82 83 // Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double 84 // precision. 85 #define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4) 86 #define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6) 87 88 #endif // SIDEFINES_H_ 89