nir/spirv: implement ordered / unordered floating point comparisons properly
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 17 Nov 2016 08:36:36 +0000 (09:36 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 23 Nov 2016 07:07:44 +0000 (08:07 +0100)
commite062eb6415de3aa51b43f30d638ce8215efc0511
treea59835d862f2fe53ff57702651a141fc08decea1
parent9ce592647682b1d27c313c4f72713046fc86cbe4
nir/spirv: implement ordered / unordered floating point comparisons properly

Besides the logical operation involved, these also require that we test if the
operands are ordered / unordered.

For ordered operations, both operands must be ordered (and they must pass the
conditional test) while for unordered operations it is sufficient if only one
of the operands is unordered (or they pass the logical test).

Fixes the following Vulkan CTS tests:

dEQP-VK.spirv_assembly.instruction.compute.opfunord.equal
dEQP-VK.spirv_assembly.instruction.compute.opfunord.greater
dEQP-VK.spirv_assembly.instruction.compute.opfunord.greaterequal
dEQP-VK.spirv_assembly.instruction.compute.opfunord.less
dEQP-VK.spirv_assembly.instruction.compute.opfunord.lessequal

v2: Fixed typo: s/nir_eq/nir_feq

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/compiler/spirv/vtn_alu.c