ac: add ac_llvm_context::{i,f}32_{0,1}
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 18 May 2017 20:02:48 +0000 (22:02 +0200)
committerDave Airlie <airlied@redhat.com>
Tue, 27 Jun 2017 00:28:29 +0000 (10:28 +1000)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h

index ec69cf093adf86868bf87baae2ca038d54794255..5dd7bc1fd6b036bf4cfece5b0b9c9d3d0260498e 100644 (file)
@@ -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);
 
index a6b7372225211687f7f381ec433547312d49b723..7890992822325e61529a9fcf313b75ee4b8c2aee 100644 (file)
@@ -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;