Files
OpenCL-CTS/test_conformance/spirv_new/spirv_asm/fmul_float4.spvasm64
Pierre Moreau a69f3ca8cf SPIR-V: BuiltIn variables use the Input storage class (#769)
The OpenCL SPIR-V Environment Specification was updated to mandate that
all variables decorated with `BuiltIn` must be in the `Input` storage
class, see https://github.com/KhronosGroup/OpenCL-Docs/pull/278.

Global variables with the Input storage class have to be listed in the
entry points’ interface, which was also taken care of in this commit.
2020-07-03 09:21:41 +01:00

51 lines
2.3 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 28
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
OpCapability Int64
%1 = OpExtInstImport "OpenCL.std"
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID
OpName %res "res"
OpName %lhs "lhs"
OpName %rhs "rhs"
OpName %entry "entry"
OpDecorate %7 FuncParamAttr NoCapture
%7 = OpDecorationGroup
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_GlobalInvocationID Constant
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
OpGroupDecorate %7 %res %lhs %rhs
%ulong = OpTypeInt 64 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
%void = OpTypeVoid
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_CrossWorkgroup_v4float = OpTypePointer CrossWorkgroup %v4float
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float %_ptr_CrossWorkgroup_v4float
%ulong_32 = OpConstant %ulong 32
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
%2 = OpFunction %void None %16
%res = OpFunctionParameter %_ptr_CrossWorkgroup_v4float
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v4float
%entry = OpLabel
%18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
%19 = OpCompositeExtract %ulong %18 0
%20 = OpShiftLeftLogical %ulong %19 %ulong_32
%21 = OpShiftRightArithmetic %ulong %20 %ulong_32
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %lhs %21
%23 = OpLoad %v4float %22 Aligned 16
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %rhs %21
%25 = OpLoad %v4float %24 Aligned 16
%26 = OpFMul %v4float %23 %25
%27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v4float %res %21
OpStore %27 %26 Aligned 16
OpReturn
OpFunctionEnd