[Mesa-dev] [PATCH 5/5] ac: use correct LLVM opcodes for ordered comparisons

Marek Olšák maraeo at gmail.com
Wed Feb 14 17:39:03 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Wed, Feb 14, 2018 at 7:29 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> Fixes glsl-1.30/execution/isinf-and-isnan* piglit tests for
> radeonsi and should fix SPIRV errors when LLVM optimises away
> the workarounds in vtn_handle_alu() for handling ordered
> comparisons.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104905
> ---
>  src/amd/common/ac_nir_to_llvm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index a0c5680205..e81f86bb08 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -1792,16 +1792,16 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
>                 result = emit_int_cmp(&ctx->ac, LLVMIntUGE, src[0], src[1]);
>                 break;
>         case nir_op_feq:
> -               result = emit_float_cmp(&ctx->ac, LLVMRealUEQ, src[0], src[1]);
> +               result = emit_float_cmp(&ctx->ac, LLVMRealOEQ, src[0], src[1]);
>                 break;
>         case nir_op_fne:
> -               result = emit_float_cmp(&ctx->ac, LLVMRealUNE, src[0], src[1]);
> +               result = emit_float_cmp(&ctx->ac, LLVMRealONE, src[0], src[1]);
>                 break;
>         case nir_op_flt:
> -               result = emit_float_cmp(&ctx->ac, LLVMRealULT, src[0], src[1]);
> +               result = emit_float_cmp(&ctx->ac, LLVMRealOLT, src[0], src[1]);
>                 break;
>         case nir_op_fge:
> -               result = emit_float_cmp(&ctx->ac, LLVMRealUGE, src[0], src[1]);
> +               result = emit_float_cmp(&ctx->ac, LLVMRealOGE, src[0], src[1]);
>                 break;
>         case nir_op_ufeq:
>                 result = emit_float_cmp(&ctx->ac, LLVMRealUEQ, src[0], src[1]);
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list