summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2012-05-07 13:14:58 +0400
committerVadim Girlin <[email protected]>2012-05-08 01:18:22 +0400
commit3a6a1cd75fc98895569a34d5d7dfdc9e90381691 (patch)
treeef1c602f1d1a65f5dbef8be9a4f95d5bd0986f9e
parent2a88dfc521bff7255e27e2ef8efcd08f9db53747 (diff)
radeon/llvm: use integer comparison for IF
Replacing "float equal to 1.0f" with "int not equal to 0". This should help for further optimization of boolean computations. Signed-off-by: Vadim Girlin <[email protected]>
-rw-r--r--src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index 06af1348605..c9b43651a91 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -465,8 +465,10 @@ static void if_emit(
struct gallivm_state * gallivm = bld_base->base.gallivm;
LLVMValueRef cond;
LLVMBasicBlockRef if_block, else_block, endif_block;
- cond = LLVMBuildFCmp(gallivm->builder, LLVMRealOEQ, emit_data->args[0],
- bld_base->base.one, "");
+
+ cond = LLVMBuildICmp(gallivm->builder, LLVMIntNE,
+ bitcast(bld_base, TGSI_TYPE_UNSIGNED, emit_data->args[0]),
+ bld_base->int_bld.zero, "");
endif_block = LLVMAppendBasicBlockInContext(gallivm->context,
ctx->main_fn, "ENDIF");