Files
OpenCL-CTS/test_conformance/spirv_new/spirv_asm/fdiv_double2.spvasm32
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

48 lines
2.2 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 25
; Schema: 0
OpCapability Float64
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
%1 = OpExtInstImport "OpenCL.std"
OpMemoryModel Physical32 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
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%void = OpTypeVoid
%double = OpTypeFloat 64
%v2double = OpTypeVector %double 2
%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%2 = OpFunction %void None %16
%res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double
%entry = OpLabel
%17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
%18 = OpCompositeExtract %uint %17 0
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %lhs %18
%20 = OpLoad %v2double %19 Aligned 16
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %rhs %18
%22 = OpLoad %v2double %21 Aligned 16
%23 = OpFDiv %v2double %20 %22
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_v2double %res %18
OpStore %24 %23 Aligned 16
OpReturn
OpFunctionEnd