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>
53 lines
2.2 KiB
Plaintext
53 lines
2.2 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: Khronos SPIR-V Tools Assembler; 0
|
|
; Bound: 29
|
|
; Schema: 0
|
|
OpCapability Addresses
|
|
OpCapability Linkage
|
|
OpCapability Kernel
|
|
OpMemoryModel Physical32 OpenCL
|
|
OpEntryPoint Kernel %1 "phi_2" %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
|
|
%uint = OpTypeInt 32 0
|
|
%v3uint = OpTypeVector %uint 3
|
|
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
|
%bool = OpTypeBool
|
|
%void = OpTypeVoid
|
|
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
|
%13 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
|
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
|
%1 = OpFunction %void None %13
|
|
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
|
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
|
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
|
%14 = OpLabel
|
|
%15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
|
%16 = OpCompositeExtract %uint %15 0
|
|
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %16
|
|
%18 = OpLoad %uint %17 Aligned 4
|
|
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %16
|
|
%20 = OpLoad %uint %19 Aligned 4
|
|
%21 = OpULessThan %bool %18 %20
|
|
OpBranchConditional %21 %22 %23
|
|
%22 = OpLabel
|
|
%24 = OpISub %uint %20 %18
|
|
OpBranch %25
|
|
%23 = OpLabel
|
|
%26 = OpISub %uint %18 %20
|
|
OpBranch %25
|
|
%25 = OpLabel
|
|
%27 = OpPhi %uint %24 %22 %26 %23
|
|
%28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %16
|
|
OpStore %28 %27 Aligned 4
|
|
OpReturn
|
|
OpFunctionEnd
|