From 900b1863c8301b0334806afa1854137c9f87dcd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 25 Sep 2013 20:07:16 +0200 Subject: [PATCH] radeon/llvm: fix TGSI_OPCODE_UCMP 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 --- 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 dfc7a3f666b..286ccdd2cc0 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( -- 2.30.2