[Mesa-dev] [PATCH] radeon/llvm: fix TGSI_OPCODE_UCMP
Marek Olšák
maraeo at gmail.com
Wed Sep 25 11:14:43 PDT 2013
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.
---
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
More information about the mesa-dev
mailing list