LLVM API Documentation

SIDefines.h
Go to the documentation of this file.
00001 //===-- SIDefines.h - SI Helper Macros ----------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 /// \file
00009 //===----------------------------------------------------------------------===//
00010 
00011 #ifndef LLVM_LIB_TARGET_R600_SIDEFINES_H
00012 #define LLVM_LIB_TARGET_R600_SIDEFINES_H
00013 
00014 namespace SIInstrFlags {
00015 // This needs to be kept in sync with the field bits in InstSI.
00016 enum {
00017   MIMG = 1 << 3,
00018   SMRD = 1 << 4,
00019   VOP1 = 1 << 5,
00020   VOP2 = 1 << 6,
00021   VOP3 = 1 << 7,
00022   VOPC = 1 << 8,
00023   SALU = 1 << 9,
00024   MUBUF = 1 << 10,
00025   MTBUF = 1 << 11,
00026   FLAT = 1 << 12
00027 };
00028 }
00029 
00030 #define R_00B028_SPI_SHADER_PGM_RSRC1_PS                                0x00B028
00031 #define R_00B02C_SPI_SHADER_PGM_RSRC2_PS                                0x00B02C
00032 #define   S_00B02C_EXTRA_LDS_SIZE(x)                                  (((x) & 0xFF) << 8)
00033 #define R_00B128_SPI_SHADER_PGM_RSRC1_VS                                0x00B128
00034 #define R_00B228_SPI_SHADER_PGM_RSRC1_GS                                0x00B228
00035 #define R_00B848_COMPUTE_PGM_RSRC1                                      0x00B848
00036 #define   S_00B028_VGPRS(x)                                           (((x) & 0x3F) << 0)
00037 #define   S_00B028_SGPRS(x)                                           (((x) & 0x0F) << 6)
00038 #define R_00B84C_COMPUTE_PGM_RSRC2                                      0x00B84C
00039 #define   S_00B02C_SCRATCH_EN(x)                                      (((x) & 0x1) << 0)
00040 #define   S_00B84C_LDS_SIZE(x)                                        (((x) & 0x1FF) << 15)
00041 #define R_0286CC_SPI_PS_INPUT_ENA                                       0x0286CC
00042 
00043 
00044 #define R_00B848_COMPUTE_PGM_RSRC1                                      0x00B848
00045 #define   S_00B848_VGPRS(x)                                           (((x) & 0x3F) << 0)
00046 #define   G_00B848_VGPRS(x)                                           (((x) >> 0) & 0x3F)
00047 #define   C_00B848_VGPRS                                              0xFFFFFFC0
00048 #define   S_00B848_SGPRS(x)                                           (((x) & 0x0F) << 6)
00049 #define   G_00B848_SGPRS(x)                                           (((x) >> 6) & 0x0F)
00050 #define   C_00B848_SGPRS                                              0xFFFFFC3F
00051 #define   S_00B848_PRIORITY(x)                                        (((x) & 0x03) << 10)
00052 #define   G_00B848_PRIORITY(x)                                        (((x) >> 10) & 0x03)
00053 #define   C_00B848_PRIORITY                                           0xFFFFF3FF
00054 #define   S_00B848_FLOAT_MODE(x)                                      (((x) & 0xFF) << 12)
00055 #define   G_00B848_FLOAT_MODE(x)                                      (((x) >> 12) & 0xFF)
00056 #define   C_00B848_FLOAT_MODE                                         0xFFF00FFF
00057 #define   S_00B848_PRIV(x)                                            (((x) & 0x1) << 20)
00058 #define   G_00B848_PRIV(x)                                            (((x) >> 20) & 0x1)
00059 #define   C_00B848_PRIV                                               0xFFEFFFFF
00060 #define   S_00B848_DX10_CLAMP(x)                                      (((x) & 0x1) << 21)
00061 #define   G_00B848_DX10_CLAMP(x)                                      (((x) >> 21) & 0x1)
00062 #define   C_00B848_DX10_CLAMP                                         0xFFDFFFFF
00063 #define   S_00B848_DEBUG_MODE(x)                                      (((x) & 0x1) << 22)
00064 #define   G_00B848_DEBUG_MODE(x)                                      (((x) >> 22) & 0x1)
00065 #define   C_00B848_DEBUG_MODE                                         0xFFBFFFFF
00066 #define   S_00B848_IEEE_MODE(x)                                       (((x) & 0x1) << 23)
00067 #define   G_00B848_IEEE_MODE(x)                                       (((x) >> 23) & 0x1)
00068 #define   C_00B848_IEEE_MODE                                          0xFF7FFFFF
00069 
00070 
00071 // Helpers for setting FLOAT_MODE
00072 #define FP_ROUND_ROUND_TO_NEAREST 0
00073 #define FP_ROUND_ROUND_TO_INF 1
00074 #define FP_ROUND_ROUND_TO_NEGINF 2
00075 #define FP_ROUND_ROUND_TO_ZERO 3
00076 
00077 // Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
00078 // precision.
00079 #define FP_ROUND_MODE_SP(x) ((x) & 0x3)
00080 #define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
00081 
00082 #define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
00083 #define FP_DENORM_FLUSH_OUT 1
00084 #define FP_DENORM_FLUSH_IN 2
00085 #define FP_DENORM_FLUSH_NONE 3
00086 
00087 
00088 // Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
00089 // precision.
00090 #define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
00091 #define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
00092 
00093 #define R_00B860_COMPUTE_TMPRING_SIZE                                   0x00B860
00094 #define   S_00B860_WAVESIZE(x)                                        (((x) & 0x1FFF) << 12)
00095 
00096 #endif