[Mesa-dev] [PATCH] radeon/llvm: fix TGSI_OPCODE_UCMP

Tom Stellard tom at stellard.net
Fri Sep 27 19:03:43 PDT 2013


On Wed, Sep 25, 2013 at 08:14:43PM +0200, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> This doesn't fix any known issue (I haven't run piglit with this yet),
> but the code was obviously completely wrong. It looks like copy-pasted from CMP.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

> ---
>  src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> index dfc7a3f..286ccdd 100644
> --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> @@ -827,10 +827,14 @@ static void emit_ucmp(
>  {
>  	LLVMBuilderRef builder = bld_base->base.gallivm->builder;
>  
> -	LLVMValueRef v = LLVMBuildFCmp(builder, LLVMRealUGE,
> -			emit_data->args[0], lp_build_const_float(bld_base->base.gallivm, 0.), "");
> +	LLVMValueRef arg0 = LLVMBuildBitCast(builder, emit_data->args[0],
> +					     bld_base->uint_bld.elem_type, "");
>  
> -	emit_data->output[emit_data->chan] = LLVMBuildSelect(builder, v, emit_data->args[2], emit_data->args[1], "");
> +	LLVMValueRef v = LLVMBuildICmp(builder, LLVMIntNE, arg0,
> +				       bld_base->uint_bld.zero, "");
> +
> +	emit_data->output[emit_data->chan] =
> +		LLVMBuildSelect(builder, v, emit_data->args[1], emit_data->args[2], "");
>  }
>  
>  static void emit_cmp(
> -- 
> 1.8.1.2
> 
> _______________________________________________
> 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