James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 1 | ; SPIR-V |
| 2 | ; Version: 1.3 |
| 3 | ; Generator: Google Tint Compiler; 0 |
Ben Clayton | 03de0e8 | 2023-03-02 20:48:48 +0000 | [diff] [blame] | 4 | ; Bound: 50 |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 5 | ; 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 Jiang | 6ab5d3c | 2022-11-02 02:25:38 +0000 | [diff] [blame] | 10 | OpName %v_block "v_block" |
| 11 | OpMemberName %v_block 0 "inner" |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 12 | OpName %S "S" |
| 13 | OpMemberName %S 0 "a" |
| 14 | OpName %v "v" |
| 15 | OpName %unused_entry_point "unused_entry_point" |
Ben Clayton | 46ee639 | 2022-11-09 22:04:11 +0000 | [diff] [blame] | 16 | OpName %tint_mod "tint_mod" |
| 17 | OpName %lhs "lhs" |
| 18 | OpName %rhs "rhs" |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 19 | OpName %foo "foo" |
Zhaoming Jiang | 6ab5d3c | 2022-11-02 02:25:38 +0000 | [diff] [blame] | 20 | OpDecorate %v_block Block |
| 21 | OpMemberDecorate %v_block 0 Offset 0 |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 22 | 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 Jiang | 6ab5d3c | 2022-11-02 02:25:38 +0000 | [diff] [blame] | 27 | %v_block = OpTypeStruct %S |
| 28 | %_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block |
| 29 | %v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 30 | %void = OpTypeVoid |
Zhaoming Jiang | 6ab5d3c | 2022-11-02 02:25:38 +0000 | [diff] [blame] | 31 | %6 = OpTypeFunction %void |
Ben Clayton | 46ee639 | 2022-11-09 22:04:11 +0000 | [diff] [blame] | 32 | %10 = OpTypeFunction %int %int %int |
Ben Clayton | 03de0e8 | 2023-03-02 20:48:48 +0000 | [diff] [blame] | 33 | %16 = OpConstantNull %int |
Ben Clayton | 46ee639 | 2022-11-09 22:04:11 +0000 | [diff] [blame] | 34 | %bool = OpTypeBool |
| 35 | %int_n2147483648 = OpConstant %int -2147483648 |
| 36 | %int_n1 = OpConstant %int -1 |
| 37 | %int_1 = OpConstant %int 1 |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 38 | %uint = OpTypeInt 32 0 |
Antonio Maiorano | ec20758 | 2023-02-10 15:01:02 +0000 | [diff] [blame] | 39 | %uint_2147483648 = OpConstant %uint 2147483648 |
Ben Clayton | 03de0e8 | 2023-03-02 20:48:48 +0000 | [diff] [blame] | 40 | %32 = OpConstantNull %uint |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 41 | %uint_0 = OpConstant %uint 0 |
| 42 | %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| 43 | %int_2 = OpConstant %int 2 |
Zhaoming Jiang | 6ab5d3c | 2022-11-02 02:25:38 +0000 | [diff] [blame] | 44 | %unused_entry_point = OpFunction %void None %6 |
| 45 | %9 = OpLabel |
James Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 46 | OpReturn |
| 47 | OpFunctionEnd |
Ben Clayton | 46ee639 | 2022-11-09 22:04:11 +0000 | [diff] [blame] | 48 | %tint_mod = OpFunction %int None %10 |
| 49 | %lhs = OpFunctionParameter %int |
| 50 | %rhs = OpFunctionParameter %int |
| 51 | %14 = OpLabel |
Ben Clayton | 03de0e8 | 2023-03-02 20:48:48 +0000 | [diff] [blame] | 52 | %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 Clayton | 46ee639 | 2022-11-09 22:04:11 +0000 | [diff] [blame] | 74 | OpFunctionEnd |
Zhaoming Jiang | 6ab5d3c | 2022-11-02 02:25:38 +0000 | [diff] [blame] | 75 | %foo = OpFunction %void None %6 |
Ben Clayton | 03de0e8 | 2023-03-02 20:48:48 +0000 | [diff] [blame] | 76 | %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 Price | 16eeff3 | 2022-03-31 22:30:10 +0000 | [diff] [blame] | 82 | OpReturn |
| 83 | OpFunctionEnd |