Module: Mesa
Branch: master
Commit: 8f56ba5da40907b2a8c5e04c4ff3ef66921b36bd
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f56ba5da40907b2a8c5e04c4ff3ef66921b36bd

Author: Dave Airlie <[email protected]>
Date:   Tue Dec  3 14:45:32 2019 +1000

gallivm/nir: cleanup code and call cmp wrapper

Reviewed-by: Roland Scheidegger <[email protected]>

---

 src/gallium/auxiliary/gallivm/lp_bld_nir.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c 
b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index 197e4118d0d..31b420b246b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -217,37 +217,39 @@ static LLVMValueRef int_to_bool32(struct 
lp_build_nir_context *bld_base,
 }
 
 static LLVMValueRef flt_to_bool32(struct lp_build_nir_context *bld_base,
-                                 uint32_t src_bit_size,
-                                 LLVMValueRef val)
+                                  uint32_t src_bit_size,
+                                  LLVMValueRef val)
 {
    LLVMBuilderRef builder = bld_base->base.gallivm->builder;
    struct lp_build_context *flt_bld = get_flt_bld(bld_base, src_bit_size);
-   LLVMValueRef result = lp_build_compare(bld_base->base.gallivm, 
flt_bld->type, PIPE_FUNC_NOTEQUAL, val, flt_bld->zero);
+   LLVMValueRef result = lp_build_cmp(flt_bld, PIPE_FUNC_NOTEQUAL, val, 
flt_bld->zero);
    if (src_bit_size == 64)
       result = LLVMBuildTrunc(builder, result, bld_base->int_bld.vec_type, "");
    return result;
 }
 
 static LLVMValueRef fcmp32(struct lp_build_nir_context *bld_base,
-                          enum pipe_compare_func compare,
-                          uint32_t src_bit_size,
-                          LLVMValueRef src[4])
+                           enum pipe_compare_func compare,
+                           uint32_t src_bit_size,
+                           LLVMValueRef src[4])
 {
    LLVMBuilderRef builder = bld_base->base.gallivm->builder;
-   LLVMValueRef result = lp_build_compare(bld_base->base.gallivm, 
get_flt_bld(bld_base, src_bit_size)->type, compare, src[0], src[1]);
+   struct lp_build_context *flt_bld = get_flt_bld(bld_base, src_bit_size);
+   LLVMValueRef result = lp_build_cmp(flt_bld, compare, src[0], src[1]);
    if (src_bit_size == 64)
       result = LLVMBuildTrunc(builder, result, bld_base->int_bld.vec_type, "");
    return result;
 }
 
 static LLVMValueRef icmp32(struct lp_build_nir_context *bld_base,
-                          enum pipe_compare_func compare,
-                          bool is_unsigned,
-                          uint32_t src_bit_size,
-                          LLVMValueRef src[4])
+                           enum pipe_compare_func compare,
+                           bool is_unsigned,
+                           uint32_t src_bit_size,
+                           LLVMValueRef src[4])
 {
    LLVMBuilderRef builder = bld_base->base.gallivm->builder;
-   LLVMValueRef result = lp_build_compare(bld_base->base.gallivm, 
get_int_bld(bld_base, is_unsigned, src_bit_size)->type, compare, src[0], 
src[1]);
+   struct lp_build_context *i_bld = get_int_bld(bld_base, is_unsigned, 
src_bit_size);
+   LLVMValueRef result = lp_build_cmp(i_bld, compare, src[0], src[1]);
    if (src_bit_size == 64)
       result = LLVMBuildTrunc(builder, result, bld_base->int_bld.vec_type, "");
    return result;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to