summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2019-01-23 01:53:59 +0100
committerBas Nieuwenhuizen <[email protected]>2019-02-06 22:35:36 +0100
commite00d9a9a728fe0c91bd295a5818fdb8303f321bf (patch)
tree3a612befa8b7c5938826d6b9e44d018498719cc9
parent39ab4e12f71a640b43403a110d3d85565b59d16c (diff)
amd/common: Add gep helper for pointer increment.
Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r--src/amd/common/ac_llvm_build.c8
-rw-r--r--src/amd/common/ac_llvm_build.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 768364b2dc6..9aff2f8435d 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -924,6 +924,14 @@ ac_build_fs_interp_mov(struct ac_llvm_context *ctx,
}
LLVMValueRef
+ac_build_gep_ptr(struct ac_llvm_context *ctx,
+ LLVMValueRef base_ptr,
+ LLVMValueRef index)
+{
+ return LLVMBuildGEP(ctx->builder, base_ptr, &index, 1, "");
+}
+
+LLVMValueRef
ac_build_gep0(struct ac_llvm_context *ctx,
LLVMValueRef base_ptr,
LLVMValueRef index)
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index e47893bbbe6..f218eaf2832 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -224,6 +224,11 @@ ac_build_fs_interp_mov(struct ac_llvm_context *ctx,
LLVMValueRef params);
LLVMValueRef
+ac_build_gep_ptr(struct ac_llvm_context *ctx,
+ LLVMValueRef base_ptr,
+ LLVMValueRef index);
+
+LLVMValueRef
ac_build_gep0(struct ac_llvm_context *ctx,
LLVMValueRef base_ptr,
LLVMValueRef index);