diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 2123683..6dc2f24 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -506,6 +506,7 @@ emit_fetch( const unsigned chan_index ) { const struct tgsi_full_src_register *reg = &inst->Src[src_op]; + const struct lp_type type = bld->base.type; const unsigned swizzle = tgsi_util_get_full_src_register_swizzle(reg, chan_index); LLVMValueRef res; @@ -612,11 +613,17 @@ emit_fetch( case TGSI_UTIL_SIGN_SET: /* TODO: Use bitwese OR for floating point */ res = lp_build_abs( &bld->base, res ); - res = LLVMBuildNeg( bld->base.builder, res, "" ); + if (type.floating) + res = LLVMBuildFNeg( bld->base.builder, res, "" ); + else + res = LLVMBuildNeg( bld->base.builder, res, "" ); break; case TGSI_UTIL_SIGN_TOGGLE: - res = LLVMBuildNeg( bld->base.builder, res, "" ); + if (type.floating) + res = LLVMBuildFNeg( bld->base.builder, res, "" ); + else + res = LLVMBuildNeg( bld->base.builder, res, "" ); break; case TGSI_UTIL_SIGN_KEEP: