Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/OpenCL.std/upsample.spvasm

raw
1 ; REQUIRES: spirv-as
2 ; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
3 ; RUN: spirv-val %t.spv
4 ; RUN: llvm-spirv %t.spv -r -emit-opaque-pointers --spirv-target-env=SPV-IR -o - | llvm-dis | FileCheck %s --check-prefixes=CHECK,CHECK-SPV-IR
5 ; RUN: llvm-spirv %t.spv -r -emit-opaque-pointers --spirv-target-env=CL2.0 -o - | llvm-dis | FileCheck %s --check-prefixes=CHECK,CHECK-CL20
6 ;
7 ; CHECK-LABEL: spir_kernel void @test
8 ; CHECK-SPV-IR: call spir_func i64 @_Z22__spirv_ocl_s_upsampleij(i32 %{{[0-9a-z]+}}, i32
9 ; CHECK-SPV-IR: call spir_func i64 @_Z22__spirv_ocl_u_upsamplejj(i32 %{{[0-9a-z]+}}, i32
10 ; CHECK-CL20: call spir_func i64 @_Z8upsampleij(i32 %{{[0-9a-z]+}}, i32
11 ; CHECK-CL20: call spir_func i64 @_Z8upsamplejj(i32 %{{[0-9a-z]+}}, i32
12 ; CHECK-LABEL: spir_kernel void @test2
13 ; CHECK-SPV-IR: call spir_func <4 x i64> @_Z22__spirv_ocl_s_upsampleDv4_iDv4_j(<4 x i32> %{{[0-9a-z]+}}, <4 x i32>
14 ; CHECK-SPV-IR: call spir_func <4 x i64> @_Z22__spirv_ocl_u_upsampleDv4_jS_(<4 x i32> %{{[0-9a-z]+}}, <4 x i32>
15 ; CHECK-CL20: call spir_func <4 x i64> @_Z8upsampleDv4_iDv4_j(<4 x i32> %{{[0-9a-z]+}}, <4 x i32>
16 ; CHECK-CL20: call spir_func <4 x i64> @_Z8upsampleDv4_jS_(<4 x i32> %{{[0-9a-z]+}}, <4 x i32>
17
18 OpCapability Addresses
19 OpCapability Kernel
20 OpCapability Int64
21 %1 = OpExtInstImport "OpenCL.std"
22 OpMemoryModel Physical32 OpenCL
23 OpEntryPoint Kernel %7 "test"
24 OpEntryPoint Kernel %20 "test2"
25 %28 = OpString "kernel_arg_type.test.int,uint,long*,"
26 %29 = OpString "kernel_arg_type.test2.int4,uint4,ulong4*,"
27 OpSource OpenCL_C 200000
28 OpName %a "a"
29 OpName %b "b"
30 OpName %c "c"
31 OpName %entry "entry"
32 OpName %call "call"
33 OpName %call1 "call1"
34 OpName %arrayidx2 "arrayidx2"
35 OpName %call2 "call2"
36 OpName %b_0 "b"
37 OpName %c_0 "c"
38 OpName %entry_0 "entry"
39 OpName %call1_0 "call1"
40 OpName %call3 "call3"
41 OpName %arrayidx4 "arrayidx4"
42 OpDecorate %c FuncParamAttr NoCapture
43 OpDecorate %c_0 FuncParamAttr NoCapture
44 %uint = OpTypeInt 32 0
45 %ulong = OpTypeInt 64 0
46 %uint_1 = OpConstant %uint 1
47 %void = OpTypeVoid
48 %_ptr_CrossWorkgroup_ulong = OpTypePointer CrossWorkgroup %ulong
49 %6 = OpTypeFunction %void %uint %uint %_ptr_CrossWorkgroup_ulong
50 %v4uint = OpTypeVector %uint 4
51 %v4ulong = OpTypeVector %ulong 4
52 %_ptr_CrossWorkgroup_v4ulong = OpTypePointer CrossWorkgroup %v4ulong
53 %19 = OpTypeFunction %void %v4uint %v4uint %_ptr_CrossWorkgroup_v4ulong
54 %7 = OpFunction %void None %6
55 %a = OpFunctionParameter %uint
56 %b = OpFunctionParameter %uint
57 %c = OpFunctionParameter %_ptr_CrossWorkgroup_ulong
58 %entry = OpLabel
59 %call = OpExtInst %ulong %1 s_upsample %a %b
60 OpStore %c %call Aligned 8
61 %call1 = OpExtInst %ulong %1 u_upsample %a %b
62 %arrayidx2 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ulong %c %uint_1
63 OpStore %arrayidx2 %call1 Aligned 8
64 OpReturn
65 OpFunctionEnd
66 %20 = OpFunction %void None %19
67 %call2 = OpFunctionParameter %v4uint
68 %b_0 = OpFunctionParameter %v4uint
69 %c_0 = OpFunctionParameter %_ptr_CrossWorkgroup_v4ulong
70 %entry_0 = OpLabel
71 %call1_0 = OpExtInst %v4ulong %1 s_upsample %call2 %b_0
72 OpStore %c_0 %call1_0 Aligned 32
73 %call3 = OpExtInst %v4ulong %1 u_upsample %call2 %b_0
74 %arrayidx4 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4ulong %c_0 %uint_1
75 OpStore %arrayidx4 %call3 Aligned 32
76 OpReturn
77 OpFunctionEnd