From: Dave Airlie <airl...@redhat.com> Signed-off-by: Dave Airlie <airl...@redhat.com> --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 15 +++++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_arit.h | 4 ++++ 2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index f3e8ae4..1b97722 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -991,6 +991,21 @@ lp_build_int_to_float(struct lp_build_context *bld, return LLVMBuildSIToFP(builder, a, vec_type, ""); } +/** + * Convert vector of (or scalar) uint to vector of (or scalar) float. + */ +LLVMValueRef +lp_build_uint_to_float(struct lp_build_context *bld, + LLVMValueRef a) +{ + LLVMBuilderRef builder = bld->gallivm->builder; + const struct lp_type type = bld->type; + LLVMTypeRef vec_type = lp_build_vec_type(bld->gallivm, type); + + assert(type.floating); + + return LLVMBuildUIToFP(builder, a, vec_type, ""); +} enum lp_build_round_sse41_mode diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h b/src/gallium/auxiliary/gallivm/lp_bld_arit.h index c78b61d..0c753b7 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h @@ -137,6 +137,10 @@ lp_build_int_to_float(struct lp_build_context *bld, LLVMValueRef a); LLVMValueRef +lp_build_uint_to_float(struct lp_build_context *bld, + LLVMValueRef a); + +LLVMValueRef lp_build_round(struct lp_build_context *bld, LLVMValueRef a); -- 1.7.7.6 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev