ac: clean up ac_build_indexed_load function interfaces
[mesa.git] / src / amd / common / ac_llvm_build.h
index 14ec03f5c84c6a641cb8e392ae87c451b103cadd..f0b5875b42391d70eb34f53ce66f7a003a37fad6 100644 (file)
@@ -28,6 +28,8 @@
 #include <stdbool.h>
 #include <llvm-c/TargetMachine.h>
 
+#include "amd_family.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -61,10 +63,13 @@ struct ac_llvm_context {
        unsigned fpmath_md_kind;
        LLVMValueRef fpmath_md_2p5_ulp;
        LLVMValueRef empty_md;
+
+       enum chip_class chip_class;
 };
 
 void
-ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context);
+ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context,
+                    enum chip_class chip_class);
 
 unsigned ac_get_type_size(LLVMTypeRef type);
 
@@ -80,6 +85,11 @@ ac_build_intrinsic(struct ac_llvm_context *ctx, const char *name,
 
 void ac_build_type_name_for_intr(LLVMTypeRef type, char *buf, unsigned bufsize);
 
+LLVMValueRef
+ac_build_phi(struct ac_llvm_context *ctx, LLVMTypeRef type,
+            unsigned count_incoming, LLVMValueRef *values,
+            LLVMBasicBlockRef *blocks);
+
 void ac_build_optimization_barrier(struct ac_llvm_context *ctx,
                                   LLVMValueRef *pvgpr);
 
@@ -140,14 +150,12 @@ ac_build_indexed_store(struct ac_llvm_context *ctx,
                       LLVMValueRef base_ptr, LLVMValueRef index,
                       LLVMValueRef value);
 
-LLVMValueRef
-ac_build_indexed_load(struct ac_llvm_context *ctx,
-                     LLVMValueRef base_ptr, LLVMValueRef index,
-                     bool uniform);
-
-LLVMValueRef
-ac_build_indexed_load_const(struct ac_llvm_context *ctx,
-                           LLVMValueRef base_ptr, LLVMValueRef index);
+LLVMValueRef ac_build_load(struct ac_llvm_context *ctx, LLVMValueRef base_ptr,
+                          LLVMValueRef index);
+LLVMValueRef ac_build_load_invariant(struct ac_llvm_context *ctx,
+                                    LLVMValueRef base_ptr, LLVMValueRef index);
+LLVMValueRef ac_build_load_to_sgpr(struct ac_llvm_context *ctx,
+                                  LLVMValueRef base_ptr, LLVMValueRef index);
 
 void
 ac_build_buffer_store_dword(struct ac_llvm_context *ctx,
@@ -160,7 +168,7 @@ ac_build_buffer_store_dword(struct ac_llvm_context *ctx,
                            bool glc,
                            bool slc,
                            bool writeonly_memory,
-                           bool has_add_tid);
+                           bool swizzle_enable_hint);
 LLVMValueRef
 ac_build_buffer_load(struct ac_llvm_context *ctx,
                     LLVMValueRef rsrc,
@@ -189,7 +197,6 @@ ac_get_thread_id(struct ac_llvm_context *ctx);
 
 LLVMValueRef
 ac_build_ddxy(struct ac_llvm_context *ctx,
-             bool has_ds_bpermute,
              uint32_t mask,
              int idx,
              LLVMValueRef val);