forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
OpConvertPtrToU_widening.spvasm
28 lines (27 loc) · 1.13 KB
/
OpConvertPtrToU_widening.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
; REQUIRES: spirv-as
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s
OpCapability Addresses
OpCapability Kernel
OpCapability Int64
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "testWideningPtrToU"
OpName %a "a"
OpName %res "res"
OpName %entry "entry"
%uint = OpTypeInt 32 0
%ulong = OpTypeInt 64 0
%void = OpTypeVoid
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
%_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong
%17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_ulong
%1 = OpFunction %void None %17
%a = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ulong
%entry = OpLabel
%18 = OpConvertPtrToU %ulong %a
OpStore %res %18 Aligned 8
OpReturn
OpFunctionEnd
; CHECK: ptrtoint ptr addrspace(1) %a to i64