add SPIR-V 1.4 testing for OpCopyLogical (#2136)

This PR adds targeted testing for the SPIR-V 1.4 instruction
OpCopyLogical.
This commit is contained in:
Ben Ashbaugh
2024-11-25 07:35:50 -08:00
committed by GitHub
parent 2358b46553
commit e9a248f555
3 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
; SPIR-V
; Version: 1.4
OpCapability Addresses
OpCapability Kernel
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %kernel "copylogical_test"
%uint = OpTypeInt 32 0
%float = OpTypeFloat 32
%void = OpTypeVoid
%struct_a = OpTypeStruct %uint %float
%ptr_struct_a = OpTypePointer CrossWorkgroup %struct_a
%struct_b = OpTypeStruct %uint %float
%ptr_struct_b = OpTypePointer CrossWorkgroup %struct_b
%kernel_sig = OpTypeFunction %void %ptr_struct_b
%uint_1024 = OpConstant %uint 1024
%float_pi = OpConstant %float 3.1415
%struct_a_src = OpConstantComposite %struct_a %uint_1024 %float_pi
%kernel = OpFunction %void None %kernel_sig
%dst = OpFunctionParameter %ptr_struct_b
%entry = OpLabel
%struct_b_dst = OpCopyLogical %struct_b %struct_a_src
OpStore %dst %struct_b_dst
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,24 @@
; SPIR-V
; Version: 1.4
OpCapability Addresses
OpCapability Kernel
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %kernel "copylogical_test"
%uint = OpTypeInt 32 0
%float = OpTypeFloat 32
%void = OpTypeVoid
%struct_a = OpTypeStruct %uint %float
%ptr_struct_a = OpTypePointer CrossWorkgroup %struct_a
%struct_b = OpTypeStruct %uint %float
%ptr_struct_b = OpTypePointer CrossWorkgroup %struct_b
%kernel_sig = OpTypeFunction %void %ptr_struct_b
%uint_1024 = OpConstant %uint 1024
%float_pi = OpConstant %float 3.1415
%struct_a_src = OpConstantComposite %struct_a %uint_1024 %float_pi
%kernel = OpFunction %void None %kernel_sig
%dst = OpFunctionParameter %ptr_struct_b
%entry = OpLabel
%struct_b_dst = OpCopyLogical %struct_b %struct_a_src
OpStore %dst %struct_b_dst
OpReturn
OpFunctionEnd