blob: 3bbb8ba2d9140a1becb284cfaded3f3409b1bd3d [file] [log] [blame]
James Price16eeff32022-03-31 22:30:10 +00001; SPIR-V
2; Version: 1.3
3; Generator: Google Tint Compiler; 0
Ben Clayton03de0e82023-03-02 20:48:48 +00004; Bound: 50
James Price16eeff32022-03-31 22:30:10 +00005; Schema: 0
6 OpCapability Shader
7 OpMemoryModel Logical GLSL450
8 OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
9 OpExecutionMode %unused_entry_point LocalSize 1 1 1
Zhaoming Jiang6ab5d3c2022-11-02 02:25:38 +000010 OpName %v_block "v_block"
11 OpMemberName %v_block 0 "inner"
James Price16eeff32022-03-31 22:30:10 +000012 OpName %S "S"
13 OpMemberName %S 0 "a"
14 OpName %v "v"
15 OpName %unused_entry_point "unused_entry_point"
Ben Clayton46ee6392022-11-09 22:04:11 +000016 OpName %tint_mod "tint_mod"
17 OpName %lhs "lhs"
18 OpName %rhs "rhs"
James Price16eeff32022-03-31 22:30:10 +000019 OpName %foo "foo"
Zhaoming Jiang6ab5d3c2022-11-02 02:25:38 +000020 OpDecorate %v_block Block
21 OpMemberDecorate %v_block 0 Offset 0
James Price16eeff32022-03-31 22:30:10 +000022 OpMemberDecorate %S 0 Offset 0
23 OpDecorate %v DescriptorSet 0
24 OpDecorate %v Binding 0
25 %int = OpTypeInt 32 1
26 %S = OpTypeStruct %int
Zhaoming Jiang6ab5d3c2022-11-02 02:25:38 +000027 %v_block = OpTypeStruct %S
28%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
29 %v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
James Price16eeff32022-03-31 22:30:10 +000030 %void = OpTypeVoid
Zhaoming Jiang6ab5d3c2022-11-02 02:25:38 +000031 %6 = OpTypeFunction %void
Ben Clayton46ee6392022-11-09 22:04:11 +000032 %10 = OpTypeFunction %int %int %int
Ben Clayton03de0e82023-03-02 20:48:48 +000033 %16 = OpConstantNull %int
Ben Clayton46ee6392022-11-09 22:04:11 +000034 %bool = OpTypeBool
35%int_n2147483648 = OpConstant %int -2147483648
36 %int_n1 = OpConstant %int -1
37 %int_1 = OpConstant %int 1
James Price16eeff32022-03-31 22:30:10 +000038 %uint = OpTypeInt 32 0
Antonio Maioranoec207582023-02-10 15:01:02 +000039%uint_2147483648 = OpConstant %uint 2147483648
Ben Clayton03de0e82023-03-02 20:48:48 +000040 %32 = OpConstantNull %uint
James Price16eeff32022-03-31 22:30:10 +000041 %uint_0 = OpConstant %uint 0
42%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
43 %int_2 = OpConstant %int 2
Zhaoming Jiang6ab5d3c2022-11-02 02:25:38 +000044%unused_entry_point = OpFunction %void None %6
45 %9 = OpLabel
James Price16eeff32022-03-31 22:30:10 +000046 OpReturn
47 OpFunctionEnd
Ben Clayton46ee6392022-11-09 22:04:11 +000048 %tint_mod = OpFunction %int None %10
49 %lhs = OpFunctionParameter %int
50 %rhs = OpFunctionParameter %int
51 %14 = OpLabel
Ben Clayton03de0e82023-03-02 20:48:48 +000052 %17 = OpIEqual %bool %rhs %16
53 %20 = OpIEqual %bool %lhs %int_n2147483648
54 %22 = OpIEqual %bool %rhs %int_n1
55 %23 = OpLogicalAnd %bool %20 %22
56 %24 = OpLogicalOr %bool %17 %23
57 %15 = OpSelect %int %24 %int_1 %rhs
58 %29 = OpBitwiseOr %int %lhs %15
59 %27 = OpBitcast %uint %29
60 %31 = OpBitwiseAnd %uint %27 %uint_2147483648
61 %33 = OpINotEqual %bool %31 %32
62 OpSelectionMerge %34 None
63 OpBranchConditional %33 %35 %36
64 %35 = OpLabel
65 %37 = OpSDiv %int %lhs %15
66 %38 = OpIMul %int %37 %15
67 %39 = OpISub %int %lhs %38
68 OpReturnValue %39
69 %36 = OpLabel
70 %40 = OpSRem %int %lhs %15
71 OpReturnValue %40
72 %34 = OpLabel
73 OpReturnValue %16
Ben Clayton46ee6392022-11-09 22:04:11 +000074 OpFunctionEnd
Zhaoming Jiang6ab5d3c2022-11-02 02:25:38 +000075 %foo = OpFunction %void None %6
Ben Clayton03de0e82023-03-02 20:48:48 +000076 %42 = OpLabel
77 %45 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
78 %47 = OpAccessChain %_ptr_StorageBuffer_int %v %uint_0 %uint_0
79 %48 = OpLoad %int %47
80 %46 = OpFunctionCall %int %tint_mod %48 %int_2
81 OpStore %45 %46
James Price16eeff32022-03-31 22:30:10 +000082 OpReturn
83 OpFunctionEnd