summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-23 02:06:40 +0100
committerMarek Olšák <[email protected]>2017-03-03 15:29:30 +0100
commit369f4a87268547c7714ad8c16cb975e343bc8168 (patch)
tree977a2ede76fbabbe3dcc927939b2ac76ddc8d14a /src/amd/common
parent9af03318aa1aada0c5371799759dc627cd981048 (diff)
radeonsi: move llvm.SI.export building to amd/common
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_llvm_build.c15
-rw-r--r--src/amd/common/ac_llvm_build.h11
2 files changed, 26 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 114cb0c1fff..fae551055ed 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -886,3 +886,18 @@ LLVMValueRef ac_emit_clamp(struct ac_llvm_context *ctx, LLVMValueRef value)
AC_FUNC_ATTR_READNONE |
AC_FUNC_ATTR_LEGACY);
}
+
+void ac_emit_export(struct ac_llvm_context *ctx, struct ac_export_args *a)
+{
+ LLVMValueRef args[9];
+
+ args[0] = LLVMConstInt(ctx->i32, a->enabled_channels, 0);
+ args[1] = LLVMConstInt(ctx->i32, a->valid_mask, 0);
+ args[2] = LLVMConstInt(ctx->i32, a->done, 0);
+ args[3] = LLVMConstInt(ctx->i32, a->target, 0);
+ args[4] = LLVMConstInt(ctx->i32, a->compr, 0);
+ memcpy(args + 5, a->out, sizeof(a->out[0]) * 4);
+
+ ac_emit_llvm_intrinsic(ctx, "llvm.SI.export", ctx->voidt, args, 9,
+ AC_FUNC_ATTR_LEGACY);
+}
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index 46da79e4c17..27f2097a1c6 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -194,6 +194,17 @@ LLVMValueRef ac_emit_umsb(struct ac_llvm_context *ctx,
LLVMValueRef ac_emit_clamp(struct ac_llvm_context *ctx, LLVMValueRef value);
+struct ac_export_args {
+ LLVMValueRef out[4];
+ unsigned target;
+ unsigned enabled_channels;
+ bool compr;
+ bool done;
+ bool valid_mask;
+};
+
+void ac_emit_export(struct ac_llvm_context *ctx, struct ac_export_args *a);
+
#ifdef __cplusplus
}
#endif