From d0688084d5fc0c627dad424a294d4e35ab960eb6 Mon Sep 17 00:00:00 2001 From: Peter Deayton Date: Thu, 15 Nov 2018 10:26:37 -0800 Subject: [PATCH] Allow float16 max value for result larger than max Numbers larger than the maximum representable float16 value may round to infinity for RTE rounding mode, or to the maximum representable value 65504 (0x7bff) for RTZ rounding mode. Components: Vulkan VK-GL-CTS issue: 1483 Affects: dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_* dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_* Change-Id: Id53eeb797e522db98bb070894a7c715507a4f05a --- .../modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp index 9fc51dd..9177957 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp @@ -15064,6 +15064,15 @@ bool compareFP16ArithmeticFunc (const std::vector& inputs, const vecto reportError = false; } + if (reportError && expected.isInf()) + { + // RTZ rounding mode returns +/-65504 instead of Inf on overflow + if (expected.sign() == 1 && outputted.bits() == 0x7bff && iterationEdgeMin[componentNdx] <= std::numeric_limits::max()) + reportError = false; + else if (expected.sign() == -1 && outputted.bits() == 0xfbff && iterationEdgeMax[componentNdx] >= -std::numeric_limits::max()) + reportError = false; + } + if (reportError) { const double outputtedDouble = outputted.asDouble(); -- 2.7.4