From 4e70c2b8db4d004123df572b7daa6365313d47b6 Mon Sep 17 00:00:00 2001 From: Marcin Hajder Date: Wed, 21 Jun 2023 09:16:58 +0200 Subject: [PATCH] scope of modifications: -changed naming convention of saturation .spvasm files related to test_decorate of spirv_new -restored float to char/uchar saturation tests -few minor corrections --- ...turated_conversion_double_to_int.spvasm32} | 2 +- ...turated_conversion_double_to_int.spvasm64} | 2 +- ...urated_conversion_double_to_uint.spvasm32} | 2 +- ...urated_conversion_double_to_uint.spvasm64} | 2 +- ...aturated_conversion_float_to_char.spvasm32 | 46 +++++++++++++++++ ...aturated_conversion_float_to_char.spvasm64 | 50 +++++++++++++++++++ ...urated_conversion_float_to_short.spvasm32} | 2 +- ...urated_conversion_float_to_short.spvasm64} | 2 +- ...turated_conversion_float_to_uchar.spvasm32 | 46 +++++++++++++++++ ...turated_conversion_float_to_uchar.spvasm64 | 50 +++++++++++++++++++ ...rated_conversion_float_to_ushort.spvasm32} | 2 +- ...rated_conversion_float_to_ushort.spvasm64} | 2 +- ...aturated_conversion_half_to_char.spvasm32} | 2 +- ...aturated_conversion_half_to_char.spvasm64} | 2 +- ...turated_conversion_half_to_uchar.spvasm32} | 2 +- ...turated_conversion_half_to_uchar.spvasm64} | 2 +- test_conformance/spirv_new/test_decorate.cpp | 44 ++++++++++------ 17 files changed, 232 insertions(+), 28 deletions(-) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_int.spvasm32 => decorate_saturated_conversion_double_to_int.spvasm32} (97%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_uint.spvasm64 => decorate_saturated_conversion_double_to_int.spvasm64} (98%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_uint.spvasm32 => decorate_saturated_conversion_double_to_uint.spvasm32} (97%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_int.spvasm64 => decorate_saturated_conversion_double_to_uint.spvasm64} (98%) create mode 100644 test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm32 create mode 100644 test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm64 rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_short.spvasm32 => decorate_saturated_conversion_float_to_short.spvasm32} (97%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_short.spvasm64 => decorate_saturated_conversion_float_to_short.spvasm64} (98%) create mode 100644 test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm32 create mode 100644 test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm64 rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_ushort.spvasm32 => decorate_saturated_conversion_float_to_ushort.spvasm32} (97%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_ushort.spvasm64 => decorate_saturated_conversion_float_to_ushort.spvasm64} (98%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_char.spvasm32 => decorate_saturated_conversion_half_to_char.spvasm32} (98%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_char.spvasm64 => decorate_saturated_conversion_half_to_char.spvasm64} (98%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_uchar.spvasm32 => decorate_saturated_conversion_half_to_uchar.spvasm32} (98%) rename test_conformance/spirv_new/spirv_asm/{decorate_saturated_conversion_uchar.spvasm64 => decorate_saturated_conversion_half_to_uchar.spvasm64} (98%) diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_int.spvasm32 similarity index 97% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm32 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_int.spvasm32 index 3fa47c9755..1b811208a6 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm32 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_int.spvasm32 @@ -8,7 +8,7 @@ OpCapability Kernel OpCapability Float64 OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_int" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_int" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_int.spvasm64 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm64 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_int.spvasm64 index 7d9efb08bc..5bec065f64 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm64 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_int.spvasm64 @@ -9,7 +9,7 @@ OpCapability Int64 OpCapability Float64 OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_uint" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_int" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_uint.spvasm32 similarity index 97% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm32 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_uint.spvasm32 index 0672489157..c48185d3e3 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uint.spvasm32 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_uint.spvasm32 @@ -8,7 +8,7 @@ OpCapability Kernel OpCapability Float64 OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_uint" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_uint" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_uint.spvasm64 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm64 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_uint.spvasm64 index 8609e20896..49d19b8a6c 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_int.spvasm64 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_double_to_uint.spvasm64 @@ -9,7 +9,7 @@ OpCapability Int64 OpCapability Float64 OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_int" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_uint" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm32 new file mode 100644 index 0000000000..5e1a9c261f --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_char" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %18 + %20 = OpLoad %float %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpFMul %float %20 %22 + %7 = OpConvertFToS %uchar %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %18 + OpStore %24 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm64 new file mode 100644 index 0000000000..af74058918 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_char.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_char" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %21 + %23 = OpLoad %float %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpFMul %float %23 %25 + %7 = OpConvertFToS %uchar %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_short.spvasm32 similarity index 97% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm32 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_short.spvasm32 index dbb3b44dc5..d256583048 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm32 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_short.spvasm32 @@ -8,7 +8,7 @@ OpCapability Kernel OpCapability Int16 OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_short" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_short" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_short.spvasm64 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm64 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_short.spvasm64 index 2915c12c0b..7b9cfa8052 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_short.spvasm64 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_short.spvasm64 @@ -9,7 +9,7 @@ OpCapability Int64 OpCapability Int16 OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_short" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_short" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm32 new file mode 100644 index 0000000000..150a340224 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm32 @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int8 + OpMemoryModel Physical32 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_uchar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Input_v3uint = OpTypePointer Input %v3uint + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0 + %18 = OpCompositeExtract %uint %17 0 + %19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %18 + %20 = OpLoad %float %19 Aligned 4 + %21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %18 + %22 = OpLoad %float %21 Aligned 4 + %23 = OpFMul %float %20 %22 + %7 = OpConvertFToU %uchar %23 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %18 + OpStore %24 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm64 new file mode 100644 index 0000000000..3152a02695 --- /dev/null +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_uchar.spvasm64 @@ -0,0 +1,50 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Addresses + OpCapability Linkage + OpCapability Kernel + OpCapability Int64 + OpCapability Int8 + OpMemoryModel Physical64 OpenCL + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_uchar" %gl_GlobalInvocationID + OpName %res "res" + OpName %lhs "lhs" + OpName %rhs "rhs" + OpName %entry "entry" + OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId + OpDecorate %gl_GlobalInvocationID Constant + OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import + OpDecorate %7 SaturatedConversion + %ulong = OpTypeInt 64 0 + %v3ulong = OpTypeVector %ulong 3 +%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong + %void = OpTypeVoid + %uchar = OpTypeInt 8 0 +%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar + %float = OpTypeFloat 32 +%_ptr_CrossWorkgroup_float = OpTypePointer CrossWorkgroup %float + %16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_float %_ptr_CrossWorkgroup_float + %ulong_32 = OpConstant %ulong 32 +%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input + %1 = OpFunction %void None %16 + %res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar + %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_float + %entry = OpLabel + %18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0 + %19 = OpCompositeExtract %ulong %18 0 + %20 = OpShiftLeftLogical %ulong %19 %ulong_32 + %21 = OpShiftRightArithmetic %ulong %20 %ulong_32 + %22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %lhs %21 + %23 = OpLoad %float %22 Aligned 4 + %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_float %rhs %21 + %25 = OpLoad %float %24 Aligned 4 + %26 = OpFMul %float %23 %25 + %7 = OpConvertFToU %uchar %26 + %27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %21 + OpStore %27 %7 + OpReturn + OpFunctionEnd diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_ushort.spvasm32 similarity index 97% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm32 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_ushort.spvasm32 index ffbb41776e..26dc05f57d 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm32 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_ushort.spvasm32 @@ -8,7 +8,7 @@ OpCapability Kernel OpCapability Int16 OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_ushort" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_ushort" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_ushort.spvasm64 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm64 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_ushort.spvasm64 index 317f99299f..a89239bfa7 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_ushort.spvasm64 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_float_to_ushort.spvasm64 @@ -9,7 +9,7 @@ OpCapability Int64 OpCapability Int16 OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_ushort" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_ushort" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_char.spvasm32 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm32 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_char.spvasm32 index 417b2efd1e..713d37cd7e 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm32 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_char.spvasm32 @@ -9,7 +9,7 @@ OpCapability Int8 OpCapability Float16 OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_char" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_char" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_char.spvasm64 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm64 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_char.spvasm64 index 7f75b7e20d..10d8caa542 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_char.spvasm64 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_char.spvasm64 @@ -10,7 +10,7 @@ OpCapability Int8 OpCapability Float16 OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_char" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_char" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm32 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_uchar.spvasm32 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm32 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_uchar.spvasm32 index b2225664f2..41b6830271 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm32 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_uchar.spvasm32 @@ -9,7 +9,7 @@ OpCapability Int8 OpCapability Float16 OpMemoryModel Physical32 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_uchar" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_uchar" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm64 b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_uchar.spvasm64 similarity index 98% rename from test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm64 rename to test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_uchar.spvasm64 index 0134d3af02..066b9d367f 100644 --- a/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_uchar.spvasm64 +++ b/test_conformance/spirv_new/spirv_asm/decorate_saturated_conversion_half_to_uchar.spvasm64 @@ -10,7 +10,7 @@ OpCapability Int8 OpCapability Float16 OpMemoryModel Physical64 OpenCL - OpEntryPoint Kernel %1 "decorate_saturated_conversion_uchar" %gl_GlobalInvocationID + OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_uchar" %gl_GlobalInvocationID OpName %res "res" OpName %lhs "lhs" OpName %rhs "rhs" diff --git a/test_conformance/spirv_new/test_decorate.cpp b/test_conformance/spirv_new/test_decorate.cpp index 5938c186a7..316de5009c 100644 --- a/test_conformance/spirv_new/test_decorate.cpp +++ b/test_conformance/spirv_new/test_decorate.cpp @@ -189,13 +189,6 @@ int verify_saturated_results(cl_device_id deviceID, const char *kname, const clProgramWrapper &prog) { - if(std::string(kname).find("double") != std::string::npos) { - if(!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); - return 0; - } - } - cl_int err = 0; const int num = 1 << 20; @@ -325,12 +318,26 @@ int test_saturate_full(cl_device_id deviceID, const char *name, const char *types) { - if(std::string(types).find("double") != std::string::npos) { - if(!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + if (std::string(types).find("double") != std::string::npos) + { + if (!is_extension_available(deviceID, "cl_khr_fp64")) + { + log_info("Extension cl_khr_fp64 not supported; skipping double " + "tests.\n"); + return 0; + } + } + + if (std::string(types).find("half") != std::string::npos) + { + if (!is_extension_available(deviceID, "cl_khr_fp16")) + { + log_info( + "Extension cl_khr_fp16 not supported; skipping half tests.\n"); return 0; } } + clProgramWrapper prog; cl_int err = 0; err = get_program_with_il(prog, deviceID, context, name); @@ -339,18 +346,20 @@ int test_saturate_full(cl_device_id deviceID, } #define TEST_SATURATED_CONVERSION(Ti, Tl, To) \ - TEST_SPIRV_FUNC(decorate_saturated_conversion_##To) \ + TEST_SPIRV_FUNC(decorate_saturated_conversion_##Ti##_to_##To) \ { \ typedef cl_##Ti cl_Ti; \ typedef cl_##Tl cl_Tl; \ typedef cl_##To cl_To; \ + const char *name = "decorate_saturated_conversion_" #Ti "_to_" #To; \ return test_saturate_full( \ - deviceID, context, queue, "decorate_saturated_conversion_" #To, \ - #Ti #Tl #To); \ + deviceID, context, queue, name, #Ti #Tl #To); \ } TEST_SATURATED_CONVERSION(half, short, char) TEST_SATURATED_CONVERSION(half, ushort, uchar) +TEST_SATURATED_CONVERSION(float, int, char) +TEST_SATURATED_CONVERSION(float, uint, uchar) TEST_SATURATED_CONVERSION(float, int, short) TEST_SATURATED_CONVERSION(float, uint, ushort) TEST_SATURATED_CONVERSION(double, long, int) @@ -364,9 +373,12 @@ int test_fp_rounding(cl_device_id deviceID, std::vector &h_in, std::vector &h_out) { - if(std::string(name).find("double") != std::string::npos) { - if(!is_extension_available(deviceID, "cl_khr_fp64")) { - log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n"); + if (std::string(name).find("double") != std::string::npos) + { + if (!is_extension_available(deviceID, "cl_khr_fp64")) + { + log_info("Extension cl_khr_fp64 not supported; skipping double " + "tests.\n"); return 0; } }