From e00d9a9a728fe0c91bd295a5818fdb8303f321bf Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Wed, 23 Jan 2019 01:53:59 +0100 Subject: [PATCH] amd/common: Add gep helper for pointer increment. Reviewed-by: Samuel Pitoiset --- src/amd/common/ac_llvm_build.c | 8 ++++++++ src/amd/common/ac_llvm_build.h | 5 +++++ 2 files changed, 13 insertions(+) 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, -- 2.30.2