-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAtomicCompareExchangeWeak.spvasm
57 lines (54 loc) · 2.65 KB
/
AtomicCompareExchangeWeak.spvasm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; Check OpAtomicCompareExchangeWeak is treated as OpAtomicCompareExchange
; REQUIRES: spirv-as
; RUN: spirv-as --target-env spv1.3 -o %t.spv %s
; RUN: spirv-val %t.spv
; RUN: amd-llvm-spirv -r --spirv-target-env=CL2.0 --spirv-target-env="SPV-IR" -o - %t.spv | llvm-dis | FileCheck %s
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Int8
%1 = OpExtInstImport "OpenCL.std"
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %19 "test_atomic_global"
OpSource OpenCL_C 200000
OpName %test_atomic_global "test_atomic_global"
OpName %dst "dst"
OpName %object "object"
OpName %expected "expected"
OpName %desired "desired"
OpName %dst_0 "dst"
OpName %object_0 "object"
OpName %expected_0 "expected"
OpName %desired_0 "desired"
OpDecorate %test_atomic_global LinkageAttributes "test_atomic_global" Export
OpDecorate %dst_0 Volatile
%uint = OpTypeInt 32 0
%uchar = OpTypeInt 8 0
%uint_1 = OpConstant %uint 1
%uint_16 = OpConstant %uint 16
%uint_0 = OpConstant %uint 0
%void = OpTypeVoid
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
%7 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_uchar %uint
%test_atomic_global = OpFunction %void None %7
%dst = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%object = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
%expected = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
%desired = OpFunctionParameter %uint
%13 = OpLabel
%17 = OpAtomicCompareExchange %uint %dst %uint_1 %uint_16 %uint_16 %uint_1 %uint_0
%18 = OpAtomicCompareExchangeWeak %uint %dst %uint_1 %uint_16 %uint_16 %uint_1 %uint_0
OpReturn
OpFunctionEnd
%19 = OpFunction %void None %7
%dst_0 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%object_0 = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
%expected_0 = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
%desired_0 = OpFunctionParameter %uint
%24 = OpLabel
%25 = OpFunctionCall %void %test_atomic_global %dst_0 %object_0 %expected_0 %desired_0
OpReturn
OpFunctionEnd
; CHECK: call spir_func i32 @_Z29__spirv_AtomicCompareExchangePU3AS1iiiiii(
; CHECK-NOT: call spir_func i32 @_Z33__spirv_AtomicCompareExchangeWeakPU3AS1iiiiii(