summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-09-25 20:07:16 +0200
committerMarek Olšák <[email protected]>2013-09-29 14:49:23 +0200
commit900b1863c8301b0334806afa1854137c9f87dcd6 (patch)
tree44f6c4cb60b6132969d6fa31312ed73c65f144c4 /src
parent2bda5f3298154bab027aab6d4162b687ccdb36bd (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c10
1 files 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(