radv: enable denorms for 64-bit and 16-bit floats
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 28 Dec 2017 21:55:27 +0000 (22:55 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 5 Jan 2018 08:51:33 +0000 (09:51 +0100)
Similar to RadeonSI.

This fixes:
dEQP-VK.image.texel_view_compatible.graphic.basic.attachment_read.bc*r16g16b16a16_sfloat
dEQP-VK.image.extended_usage_bit.attachment_write.r16_sfloat

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

index ac0a2e67d407431198f7cc57d25f14d38e4b2d79..48e2920a15855c7b447234480bba5648c86718ac 100644 (file)
@@ -6892,6 +6892,20 @@ static void ac_compile_llvm_module(LLVMTargetMachineRef tm,
        /* +3 for scratch wave offset and VCC */
        config->num_sgprs = MAX2(config->num_sgprs,
                                 shader_info->num_input_sgprs + 3);
+
+       /* Enable 64-bit and 16-bit denormals, because there is no performance
+        * cost.
+        *
+        * If denormals are enabled, all floating-point output modifiers are
+        * ignored.
+        *
+        * Don't enable denormals for 32-bit floats, because:
+        * - Floating-point output modifiers would be ignored by the hw.
+        * - Some opcodes don't support denormals, such as v_mad_f32. We would
+        *   have to stop using those.
+        * - SI & CI would be very slow.
+        */
+       config->float_mode |= V_00B028_FP_64_DENORMS;
 }
 
 static void