Set correct range for OpVectorTimesScalar tests
authorStephen Clarke <stephen.clarke@imgtec.com>
Fri, 21 Dec 2018 12:38:35 +0000 (12:38 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 10 Jan 2019 11:54:41 +0000 (06:54 -0500)
The min[] and max[] values should be based on the result in double precision, not after it has been converted to fp16type.

Affects:

dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_2.opvectortimesscalar
dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_3.opvectortimesscalar
dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_4.opvectortimesscalar
dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_2.opvectortimesscalar*
dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_3.opvectortimesscalar*
dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_4.opvectortimesscalar*

Components: Vulkan

VK-GL-CTS issue: 1532
Change-Id: I30810c8c954ee899bb05602b1f8805f82ac021b3
(cherry picked from commit 12b26bd9762dd56068522cc0a17b26c9e31df1e2)

external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp

index 47ce3aa..94e7d7e 100644 (file)
@@ -14368,12 +14368,13 @@ struct fp16VectorTimesScalar : public fp16AllComponents
 
                for (size_t componentNdx = 0; componentNdx < getArgCompCount(0); ++componentNdx)
                {
-                       const fp16type  x       (in[0][componentNdx]);
-                       const fp16type  m       (s.asDouble() * x.asDouble());
+                       const fp16type  x          (in[0][componentNdx]);
+                       const double    result (s.asDouble() * x.asDouble());
+                       const fp16type  m          (result);
 
                        out[componentNdx] = m.bits();
-                       min[componentNdx] = getMin(m.asDouble(), getULPs(in));
-                       max[componentNdx] = getMax(m.asDouble(), getULPs(in));
+                       min[componentNdx] = getMin(result, getULPs(in));
+                       max[componentNdx] = getMax(result, getULPs(in));
                }
 
                return true;