summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-18 22:02:48 +0200
committerDave Airlie <[email protected]>2017-06-27 10:28:29 +1000
commit331a574732be0658ac5c5e417f9c48518f4a4280 (patch)
tree971f74d1d53077bea65c23d2261a98f5a08f6815 /src
parent7bf8c944dca7ff6f4201541f49bfae6f93d3cace (diff)
ac: add ac_llvm_context::{i,f}32_{0,1}
Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_llvm_build.c5
-rw-r--r--src/amd/common/ac_llvm_build.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index ec69cf093ad..5dd7bc1fd6b 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -66,6 +66,11 @@ ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context)
ctx->v4f32 = LLVMVectorType(ctx->f32, 4);
ctx->v16i8 = LLVMVectorType(ctx->i8, 16);
+ ctx->i32_0 = LLVMConstInt(ctx->i32, 0, false);
+ ctx->i32_1 = LLVMConstInt(ctx->i32, 1, false);
+ ctx->f32_0 = LLVMConstReal(ctx->f32, 0.0);
+ ctx->f32_1 = LLVMConstReal(ctx->f32, 1.0);
+
ctx->range_md_kind = LLVMGetMDKindIDInContext(ctx->context,
"range", 5);
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index a6b73722252..78909928223 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -50,6 +50,11 @@ struct ac_llvm_context {
LLVMTypeRef v4f32;
LLVMTypeRef v16i8;
+ LLVMValueRef i32_0;
+ LLVMValueRef i32_1;
+ LLVMValueRef f32_0;
+ LLVMValueRef f32_1;
+
unsigned range_md_kind;
unsigned invariant_load_md_kind;
unsigned uniform_md_kind;