summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-25 23:48:23 +0100
committerMarek Olšák <[email protected]>2017-03-03 17:30:07 +0100
commit8bde7fb3fcf9d85fd311e2e09f5bec4724a66300 (patch)
treebd0d8c6729ceb3e124b799311f07bfbd77c2f9c5
parent94811dc66c2318c271ed41265beffbb9df196577 (diff)
ac: replace SI.vs.load.input with amdgcn.buffer.load.format
Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r--src/amd/common/ac_llvm_build.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 8fac89ccd7b..6364657e679 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -736,6 +736,26 @@ LLVMValueRef ac_build_buffer_load_format(struct ac_llvm_context *ctx,
LLVMValueRef voffset,
bool readonly_memory)
{
+ if (HAVE_LLVM >= 0x0309) {
+ LLVMValueRef args [] = {
+ LLVMBuildBitCast(ctx->builder, rsrc, ctx->v4i32, ""),
+ vindex,
+ voffset,
+ LLVMConstInt(ctx->i1, 0, 0), /* glc */
+ LLVMConstInt(ctx->i1, 0, 0), /* slc */
+ };
+
+ return ac_emit_llvm_intrinsic(ctx,
+ "llvm.amdgcn.buffer.load.format.v4f32",
+ ctx->v4f32, args, ARRAY_SIZE(args),
+ /* READNONE means writes can't
+ * affect it, while READONLY means
+ * that writes can affect it. */
+ readonly_memory ?
+ AC_FUNC_ATTR_READNONE :
+ AC_FUNC_ATTR_READONLY);
+ }
+
LLVMValueRef args[] = {
rsrc,
voffset,