From: Bas Nieuwenhuizen Date: Wed, 23 Jan 2019 00:53:59 +0000 (+0100) Subject: amd/common: Add gep helper for pointer increment. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e00d9a9a728fe0c91bd295a5818fdb8303f321bf;p=mesa.git amd/common: Add gep helper for pointer increment. Reviewed-by: Samuel Pitoiset --- 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 @@ -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, 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 @@ -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,