| 1 |
119734787 65536 393230 34 0 |
| 2 |
2 Capability Addresses |
| 3 |
2 Capability Linkage |
| 4 |
2 Capability Kernel |
| 5 |
2 Capability Int64 |
| 6 |
2 Capability Int64Atomics |
| 7 |
2 Capability GenericPointer |
| 8 |
5 ExtInstImport 1 "OpenCL.std" |
| 9 |
3 MemoryModel 1 2 |
| 10 |
3 Source 3 200000 |
| 11 |
5 Decorate 8 LinkageAttributes "foo" Export |
| 12 |
4 TypeInt 3 64 0 |
| 13 |
4 TypeInt 5 32 0 |
| 14 |
4 Constant 5 17 1 |
| 15 |
4 Constant 5 18 16 |
| 16 |
2 TypeVoid 2 |
| 17 |
4 TypePointer 4 8 3 |
| 18 |
4 TypePointer 6 8 5 |
| 19 |
9 TypeFunction 7 2 4 4 6 3 3 3 |
| 20 |
2 TypeBool 32 |
| 21 |
|
| 22 |
|
| 23 |
5 Function 2 8 0 7 |
| 24 |
3 FunctionParameter 4 9 |
| 25 |
3 FunctionParameter 4 10 |
| 26 |
3 FunctionParameter 6 11 |
| 27 |
3 FunctionParameter 3 12 |
| 28 |
3 FunctionParameter 3 13 |
| 29 |
3 FunctionParameter 3 14 |
| 30 |
|
| 31 |
2 Label 15 |
| 32 |
6 AtomicLoad 3 16 9 17 18 |
| 33 |
5 AtomicStore 9 17 18 12 |
| 34 |
7 AtomicExchange 3 19 9 17 18 12 |
| 35 |
9 AtomicCompareExchange 3 20 9 17 18 18 12 14 |
| 36 |
6 AtomicIIncrement 3 21 9 17 18 |
| 37 |
6 AtomicIDecrement 3 22 9 17 18 |
| 38 |
7 AtomicIAdd 3 23 9 17 18 12 |
| 39 |
7 AtomicISub 3 24 9 17 18 12 |
| 40 |
7 AtomicSMin 3 25 9 17 18 12 |
| 41 |
7 AtomicUMin 3 26 10 17 18 13 |
| 42 |
7 AtomicSMax 3 27 9 17 18 12 |
| 43 |
7 AtomicUMax 3 28 10 17 18 13 |
| 44 |
7 AtomicAnd 3 29 9 17 18 12 |
| 45 |
7 AtomicOr 3 30 9 17 18 12 |
| 46 |
7 AtomicXor 3 31 9 17 18 12 |
| 47 |
6 AtomicFlagTestAndSet 32 33 11 17 18 |
| 48 |
4 AtomicFlagClear 11 17 18 |
| 49 |
1 Return |
| 50 |
|
| 51 |
1 FunctionEnd |
| 52 |
|
| 53 |
; RUN: llvm-spirv --to-binary %s -o %t.spv |
| 54 |
; RUN: spirv-val %t.spv |
| 55 |
; RUN: llvm-spirv --spirv-target-env=CL1.2 -r %t.spv -o - | llvm-dis -o %t.ll |
| 56 |
; RUN: FileCheck %s < %t.ll |
| 57 |
|
| 58 |
; OpAtomicLoad is emulated via atom_add(*p, 0) |
| 59 |
; CHECK: call spir_func i64 @_Z8atom_addPU3AS4Vll |
| 60 |
|
| 61 |
; OpAtomicStore is emulated via atom_xchg(*p, val) |
| 62 |
; CHECK: call spir_func i64 @_Z9atom_xchgPU3AS4Vll |
| 63 |
|
| 64 |
; CHECK: call spir_func i64 @_Z9atom_xchgPU3AS4Vll |
| 65 |
; CHECK: call spir_func i64 @_Z12atom_cmpxchgPU3AS4Vlll |
| 66 |
; CHECK: call spir_func i64 @_Z8atom_incPU3AS4Vl |
| 67 |
; CHECK: call spir_func i64 @_Z8atom_decPU3AS4Vl |
| 68 |
; CHECK: call spir_func i64 @_Z8atom_addPU3AS4Vll |
| 69 |
; CHECK: call spir_func i64 @_Z8atom_subPU3AS4Vll |
| 70 |
; CHECK: call spir_func i64 @_Z8atom_minPU3AS4Vll |
| 71 |
; CHECK: call spir_func i64 @_Z8atom_minPU3AS4Vmm |
| 72 |
; CHECK: call spir_func i64 @_Z8atom_maxPU3AS4Vll |
| 73 |
; CHECK: call spir_func i64 @_Z8atom_maxPU3AS4Vmm |
| 74 |
; CHECK: call spir_func i64 @_Z8atom_andPU3AS4Vll |
| 75 |
; CHECK: call spir_func i64 @_Z7atom_orPU3AS4Vll |
| 76 |
; CHECK: call spir_func i64 @_Z8atom_xorPU3AS4Vll |
| 77 |
|
| 78 |
; OpAtomicFlagTestAndSet is emulated via atomic_xchg(*p, 1) |
| 79 |
; CHECK: call spir_func i32 @_Z11atomic_xchg |
| 80 |
|
| 81 |
; OpAtomicFlagClear is emulated via atomic_xchg(*p, 0) |
| 82 |
; CHECK: call spir_func i32 @_Z11atomic_xchg |
| 83 |
|