radv: fix OpQuantizeToF16 for NaN on GFX6-7
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 24 Oct 2019 16:48:54 +0000 (18:48 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 28 Oct 2019 08:31:52 +0000 (09:31 +0100)
Do not flush NaN to 0.

Fixes
dEQP-VK.spirv_assembly.instruction.compute.opquantize.propagated_nans

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/llvm/ac_nir_to_llvm.c

index cd7091ad16337335afc8951da22980d62156a0de..3d758759af77b28ef5f7e3e43c58d9490a2a9949 100644 (file)
@@ -356,10 +356,10 @@ static LLVMValueRef emit_f2f16(struct ac_llvm_context *ctx,
                 */
                LLVMValueRef temp, cond2;
                temp = emit_intrin_1f_param(ctx, "llvm.fabs", ctx->f32, result);
-               cond = LLVMBuildFCmp(ctx->builder, LLVMRealUGT,
+               cond = LLVMBuildFCmp(ctx->builder, LLVMRealOGT,
                                     LLVMBuildBitCast(ctx->builder, LLVMConstInt(ctx->i32, 0x38800000, false), ctx->f32, ""),
                                     temp, "");
-               cond2 = LLVMBuildFCmp(ctx->builder, LLVMRealUNE,
+               cond2 = LLVMBuildFCmp(ctx->builder, LLVMRealONE,
                                      temp, ctx->f32_0, "");
                cond = LLVMBuildAnd(ctx->builder, cond, cond2, "");
                result = LLVMBuildSelect(ctx->builder, cond, ctx->f32_0, result, "");