mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
The following tests under `spirv_new`:
* `op_branch_conditional`
* `op_phi`
* `op_selection_merge`
were using randomly generated `cl_int` values, and storing the
difference between them as a `cl_int`. If one of the generated values is
negative and large enough, while the other is positive and large enough,
the difference then becomes a larger value that cannot be represented
using `cl_int`.
Switch the tests to use `cl_uint` instead, and update the relevant
spvasm{32,64} files to use `OpULessThan` instead of `OpSLessThan`.
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
72 lines
2.9 KiB
Plaintext
72 lines
2.9 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: Khronos SPIR-V Tools Assembler; 0
|
|
; Bound: 42
|
|
; Schema: 0
|
|
OpCapability Addresses
|
|
OpCapability Linkage
|
|
OpCapability Kernel
|
|
OpCapability Int64
|
|
OpMemoryModel Physical64 OpenCL
|
|
OpEntryPoint Kernel %1 "phi_4" %gl_GlobalInvocationID
|
|
OpName %res "res"
|
|
OpName %lhs "lhs"
|
|
OpName %rhs "rhs"
|
|
OpDecorate %5 FuncParamAttr NoCapture
|
|
%5 = OpDecorationGroup
|
|
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
|
OpDecorate %gl_GlobalInvocationID Constant
|
|
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
|
OpGroupDecorate %5 %res %lhs %rhs
|
|
%ulong = OpTypeInt 64 0
|
|
%v3ulong = OpTypeVector %ulong 3
|
|
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
|
%ulong_32 = OpConstant %ulong 32
|
|
%bool = OpTypeBool
|
|
%void = OpTypeVoid
|
|
%uint = OpTypeInt 32 0
|
|
%uint_0 = OpConstant %uint 0
|
|
%uint_65535 = OpConstant %uint 65535
|
|
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
|
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
|
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
|
%1 = OpFunction %void None %16
|
|
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
|
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
|
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
|
%17 = 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_uint %lhs %21
|
|
%23 = OpLoad %uint %22 Aligned 4
|
|
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %21
|
|
%25 = OpLoad %uint %24 Aligned 4
|
|
%26 = OpULessThan %bool %23 %25
|
|
OpBranchConditional %26 %27 %28
|
|
%27 = OpLabel
|
|
%29 = OpULessThan %bool %23 %uint_65535
|
|
OpBranchConditional %29 %30 %31
|
|
%30 = OpLabel
|
|
%32 = OpISub %uint %uint_0 %23
|
|
OpBranch %33
|
|
%31 = OpLabel
|
|
%34 = OpISub %uint %23 %uint_0
|
|
OpBranch %33
|
|
%28 = OpLabel
|
|
%35 = OpULessThan %bool %25 %uint_65535
|
|
OpBranchConditional %35 %36 %37
|
|
%36 = OpLabel
|
|
%38 = OpISub %uint %uint_0 %25
|
|
OpBranch %33
|
|
%37 = OpLabel
|
|
%39 = OpISub %uint %25 %uint_0
|
|
OpBranch %33
|
|
%33 = OpLabel
|
|
%40 = OpPhi %uint %32 %30 %34 %31 %38 %36 %39 %37
|
|
%41 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %21
|
|
OpStore %41 %40 Aligned 4
|
|
OpReturn
|
|
OpFunctionEnd
|