Permit not flushing operands for FP16 DenormFlushToZero add, dot, vmulm
authorAndrea Faulds <andrea.faulds@arm.com>
Thu, 5 Nov 2020 15:35:51 +0000 (16:35 +0100)
committerAndrea Faulds <andrea.faulds@arm.com>
Thu, 5 Nov 2020 15:35:51 +0000 (16:35 +0100)
commit910ece4651e97c358453173beba7f71c47e91657
tree2ecdf83273fa13a789aea05a509d968372be01ee
parente08c0db4aeaf2f5fc6cc10dfd9111a3c88f1ffdd
Permit not flushing operands for FP16 DenormFlushToZero add, dot, vmulm

Where `d` is a denormal value such that `2 * d` is not denormal:

- The F16 OpFAdd tests assumed (d + d) is zero when DenormFlushToZero is
  used. This is not true if the operands (d) are not flushed to zero by
  the implementation, which is allowed by the Vulkan specification.
- The F16 OpDot test assumed dot(vec2(d, d), vec2(1, 1)) is zero. Since
  that is equivalent to (d + d), it has the same problem as OpFAdd.
- The F16 OpVectorTimesMatrix test made the same assumption as the OpDot
  test but for both columns of a 2-by-2 matrix, with the same problem.

These tests are changed to accept `2 * d` as a valid result alongside
zero, such that they will pass both on implementations which flush
operands to zero and on implementations which only flush results to
zero.

Modified tests:

    dEQP-VK.spirv_assembly.instruction.*.float_controls.fp16.input_args.denorm_*flush_to_zero*
    dEQP-VK.spirv_assembly.instruction.compute.float_controls.independence_settings.denorm_ind_*_fp16_flush_*

VK-GL-CTS Issue: 2644

Components: Vulkan

Change-Id: I0ef4a57915e3bdab100f55f52d21913f87af4927
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp