ac: fix WAITCNT flags for GFX9
authorMarek Olšák <marek.olsak@amd.com>
Thu, 16 Aug 2018 01:43:32 +0000 (21:43 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 22 Aug 2018 18:34:43 +0000 (14:34 -0400)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/common/ac_llvm_build.h
src/amd/common/ac_nir_to_llvm.c
src/gallium/drivers/radeonsi/si_shader_internal.h

index d11a6ebb1be6d89f69b92efa03f2d6fc3e1ad31e..b080cca4cb730db3ba0cdc60b87b43a607470728 100644 (file)
@@ -43,6 +43,12 @@ enum {
        AC_CONST_32BIT_ADDR_SPACE = 6, /* same as CONST, but the pointer type has 32 bits */
 };
 
+/* Combine these with & instead of |. */
+#define NOOP_WAITCNT   0xcf7f
+#define LGKM_CNT       0xc07f
+#define EXP_CNT                0xcf0f
+#define VM_CNT         0x0f70 /* On GFX9, vmcnt has 6 bits in [0:3] and [14:15] */
+
 struct ac_llvm_flow;
 
 struct ac_llvm_context {
index 90df1e0062373aaf7f34a0455ca33ffa07ae6764..3845a721a777abf4f6d97f9c2c001e1d8b656fb5 100644 (file)
@@ -2537,10 +2537,6 @@ static LLVMValueRef visit_image_size(struct ac_nir_context *ctx,
        return res;
 }
 
-#define NOOP_WAITCNT 0xf7f
-#define LGKM_CNT 0x07f
-#define VM_CNT 0xf70
-
 static void emit_membar(struct ac_llvm_context *ac,
                        const nir_intrinsic_instr *instr)
 {
index ac7784f7d461dcca500a3841f5fb1f9730bda8fa..aff7e0472dbf0b14510337456077c279f495fb85 100644 (file)
@@ -288,11 +288,6 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base,
                        unsigned index,
                        LLVMValueRef dst[4]);
 
-/* Combine these with & instead of |. */
-#define NOOP_WAITCNT 0xf7f
-#define LGKM_CNT 0x07f
-#define VM_CNT 0xf70
-
 LLVMValueRef si_get_indirect_index(struct si_shader_context *ctx,
                                   const struct tgsi_ind_register *ind,
                                   unsigned addr_mul, int rel_index);