diff options
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIDefines.h')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIDefines.h | 118 |
1 files changed, 62 insertions, 56 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIDefines.h b/llvm/lib/Target/AMDGPU/SIDefines.h index 479c6fc2148..6bb31a9a781 100644 --- a/llvm/lib/Target/AMDGPU/SIDefines.h +++ b/llvm/lib/Target/AMDGPU/SIDefines.h @@ -13,45 +13,78 @@ #ifndef LLVM_LIB_TARGET_AMDGPU_SIDEFINES_H #define LLVM_LIB_TARGET_AMDGPU_SIDEFINES_H +namespace llvm { + namespace SIInstrFlags { // This needs to be kept in sync with the field bits in InstSI. -enum : uint32_t { - SALU = 1 << 3, - VALU = 1 << 4, - - SOP1 = 1 << 5, - SOP2 = 1 << 6, - SOPC = 1 << 7, - SOPK = 1 << 8, - SOPP = 1 << 9, - - VOP1 = 1 << 10, - VOP2 = 1 << 11, - VOP3 = 1 << 12, - VOPC = 1 << 13, +enum : uint64_t { + // Low bits - basic encoding information. + SALU = 1 << 0, + VALU = 1 << 1, + + // SALU instruction formats. + SOP1 = 1 << 2, + SOP2 = 1 << 3, + SOPC = 1 << 4, + SOPK = 1 << 5, + SOPP = 1 << 6, + + // VALU instruction formats. + VOP1 = 1 << 7, + VOP2 = 1 << 8, + VOPC = 1 << 9, + + // TODO: Should this be spilt into VOP3 a and b? + VOP3 = 1 << 10, + + VINTRP = 1 << 13, SDWA = 1 << 14, DPP = 1 << 15, + // Memory instruction formats. MUBUF = 1 << 16, MTBUF = 1 << 17, SMRD = 1 << 18, - DS = 1 << 19, - MIMG = 1 << 20, + MIMG = 1 << 19, + EXP = 1 << 20, FLAT = 1 << 21, - EXP = 1 << 22, - WQM = 1 << 23, - VGPRSpill = 1 << 24, - SGPRSpill = 1 << 25, - VOPAsmPrefer32Bit = 1 << 26, - Gather4 = 1 << 27, - DisableWQM = 1 << 28, - SOPK_ZEXT = 1 << 29, - SCALAR_STORE = 1 << 30, - FIXED_SIZE = 1u << 31 + DS = 1 << 22, + + // Pseudo instruction formats. + VGPRSpill = 1 << 23, + SGPRSpill = 1 << 24, + + // High bits - other information. + VM_CNT = UINT64_C(1) << 32, + EXP_CNT = UINT64_C(1) << 33, + LGKM_CNT = UINT64_C(1) << 34, + + WQM = UINT64_C(1) << 35, + DisableWQM = UINT64_C(1) << 36, + Gather4 = UINT64_C(1) << 37, + SOPK_ZEXT = UINT64_C(1) << 38, + SCALAR_STORE = UINT64_C(1) << 39, + FIXED_SIZE = UINT64_C(1) << 40, + VOPAsmPrefer32Bit = UINT64_C(1) << 41 + +}; + +// v_cmp_class_* etc. use a 10-bit mask for what operation is checked. +// The result is true if any of these tests are true. +enum ClassFlags { + S_NAN = 1 << 0, // Signaling NaN + Q_NAN = 1 << 1, // Quiet NaN + N_INFINITY = 1 << 2, // Negative infinity + N_NORMAL = 1 << 3, // Negative normal + N_SUBNORMAL = 1 << 4, // Negative subnormal + N_ZERO = 1 << 5, // Negative zero + P_ZERO = 1 << 6, // Positive zero + P_SUBNORMAL = 1 << 7, // Positive subnormal + P_NORMAL = 1 << 8, // Positive normal + P_INFINITY = 1 << 9 // Positive infinity }; } -namespace llvm { namespace AMDGPU { enum OperandType { /// Operands with register or 32-bit immediate @@ -68,31 +101,6 @@ namespace AMDGPU { OPERAND_KIMM32 }; } -} - -namespace SIInstrFlags { - enum Flags { - // First 4 bits are the instruction encoding - VM_CNT = 1 << 0, - EXP_CNT = 1 << 1, - LGKM_CNT = 1 << 2 - }; - - // v_cmp_class_* etc. use a 10-bit mask for what operation is checked. - // The result is true if any of these tests are true. - enum ClassFlags { - S_NAN = 1 << 0, // Signaling NaN - Q_NAN = 1 << 1, // Quiet NaN - N_INFINITY = 1 << 2, // Negative infinity - N_NORMAL = 1 << 3, // Negative normal - N_SUBNORMAL = 1 << 4, // Negative subnormal - N_ZERO = 1 << 5, // Negative zero - P_ZERO = 1 << 6, // Positive zero - P_SUBNORMAL = 1 << 7, // Positive subnormal - P_NORMAL = 1 << 8, // Positive normal - P_INFINITY = 1 << 9 // Positive infinity - }; -} // Input operand modifiers bit-masks // NEG and SEXT share same bit-mask because they can't be set simultaneously. @@ -131,7 +139,6 @@ namespace AMDGPUAsmVariants { }; } -namespace llvm { namespace AMDGPU { namespace EncValues { // Encoding values of enum9/8/7 operands @@ -152,9 +159,7 @@ enum { } // namespace EncValues } // namespace AMDGPU -} // namespace llvm -namespace llvm { namespace AMDGPU { namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns. @@ -259,7 +264,6 @@ enum DstUnused { } // namespace SDWA } // namespace AMDGPU -} // namespace llvm #define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028 #define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C @@ -365,4 +369,6 @@ enum DstUnused { #define R_SPILLED_SGPRS 0x4 #define R_SPILLED_VGPRS 0x8 +} // End namespace llvm + #endif |