mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
This PR adds targeted testing for the SPIR-V 1.4 instructions OpPtrEqual, OpPtrNotEqual, and OpPtrDiff.
35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
|
; Bound: 61
|
|
; Schema: 0
|
|
OpCapability Addresses
|
|
OpCapability Kernel
|
|
OpMemoryModel Physical32 OpenCL
|
|
OpEntryPoint Kernel %kernel "ptrops_test"
|
|
%uint = OpTypeInt 32 0
|
|
%uint_0 = OpConstant %uint 0
|
|
%uint_1 = OpConstant %uint 1
|
|
%uint_2 = OpConstant %uint 2
|
|
%void = OpTypeVoid
|
|
%ptr_uint = OpTypePointer CrossWorkgroup %uint
|
|
%kernel_sig = OpTypeFunction %void %ptr_uint %ptr_uint
|
|
%bool = OpTypeBool
|
|
%kernel = OpFunction %void None %kernel_sig
|
|
%dst = OpFunctionParameter %ptr_uint
|
|
%tst = OpFunctionParameter %ptr_uint
|
|
%entry = OpLabel
|
|
%cmp = OpPtrEqual %bool %dst %tst
|
|
%bool0 = OpSelect %uint %cmp %uint_1 %uint_0
|
|
%dst0 = OpInBoundsPtrAccessChain %ptr_uint %dst %uint_0
|
|
OpStore %dst0 %bool0 Aligned 4
|
|
%cmp1 = OpPtrNotEqual %bool %dst %tst
|
|
%bool1 = OpSelect %uint %cmp1 %uint_1 %uint_0
|
|
%dst1 = OpInBoundsPtrAccessChain %ptr_uint %dst %uint_1
|
|
OpStore %dst1 %bool1 Aligned 4
|
|
%delta = OpPtrDiff %uint %dst %tst
|
|
%dst2 = OpInBoundsPtrAccessChain %ptr_uint %dst %uint_2
|
|
OpStore %dst2 %delta Aligned 4
|
|
OpReturn
|
|
OpFunctionEnd
|