radeonsi: don't use lp_build_const_*
authorMarek Olšák <marek.olsak@amd.com>
Fri, 29 Sep 2017 14:23:45 +0000 (16:23 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 6 Oct 2017 00:56:11 +0000 (02:56 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index 242f056e7bde324bf0c05d504db66a038ed362c5..972b26f2acc9476d41a4cb20fdbcfd675d084dc1 100644 (file)
@@ -33,7 +33,6 @@ static void kill_if_fetch_args(struct lp_build_tgsi_context *bld_base,
 {
        const struct tgsi_full_instruction *inst = emit_data->inst;
        struct si_shader_context *ctx = si_shader_context(bld_base);
-       struct gallivm_state *gallivm = bld_base->base.gallivm;
        LLVMBuilderRef builder = ctx->ac.builder;
        unsigned i;
        LLVMValueRef conds[TGSI_NUM_CHANNELS];
@@ -52,7 +51,7 @@ static void kill_if_fetch_args(struct lp_build_tgsi_context *bld_base,
        emit_data->dst_type = ctx->voidt;
        emit_data->arg_count = 1;
        emit_data->args[0] = LLVMBuildSelect(builder, conds[0],
-                                       lp_build_const_float(gallivm, -1.0f),
+                                       LLVMConstReal(ctx->f32, -1.0f),
                                        bld_base->base.zero, "");
 }
 
@@ -476,7 +475,6 @@ static void emit_bfi(const struct lp_build_tgsi_action *action,
                     struct lp_build_emit_data *emit_data)
 {
        struct si_shader_context *ctx = si_shader_context(bld_base);
-       struct gallivm_state *gallivm = bld_base->base.gallivm;
        LLVMBuilderRef builder = ctx->ac.builder;
        LLVMValueRef bfi_args[3];
        LLVMValueRef bfi_sm5;
@@ -511,7 +509,7 @@ static void emit_bfi(const struct lp_build_tgsi_action *action,
         * and disagrees with GLSL semantics when bits (src3) is 32.
         */
        cond = LLVMBuildICmp(builder, LLVMIntUGE, emit_data->args[3],
-                            lp_build_const_int32(gallivm, 32), "");
+                            LLVMConstInt(ctx->i32, 32, 0), "");
        emit_data->output[emit_data->chan] =
                LLVMBuildSelect(builder, cond, emit_data->args[1], bfi_sm5, "");
 }
@@ -541,7 +539,6 @@ static void emit_lsb(const struct lp_build_tgsi_action *action,
                     struct lp_build_emit_data *emit_data)
 {
        struct si_shader_context *ctx = si_shader_context(bld_base);
-       struct gallivm_state *gallivm = bld_base->base.gallivm;
        LLVMValueRef args[2] = {
                emit_data->args[0],
 
@@ -566,7 +563,7 @@ static void emit_lsb(const struct lp_build_tgsi_action *action,
                LLVMBuildSelect(ctx->ac.builder,
                                LLVMBuildICmp(ctx->ac.builder, LLVMIntEQ, args[0],
                                              ctx->i32_0, ""),
-                               lp_build_const_int32(gallivm, -1), lsb, "");
+                               LLVMConstInt(ctx->i32, -1, 0), lsb, "");
 }
 
 /* Find the last bit set. */
@@ -675,13 +672,12 @@ static void emit_up2h(const struct lp_build_tgsi_action *action,
                      struct lp_build_emit_data *emit_data)
 {
        struct si_shader_context *ctx = si_shader_context(bld_base);
-       struct lp_build_context *uint_bld = &bld_base->uint_bld;
        LLVMTypeRef i16;
        LLVMValueRef const16, input, val;
        unsigned i;
 
        i16 = LLVMInt16TypeInContext(ctx->ac.context);
-       const16 = lp_build_const_int32(uint_bld->gallivm, 16);
+       const16 = LLVMConstInt(ctx->i32, 16, 0);
        input = emit_data->args[0];
 
        for (i = 0; i < 2; i++) {
index 6a8668110c8ed06166f65b5db8232ab2b2e30ad4..31d7924e0e345298128f96374cfbadccce04e633 100644 (file)
@@ -1193,7 +1193,7 @@ void si_llvm_context_init(struct si_shader_context *ctx,
        /* metadata allowing 2.5 ULP */
        ctx->fpmath_md_kind = LLVMGetMDKindIDInContext(ctx->ac.context,
                                                       "fpmath", 6);
-       LLVMValueRef arg = lp_build_const_float(&ctx->gallivm, 2.5);
+       LLVMValueRef arg = LLVMConstReal(ctx->ac.f32, 2.5);
        ctx->fpmath_md_2p5_ulp = LLVMMDNodeInContext(ctx->ac.context,
                                                     &arg, 1);