; REQUIRES: regkeys, spirv-as, dg2-supported ; RUN: spirv-as --target-env spv1.0 -o %t.spv %s ; RUN: ocloc compile -spirv_input -file %t.spv -device dg2 -options " -igc_opts 'ShaderDumpTranslationOnly=1'" 2>&1 | FileCheck %s --check-prefixes=CHECK,%SPV_CHECK_PREFIX% ; LLVM15PLUS expects -emit-opaque-pointers to be passed ; CHECK-LABEL: spir_kernel void @test ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfnDv2_fiPU3AS1Dh(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfnDv3_fiPU3AS1Dh(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfnDv4_fiPU3AS1Dh(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfnDv8_fiPU3AS1Dh(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfnDv16_fiPU3AS1Dh(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half2_v2f32_i32_p1f16(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half3_v3f32_i32_p1f16(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half4_v4f32_i32_p1f16(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half8_v8f32_i32_p1f16(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half16_v16f32_i32_p1f16(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z12vstore_half2Dv2_fjPU3AS1Dh(<2 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z12vstore_half3Dv3_fjPU3AS1Dh(<3 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z12vstore_half4Dv4_fjPU3AS1Dh(<4 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z12vstore_half8Dv8_fjPU3AS1Dh(<8 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z13vstore_half16Dv16_fjPU3AS1Dh(<16 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LABEL: spir_kernel void @testRTE ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv2_fiPU3AS1Dhi(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv3_fiPU3AS1Dhi(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv4_fiPU3AS1Dhi(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv8_fiPU3AS1Dhi(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv16_fiPU3AS1Dhi(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half2_r_v2f32_i32_p1f16_i32(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half3_r_v3f32_i32_p1f16_i32(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half4_r_v4f32_i32_p1f16_i32(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half8_r_v8f32_i32_p1f16_i32(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half16_r_v16f32_i32_p1f16_i32(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 0) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half2_rteDv2_fjPU3AS1Dh(<2 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half3_rteDv3_fjPU3AS1Dh(<3 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half4_rteDv4_fjPU3AS1Dh(<4 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half8_rteDv8_fjPU3AS1Dh(<8 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z17vstore_half16_rteDv16_fjPU3AS1Dh(<16 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LABEL: spir_kernel void @testRTZ ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv2_fiPU3AS1Dhi(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv3_fiPU3AS1Dhi(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv4_fiPU3AS1Dhi(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv8_fiPU3AS1Dhi(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv16_fiPU3AS1Dhi(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half2_r_v2f32_i32_p1f16_i32(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half3_r_v3f32_i32_p1f16_i32(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half4_r_v4f32_i32_p1f16_i32(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half8_r_v8f32_i32_p1f16_i32(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half16_r_v16f32_i32_p1f16_i32(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 1) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half2_rtzDv2_fjPU3AS1Dh(<2 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half3_rtzDv3_fjPU3AS1Dh(<3 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half4_rtzDv4_fjPU3AS1Dh(<4 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half8_rtzDv8_fjPU3AS1Dh(<8 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z17vstore_half16_rtzDv16_fjPU3AS1Dh(<16 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LABEL: spir_kernel void @testRTP ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv2_fiPU3AS1Dhi(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv3_fiPU3AS1Dhi(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv4_fiPU3AS1Dhi(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv8_fiPU3AS1Dhi(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv16_fiPU3AS1Dhi(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half2_r_v2f32_i32_p1f16_i32(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half3_r_v3f32_i32_p1f16_i32(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half4_r_v4f32_i32_p1f16_i32(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half8_r_v8f32_i32_p1f16_i32(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half16_r_v16f32_i32_p1f16_i32(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 2) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half2_rtpDv2_fjPU3AS1Dh(<2 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half3_rtpDv3_fjPU3AS1Dh(<3 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half4_rtpDv4_fjPU3AS1Dh(<4 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half8_rtpDv8_fjPU3AS1Dh(<8 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z17vstore_half16_rtpDv16_fjPU3AS1Dh(<16 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LABEL: spir_kernel void @testRTN ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv2_fiPU3AS1Dhi(<2 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv3_fiPU3AS1Dhi(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv4_fiPU3AS1Dhi(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv8_fiPU3AS1Dhi(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-KHR: call spir_func void @{{[0-9A-z_]+}}vstore_halfn_rDv16_fiPU3AS1Dhi(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half3_r_v3f32_i32_p1f16_i32(<3 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half4_r_v4f32_i32_p1f16_i32(<4 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half8_r_v8f32_i32_p1f16_i32(<8 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-LEGACY: call spir_func void @{{[0-9A-z_]+}}vstore_half16_r_v16f32_i32_p1f16_i32(<16 x float> {{.*}}, i32 0, half addrspace(1)* {{.*}}, i32 3) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half2_rtnDv2_fjPU3AS1Dh(<2 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half3_rtnDv3_fjPU3AS1Dh(<3 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half4_rtnDv4_fjPU3AS1Dh(<4 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z16vstore_half8_rtnDv8_fjPU3AS1Dh(<8 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) ; CHECK-LLVM15PLUS: call spir_func void @_Z17vstore_half16_rtnDv16_fjPU3AS1Dh(<16 x float> {{.*}}, i32 0, ptr addrspace(1) {{.*}}) OpCapability Addresses OpCapability Kernel OpCapability Vector16 OpCapability Float16Buffer %1 = OpExtInstImport "OpenCL.std" OpMemoryModel Physical32 OpenCL OpEntryPoint Kernel %6 "test" OpEntryPoint Kernel %27 "testRTE" OpEntryPoint Kernel %35 "testRTZ" OpEntryPoint Kernel %43 "testRTP" OpEntryPoint Kernel %51 "testRTN" %59 = OpString "kernel_arg_type.test.half*," %60 = OpString "kernel_arg_type.testRTE.half*," %61 = OpString "kernel_arg_type.testRTZ.half*," %62 = OpString "kernel_arg_type.testRTP.half*," %63 = OpString "kernel_arg_type.testRTN.half*," OpSource OpenCL_C 200000 %uint = OpTypeInt 32 0 %uint_0 = OpConstant %uint 0 %void = OpTypeVoid %half = OpTypeFloat 16 %_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half %5 = OpTypeFunction %void %_ptr_CrossWorkgroup_half %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %v3float = OpTypeVector %float 3 %v4float = OpTypeVector %float 4 %v8float = OpTypeVector %float 8 %v16float = OpTypeVector %float 16 %11 = OpConstantNull %v2float %16 = OpConstantNull %v3float %19 = OpConstantNull %v4float %22 = OpConstantNull %v8float %25 = OpConstantNull %v16float %6 = OpFunction %void None %5 %ptr = OpFunctionParameter %_ptr_CrossWorkgroup_half %entry = OpLabel %14 = OpExtInst %void %1 vstore_halfn %11 %uint_0 %ptr %17 = OpExtInst %void %1 vstore_halfn %16 %uint_0 %ptr %20 = OpExtInst %void %1 vstore_halfn %19 %uint_0 %ptr %23 = OpExtInst %void %1 vstore_halfn %22 %uint_0 %ptr %26 = OpExtInst %void %1 vstore_halfn %25 %uint_0 %ptr OpReturn OpFunctionEnd %27 = OpFunction %void None %5 %ptr_0 = OpFunctionParameter %_ptr_CrossWorkgroup_half %entry_0 = OpLabel %30 = OpExtInst %void %1 vstore_halfn_r %11 %uint_0 %ptr_0 RTE %31 = OpExtInst %void %1 vstore_halfn_r %16 %uint_0 %ptr_0 RTE %32 = OpExtInst %void %1 vstore_halfn_r %19 %uint_0 %ptr_0 RTE %33 = OpExtInst %void %1 vstore_halfn_r %22 %uint_0 %ptr_0 RTE %34 = OpExtInst %void %1 vstore_halfn_r %25 %uint_0 %ptr_0 RTE OpReturn OpFunctionEnd %35 = OpFunction %void None %5 %ptr_1 = OpFunctionParameter %_ptr_CrossWorkgroup_half %entry_1 = OpLabel %38 = OpExtInst %void %1 vstore_halfn_r %11 %uint_0 %ptr_1 RTZ %39 = OpExtInst %void %1 vstore_halfn_r %16 %uint_0 %ptr_1 RTZ %40 = OpExtInst %void %1 vstore_halfn_r %19 %uint_0 %ptr_1 RTZ %41 = OpExtInst %void %1 vstore_halfn_r %22 %uint_0 %ptr_1 RTZ %42 = OpExtInst %void %1 vstore_halfn_r %25 %uint_0 %ptr_1 RTZ OpReturn OpFunctionEnd %43 = OpFunction %void None %5 %ptr_2 = OpFunctionParameter %_ptr_CrossWorkgroup_half %entry_2 = OpLabel %46 = OpExtInst %void %1 vstore_halfn_r %11 %uint_0 %ptr_2 RTP %47 = OpExtInst %void %1 vstore_halfn_r %16 %uint_0 %ptr_2 RTP %48 = OpExtInst %void %1 vstore_halfn_r %19 %uint_0 %ptr_2 RTP %49 = OpExtInst %void %1 vstore_halfn_r %22 %uint_0 %ptr_2 RTP %50 = OpExtInst %void %1 vstore_halfn_r %25 %uint_0 %ptr_2 RTP OpReturn OpFunctionEnd %51 = OpFunction %void None %5 %ptr_3 = OpFunctionParameter %_ptr_CrossWorkgroup_half %entry_3 = OpLabel %54 = OpExtInst %void %1 vstore_halfn_r %11 %uint_0 %ptr_3 RTN %55 = OpExtInst %void %1 vstore_halfn_r %16 %uint_0 %ptr_3 RTN %56 = OpExtInst %void %1 vstore_halfn_r %19 %uint_0 %ptr_3 RTN %57 = OpExtInst %void %1 vstore_halfn_r %22 %uint_0 %ptr_3 RTN %58 = OpExtInst %void %1 vstore_halfn_r %25 %uint_0 %ptr_3 RTN OpReturn OpFunctionEnd