amd/common: Add gep helper for pointer increment.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 23 Jan 2019 00:53:59 +0000 (01:53 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 6 Feb 2019 21:35:36 +0000 (22:35 +0100)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h

index 768364b2dc6995b3de09e530a9aa57b3cbc605f7..9aff2f8435d90bd12f5c1142bb1de374029051ef 100644 (file)
@@ -923,6 +923,14 @@ ac_build_fs_interp_mov(struct ac_llvm_context *ctx,
                                  ctx->f32, args, 4, AC_FUNC_ATTR_READNONE);
 }
 
+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,
index e47893bbbe6dff621c6b0bccfeb06f7bd8bcbc7b..f218eaf2832da66dc2c95f0bbd75356d32e04d20 100644 (file)
@@ -223,6 +223,11 @@ ac_build_fs_interp_mov(struct ac_llvm_context *ctx,
                       LLVMValueRef attr_number,
                       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,