diff options
author | Samuel Pitoiset <[email protected]> | 2019-03-13 16:08:32 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-03-21 09:02:18 +0100 |
commit | b235d77e1820ed235e8055393a629aef45ba071c (patch) | |
tree | d331412a778773658c1be53102d0280189c6e760 /src/amd/common/ac_llvm_build.c | |
parent | b12e074b89ce4f12178c0ffc57b9d7c38acc38b3 (diff) |
ac: add ac_build_tbuffer_store_byte() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 58e4ffaa2ed..b5bb399eef1 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1771,6 +1771,25 @@ ac_build_tbuffer_store_short(struct ac_llvm_context *ctx, writeonly_memory); } +void +ac_build_tbuffer_store_byte(struct ac_llvm_context *ctx, + LLVMValueRef rsrc, + LLVMValueRef vdata, + LLVMValueRef voffset, + LLVMValueRef soffset, + bool glc, + bool writeonly_memory) +{ + unsigned dfmt = V_008F0C_BUF_DATA_FORMAT_8; + unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT; + + vdata = LLVMBuildBitCast(ctx->builder, vdata, ctx->i8, ""); + vdata = LLVMBuildZExt(ctx->builder, vdata, ctx->i32, ""); + + ac_build_raw_tbuffer_store(ctx, rsrc, vdata, voffset, soffset, + ctx->i32_0, 1, dfmt, nfmt, glc, false, + writeonly_memory); +} /** * Set range metadata on an instruction. This can only be used on load and * call instructions. If you know an instruction can only produce the values |