From de9f2170cc22be3ffafbf05111a3159520d03af8 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 19 May 2021 18:18:52 +0200 Subject: [PATCH] ir3: Use round-to-nearest-even for fquantize2f16 We're supposed to map a floating-point value too large to be represented as fp16 to infinity, however round-to-zero naturally rounds it down to the largest representable fp16 number instead. The blob emits a bunch of fixup code to work around this, but instead we can just do what all the other drivers seem to do and use round-to-nearest-even instead. Part-of: --- src/freedreno/ci/deqp-freedreno-a630-fails.txt | 10 ---------- src/freedreno/ir3/ir3_compiler_nir.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/freedreno/ci/deqp-freedreno-a630-fails.txt b/src/freedreno/ci/deqp-freedreno-a630-fails.txt index d50dba44810..a0ea41b5a4b 100644 --- a/src/freedreno/ci/deqp-freedreno-a630-fails.txt +++ b/src/freedreno/ci/deqp-freedreno-a630-fails.txt @@ -158,16 +158,6 @@ dEQP-VK.renderpass2.dedicated_allocation.attachment_allocation.input_output.7,Fa dEQP-VK.renderpass2.suballocation.attachment_allocation.input_output.7,Fail dEQP-VK.spirv_assembly.instruction.compute.opcopymemory.array,Fail -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/3208 -dEQP-VK.spirv_assembly.instruction.compute.opquantize.infinities,Fail - -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/3208 -dEQP-VK.spirv_assembly.instruction.graphics.opquantize.round_to_inf_frag,Fail -dEQP-VK.spirv_assembly.instruction.graphics.opquantize.round_to_inf_tesse,Fail -dEQP-VK.spirv_assembly.instruction.graphics.opquantize.round_to_inf_vert,Fail -dEQP-VK.spirv_assembly.instruction.graphics.opquantize.round_to_negative_inf_geom,Fail -dEQP-VK.spirv_assembly.instruction.graphics.opquantize.round_to_negative_inf_tessc,Fail - dEQP-VK.spirv_assembly.instruction.graphics.variable_pointers.graphics.writes_single_buffer_geom,Fail dEQP-VK.spirv_assembly.instruction.graphics.variable_pointers.graphics.writes_two_buffers_geom,Fail dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_inner_stride,Fail diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index bf32cc2a215..32496319310 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -392,7 +392,7 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu) case nir_op_fquantize2f16: dst[0] = create_cov(ctx, - create_cov(ctx, src[0], 32, nir_op_f2f16_rtz), + create_cov(ctx, src[0], 32, nir_op_f2f16_rtne), 16, nir_op_f2f32); break; case nir_op_f2b1: