-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SPIR-V 1.4 testing for various miscellaneous additions (#2122)
This PR adds targeted testing for a few remaining miscellaneous SPIR-V 1.4 features: * Variables in the Function storage class can have a NonWriteable decoration. * OpCopyMemorySized can have two optional memory operands. * OpSelect can have composite operands that are not vectors.
- Loading branch information
Showing
7 changed files
with
349 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
test_conformance/spirv_new/spirv_asm/spv1.4/copymemory_memory_operands.spvasm32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; SPIR-V | ||
; Version: 1.4 | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpMemoryModel Physical32 OpenCL | ||
OpEntryPoint Kernel %kernel "copymemory_test" | ||
%uint = OpTypeInt 32 0 | ||
%void = OpTypeVoid | ||
%gptr_int = OpTypePointer CrossWorkgroup %uint | ||
%pptr_int = OpTypePointer Function %uint | ||
%kernel_sig = OpTypeFunction %void %gptr_int | ||
%uint_42 = OpConstant %uint 42 | ||
%uint_1 = OpConstant %uint 1 | ||
%uint_2 = OpConstant %uint 2 | ||
%uint_3 = OpConstant %uint 3 | ||
%uint_4 = OpConstant %uint 4 | ||
%uint_5 = OpConstant %uint 5 | ||
%kernel = OpFunction %void None %kernel_sig | ||
%dst = OpFunctionParameter %gptr_int | ||
%entry = OpLabel | ||
%pvalue = OpVariable %pptr_int Function %uint_42 | ||
OpCopyMemory %dst %pvalue ; no memory operands | ||
%dst1 = OpInBoundsPtrAccessChain %gptr_int %dst %uint_1 | ||
OpCopyMemory %dst1 %pvalue Volatile ; one memory operand | ||
%dst2 = OpInBoundsPtrAccessChain %gptr_int %dst %uint_2 | ||
OpCopyMemory %dst2 %pvalue Volatile Volatile ; two memory operands | ||
%dst3 = OpInBoundsPtrAccessChain %gptr_int %dst %uint_3 | ||
OpCopyMemorySized %dst3 %pvalue %uint_4 ; no memory operands | ||
%dst4 = OpInBoundsPtrAccessChain %gptr_int %dst %uint_4 | ||
OpCopyMemorySized %dst4 %pvalue %uint_4 Volatile ; one memory operand | ||
%dst5 = OpInBoundsPtrAccessChain %gptr_int %dst %uint_5 | ||
OpCopyMemorySized %dst5 %pvalue %uint_4 Volatile Volatile ; two memory operands | ||
OpReturn | ||
OpFunctionEnd |
36 changes: 36 additions & 0 deletions
36
test_conformance/spirv_new/spirv_asm/spv1.4/copymemory_memory_operands.spvasm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
; SPIR-V | ||
; Version: 1.4 | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpCapability Int64 | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %kernel "copymemory_test" | ||
%uint = OpTypeInt 32 0 | ||
%ulong = OpTypeInt 64 0 | ||
%void = OpTypeVoid | ||
%gptr_int = OpTypePointer CrossWorkgroup %uint | ||
%pptr_int = OpTypePointer Function %uint | ||
%kernel_sig = OpTypeFunction %void %gptr_int | ||
%uint_42 = OpConstant %uint 42 | ||
%ulong_1 = OpConstant %ulong 1 | ||
%ulong_2 = OpConstant %ulong 2 | ||
%ulong_3 = OpConstant %ulong 3 | ||
%ulong_4 = OpConstant %ulong 4 | ||
%ulong_5 = OpConstant %ulong 5 | ||
%kernel = OpFunction %void None %kernel_sig | ||
%dst = OpFunctionParameter %gptr_int | ||
%entry = OpLabel | ||
%pvalue = OpVariable %pptr_int Function %uint_42 | ||
OpCopyMemory %dst %pvalue ; no memory operands | ||
%dst1 = OpInBoundsPtrAccessChain %gptr_int %dst %ulong_1 | ||
OpCopyMemory %dst1 %pvalue Volatile ; one memory operand | ||
%dst2 = OpInBoundsPtrAccessChain %gptr_int %dst %ulong_2 | ||
OpCopyMemory %dst2 %pvalue Volatile Volatile ; two memory operands | ||
%dst3 = OpInBoundsPtrAccessChain %gptr_int %dst %ulong_3 | ||
OpCopyMemorySized %dst3 %pvalue %ulong_4 ; no memory operands | ||
%dst4 = OpInBoundsPtrAccessChain %gptr_int %dst %ulong_4 | ||
OpCopyMemorySized %dst4 %pvalue %ulong_4 Volatile ; one memory operand | ||
%dst5 = OpInBoundsPtrAccessChain %gptr_int %dst %ulong_5 | ||
OpCopyMemorySized %dst5 %pvalue %ulong_4 Volatile Volatile ; two memory operands | ||
OpReturn | ||
OpFunctionEnd |
21 changes: 21 additions & 0 deletions
21
...rmance/spirv_new/spirv_asm/spv1.4/nonwriteable_decoration_function_storage_class.spvasm32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; SPIR-V | ||
; Version: 1.4 | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpMemoryModel Physical32 OpenCL | ||
OpEntryPoint Kernel %kernel "nonwriteable_test" | ||
OpDecorate %pvalue NonWritable | ||
%uint = OpTypeInt 32 0 | ||
%void = OpTypeVoid | ||
%gptr_int = OpTypePointer CrossWorkgroup %uint | ||
%pptr_int = OpTypePointer Function %uint | ||
%kernel_sig = OpTypeFunction %void %gptr_int | ||
%uint_42 = OpConstant %uint 42 | ||
%kernel = OpFunction %void None %kernel_sig | ||
%dst = OpFunctionParameter %gptr_int | ||
%entry = OpLabel | ||
%pvalue = OpVariable %pptr_int Function %uint_42 | ||
%value = OpLoad %uint %pvalue | ||
OpStore %dst %value | ||
OpReturn | ||
OpFunctionEnd |
21 changes: 21 additions & 0 deletions
21
...rmance/spirv_new/spirv_asm/spv1.4/nonwriteable_decoration_function_storage_class.spvasm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; SPIR-V | ||
; Version: 1.4 | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %kernel "nonwriteable_test" | ||
OpDecorate %pvalue NonWritable | ||
%uint = OpTypeInt 32 0 | ||
%void = OpTypeVoid | ||
%gptr_int = OpTypePointer CrossWorkgroup %uint | ||
%pptr_int = OpTypePointer Function %uint | ||
%kernel_sig = OpTypeFunction %void %gptr_int | ||
%uint_42 = OpConstant %uint 42 | ||
%kernel = OpFunction %void None %kernel_sig | ||
%dst = OpFunctionParameter %gptr_int | ||
%entry = OpLabel | ||
%pvalue = OpVariable %pptr_int Function %uint_42 | ||
%value = OpLoad %uint %pvalue | ||
OpStore %dst %value | ||
OpReturn | ||
OpFunctionEnd |
38 changes: 38 additions & 0 deletions
38
test_conformance/spirv_new/spirv_asm/spv1.4/select_struct.spvasm32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
; SPIR-V | ||
; Version: 1.4 | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpMemoryModel Physical32 OpenCL | ||
OpEntryPoint Kernel %kernel "select_struct_test" %pgid | ||
OpDecorate %pgid BuiltIn GlobalInvocationId | ||
OpDecorate %pgid Constant | ||
%uint = OpTypeInt 32 0 | ||
%v3uint = OpTypeVector %uint 3 | ||
%float = OpTypeFloat 32 | ||
%void = OpTypeVoid | ||
%bool = OpTypeBool | ||
%struct = OpTypeStruct %uint %float | ||
%gptr_struct = OpTypePointer CrossWorkgroup %struct | ||
%iptr_v3uint = OpTypePointer Input %v3uint | ||
%kernel_sig = OpTypeFunction %void %gptr_struct | ||
%uint_0 = OpConstant %uint 0 | ||
%uint_1 = OpConstant %uint 1 | ||
%uint_1024 = OpConstant %uint 1024 | ||
%float_pi = OpConstant %float 3.1415 | ||
%uint_2048 = OpConstant %uint 2048 | ||
%float_e = OpConstant %float 2.7128 | ||
%struct_a = OpConstantComposite %struct %uint_1024 %float_pi | ||
%struct_b = OpConstantComposite %struct %uint_2048 %float_e | ||
%pgid = OpVariable %iptr_v3uint Input | ||
%kernel = OpFunction %void None %kernel_sig | ||
%dst_base = OpFunctionParameter %gptr_struct | ||
%entry = OpLabel | ||
%gid = OpLoad %v3uint %pgid Aligned 32 | ||
%gid0 = OpCompositeExtract %uint %gid 0 | ||
%test = OpBitwiseAnd %uint %gid0 %uint_1 | ||
%cond = OpIEqual %bool %test %uint_1 | ||
%result = OpSelect %struct %cond %struct_a %struct_b | ||
%dst = OpInBoundsPtrAccessChain %gptr_struct %dst_base %gid0 | ||
OpStore %dst %result | ||
OpReturn | ||
OpFunctionEnd |
40 changes: 40 additions & 0 deletions
40
test_conformance/spirv_new/spirv_asm/spv1.4/select_struct.spvasm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
; SPIR-V | ||
; Version: 1.4 | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpCapability Int64 | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %kernel "select_struct_test" %pgid | ||
OpDecorate %pgid BuiltIn GlobalInvocationId | ||
OpDecorate %pgid Constant | ||
%uint = OpTypeInt 32 0 | ||
%ulong = OpTypeInt 64 0 | ||
%v3ulong = OpTypeVector %ulong 3 | ||
%float = OpTypeFloat 32 | ||
%void = OpTypeVoid | ||
%bool = OpTypeBool | ||
%struct = OpTypeStruct %uint %float | ||
%gptr_struct = OpTypePointer CrossWorkgroup %struct | ||
%iptr_v3ulong = OpTypePointer Input %v3ulong | ||
%kernel_sig = OpTypeFunction %void %gptr_struct | ||
%ulong_0 = OpConstant %ulong 0 | ||
%ulong_1 = OpConstant %ulong 1 | ||
%uint_1024 = OpConstant %uint 1024 | ||
%float_pi = OpConstant %float 3.1415 | ||
%uint_2048 = OpConstant %uint 2048 | ||
%float_e = OpConstant %float 2.7128 | ||
%struct_a = OpConstantComposite %struct %uint_1024 %float_pi | ||
%struct_b = OpConstantComposite %struct %uint_2048 %float_e | ||
%pgid = OpVariable %iptr_v3ulong Input | ||
%kernel = OpFunction %void None %kernel_sig | ||
%dst_base = OpFunctionParameter %gptr_struct | ||
%entry = OpLabel | ||
%gid = OpLoad %v3ulong %pgid Aligned 32 | ||
%gid0 = OpCompositeExtract %ulong %gid 0 | ||
%test = OpBitwiseAnd %ulong %gid0 %ulong_1 | ||
%cond = OpIEqual %bool %test %ulong_1 | ||
%result = OpSelect %struct %cond %struct_a %struct_b | ||
%dst = OpInBoundsPtrAccessChain %gptr_struct %dst_base %gid0 | ||
OpStore %dst %result | ||
OpReturn | ||
OpFunctionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters