diff options
author | Brian Paul <[email protected]> | 2010-12-02 18:11:13 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-12-02 18:11:16 -0700 |
commit | 6299f241e9fdd86e705d144a42d9b1979c13f9ad (patch) | |
tree | de119916b1f12fae9aaeffece5b1a310baab1014 /src/gallium/auxiliary/gallivm/lp_bld_bitarit.c | |
parent | 36b09b5ded84a03622a746bd6e963cec5d70c5c3 (diff) |
gallivm/llvmpipe: remove lp_build_context::builder
The field was redundant. Use the gallivm->builder value instead.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_bitarit.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_bitarit.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c b/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c index fe7eeb61c42..a9c57d682f2 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c @@ -40,6 +40,7 @@ LLVMValueRef lp_build_or(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) { + LLVMBuilderRef builder = bld->gallivm->builder; const struct lp_type type = bld->type; LLVMValueRef res; @@ -48,14 +49,14 @@ lp_build_or(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) /* can't do bitwise ops on floating-point values */ if (type.floating) { - a = LLVMBuildBitCast(bld->builder, a, bld->int_vec_type, ""); - b = LLVMBuildBitCast(bld->builder, b, bld->int_vec_type, ""); + a = LLVMBuildBitCast(builder, a, bld->int_vec_type, ""); + b = LLVMBuildBitCast(builder, b, bld->int_vec_type, ""); } - res = LLVMBuildOr(bld->builder, a, b, ""); + res = LLVMBuildOr(builder, a, b, ""); if (type.floating) { - res = LLVMBuildBitCast(bld->builder, res, bld->vec_type, ""); + res = LLVMBuildBitCast(builder, res, bld->vec_type, ""); } return res; @@ -68,6 +69,7 @@ lp_build_or(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) LLVMValueRef lp_build_and(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) { + LLVMBuilderRef builder = bld->gallivm->builder; const struct lp_type type = bld->type; LLVMValueRef res; @@ -76,14 +78,14 @@ lp_build_and(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) /* can't do bitwise ops on floating-point values */ if (type.floating) { - a = LLVMBuildBitCast(bld->builder, a, bld->int_vec_type, ""); - b = LLVMBuildBitCast(bld->builder, b, bld->int_vec_type, ""); + a = LLVMBuildBitCast(builder, a, bld->int_vec_type, ""); + b = LLVMBuildBitCast(builder, b, bld->int_vec_type, ""); } - res = LLVMBuildAnd(bld->builder, a, b, ""); + res = LLVMBuildAnd(builder, a, b, ""); if (type.floating) { - res = LLVMBuildBitCast(bld->builder, res, bld->vec_type, ""); + res = LLVMBuildBitCast(builder, res, bld->vec_type, ""); } return res; @@ -96,6 +98,7 @@ lp_build_and(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) LLVMValueRef lp_build_andnot(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) { + LLVMBuilderRef builder = bld->gallivm->builder; const struct lp_type type = bld->type; LLVMValueRef res; @@ -104,15 +107,15 @@ lp_build_andnot(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) /* can't do bitwise ops on floating-point values */ if (type.floating) { - a = LLVMBuildBitCast(bld->builder, a, bld->int_vec_type, ""); - b = LLVMBuildBitCast(bld->builder, b, bld->int_vec_type, ""); + a = LLVMBuildBitCast(builder, a, bld->int_vec_type, ""); + b = LLVMBuildBitCast(builder, b, bld->int_vec_type, ""); } - res = LLVMBuildNot(bld->builder, b, ""); - res = LLVMBuildAnd(bld->builder, a, res, ""); + res = LLVMBuildNot(builder, b, ""); + res = LLVMBuildAnd(builder, a, res, ""); if (type.floating) { - res = LLVMBuildBitCast(bld->builder, res, bld->vec_type, ""); + res = LLVMBuildBitCast(builder, res, bld->vec_type, ""); } return res; @@ -125,6 +128,7 @@ lp_build_andnot(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) LLVMValueRef lp_build_shl(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) { + LLVMBuilderRef builder = bld->gallivm->builder; const struct lp_type type = bld->type; LLVMValueRef res; @@ -133,7 +137,7 @@ lp_build_shl(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) assert(lp_check_value(type, a)); assert(lp_check_value(type, b)); - res = LLVMBuildShl(bld->builder, a, b, ""); + res = LLVMBuildShl(builder, a, b, ""); return res; } @@ -145,6 +149,7 @@ lp_build_shl(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) LLVMValueRef lp_build_shr(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) { + LLVMBuilderRef builder = bld->gallivm->builder; const struct lp_type type = bld->type; LLVMValueRef res; @@ -154,9 +159,9 @@ lp_build_shr(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b) assert(lp_check_value(type, b)); if (type.sign) { - res = LLVMBuildAShr(bld->builder, a, b, ""); + res = LLVMBuildAShr(builder, a, b, ""); } else { - res = LLVMBuildLShr(bld->builder, a, b, ""); + res = LLVMBuildLShr(builder, a, b, ""); } return res; |