Added tests for NMin, NMax and NClamp instructions
authorJari Komppa <jari.komppa@siru.fi>
Tue, 4 Jul 2017 06:05:05 +0000 (09:05 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 14 Jul 2017 11:43:58 +0000 (07:43 -0400)
commit979ece64e86864b525006ad26d09c3eff8853001
tree2095ac2b1f19613d2b88946ac17c3c368588d158
parentb8ecdac0435b1db4538219b49de6ada7dbe5b47c
Added tests for NMin, NMax and NClamp instructions

The NMin, NMax and NClamp instructions are not generated by glslang
nor tested by spriv-assembly.

Due to the fact that the vulkan spec allows implementations that do
not implement NaN handling, the tests have to be somewhat relaxed;
either the NaN is handled correctly, or NaNs are considered huge
values.

All three instructions return NaN in all cases if all parameters are
NaN.

NMin always returns the other value if paired with NaN: if NaNs are
handled, the instruction should pick the other value. If NaNs are
not handled, the other value will always be smaller.

NMax may return either the other value (if NaNs are handled), or NaN
(if NaNs are not handled).

NClamp is only defined if the min and max values are not NaN, so those
cases are not tested, except for the case where all three values are
NaN. If the clamped value is NaN, the result may either be the min
value (if NaNs are handled) or max value (if NaNs are not handled).

In addition to the NaN case testing, various random non-NaN values are
tested for all three instructions.

Affects:

dEQP-VK.spirv_assembly.instruction.compute.opnmin.all
dEQP-VK.spirv_assembly.instruction.compute.opnmax.all
dEQP-VK.spirv_assembly.instruction.compute.opnclamp.all

Components: Vulkan

VK-GL-CTS issue: 171

Change-Id: I59e884d51dac4eee047af2e52eebee3318e57776
android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp
external/vulkancts/mustpass/1.0.3/vk-default.txt