Skip to content

Commit

Permalink
Added cl_khr_fp16 extension support for test_decorate from spirv_new,…
Browse files Browse the repository at this point in the history
… work in progres
  • Loading branch information
shajder committed Jun 19, 2023
1 parent 475a37a commit dec1e62
Show file tree
Hide file tree
Showing 9 changed files with 395 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 20
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rte_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTE
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%1 = OpFunction %void None %14
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
%16 = OpCompositeExtract %uint %15 0
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %16
%18 = OpLoad %half %17 Aligned 2
%6 = OpConvertFToS %ushort %18
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %16
OpStore %19 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 23
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Int64
OpCapability Int16
OpCapability Float16
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rte_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTE
%ulong = OpTypeInt 64 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%ulong_32 = OpConstant %ulong 32
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
%1 = OpFunction %void None %14
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %ulong %16 0
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
%21 = OpLoad %half %20 Aligned 2
%6 = OpConvertFToS %ushort %21
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
OpStore %22 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 21
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rtn_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTN
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%1 = OpFunction %void None %15
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %uint %16 0
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %17
%19 = OpLoad %half %18 Aligned 2
%6 = OpConvertFToS %ushort %19
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %17
OpStore %20 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 23
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Int64
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rtn_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTN
%ulong = OpTypeInt 64 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%ulong_32 = OpConstant %ulong 32
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
%1 = OpFunction %void None %14
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %ulong %16 0
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
%21 = OpLoad %half %20 Aligned 2
%6 = OpConvertFToS %ushort %21
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
OpStore %22 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 21
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rtp_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTP
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%1 = OpFunction %void None %15
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %uint %16 0
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %17
%19 = OpLoad %half %18 Aligned 2
%6 = OpConvertFToS %ushort %19
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %17
OpStore %20 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 23
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Int64
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rtp_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTP
%ulong = OpTypeInt 64 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%ulong_32 = OpConstant %ulong 32
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
%1 = OpFunction %void None %14
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %ulong %16 0
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
%21 = OpLoad %half %20 Aligned 2
%6 = OpConvertFToS %ushort %21
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
OpStore %22 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 21
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rtz_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTZ
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%1 = OpFunction %void None %15
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %uint %16 0
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %17
%19 = OpLoad %half %18 Aligned 2
%6 = OpConvertFToS %ushort %19
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %17
OpStore %20 %6
OpReturn
OpFunctionEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 23
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Int64
OpCapability Float16
OpCapability Int16
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %1 "decorate_rounding_rtz_half_short" %gl_GlobalInvocationID
OpName %res "res"
OpName %in "in"
OpName %entry "entry"
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpDecorate %6 FPRoundingMode RTZ
%ulong = OpTypeInt 64 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
%void = OpTypeVoid
%ushort = OpTypeInt 16 0
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
%half = OpTypeFloat 16
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
%ulong_32 = OpConstant %ulong 32
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
%1 = OpFunction %void None %14
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
%entry = OpLabel
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
%17 = OpCompositeExtract %ulong %16 0
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
%21 = OpLoad %half %20 Aligned 2
%6 = OpConvertFToS %ushort %21
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
OpStore %22 %6
OpReturn
OpFunctionEnd
Loading

0 comments on commit dec1e62

Please sign in to comment.