[Mesa-dev] [PATCH 2/3] lp_bld_arit: Fix lp_build_sgn.

Jose Fonseca jfonseca at vmware.com
Wed May 9 10:01:37 PDT 2012


Something else is not right here, as

  lp_build_const_vec(bld->gallivm, type, -1.0)

and 

  lp_build_const_int_vec(bld->gallivm, type, -1)

should produce the same output for unnormalized signed integer types.

Which means the error is likely somewhere else:
- lp_build_const_vec is buggy
- the type passed to lp_build_sgn is not signed/unnormalized integer

Please provide details on how this was failing before.

Jose

----- Original Message -----
> Signed-off-by: Olivier Galibert <galibert at pobox.com>
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_arit.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> index 4ba4aa5..77497ad 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
> @@ -926,7 +926,7 @@ lp_build_sgn(struct lp_build_context *bld,
>     }
>     else
>     {
> -      LLVMValueRef minus_one = lp_build_const_vec(bld->gallivm,
> type, -1.0);
> +      LLVMValueRef minus_one = lp_build_const_int_vec(bld->gallivm,
> type, -1);
>        cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, bld->zero);
>        res = lp_build_select(bld, cond, bld->one, minus_one);
>     }
> --
> 1.7.10.280.gaa39
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list