Debian Codegraph @

third_party/spirv-cross/shaders-no-opt/asm/comp/bitfield-signed-operations.asm.comp

raw
1 ; SPIR-V
2 ; Version: 1.0
3 ; Generator: Khronos Glslang Reference Front End; 7
4 ; Bound: 26
5 ; Schema: 0
6 OpCapability Shader
7 OpMemoryModel Logical GLSL450
8 OpEntryPoint GLCompute %main "main"
9 OpExecutionMode %main LocalSize 1 1 1
10 OpSource GLSL 450
11 OpName %main "main"
12 OpName %SSBO "SSBO"
13 OpMemberName %SSBO 0 "ints"
14 OpMemberName %SSBO 1 "uints"
15 OpName %_ ""
16 OpMemberDecorate %SSBO 0 Offset 0
17 OpMemberDecorate %SSBO 1 Offset 16
18 OpDecorate %SSBO BufferBlock
19 OpDecorate %_ DescriptorSet 0
20 OpDecorate %_ Binding 0
21 %void = OpTypeVoid
22 %3 = OpTypeFunction %void
23 %int = OpTypeInt 32 1
24 %v4int = OpTypeVector %int 4
25 %uint = OpTypeInt 32 0
26 %v4uint = OpTypeVector %uint 4
27
28 %int_1 = OpConstant %int 1
29 %uint_11 = OpConstant %uint 11
30
31 %SSBO = OpTypeStruct %v4int %v4uint
32 %_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO
33 %_ = OpVariable %_ptr_Uniform_SSBO Uniform
34 %int_0 = OpConstant %int 0
35 %_ptr_Uniform_v4int = OpTypePointer Uniform %v4int
36 %_ptr_Uniform_v4uint = OpTypePointer Uniform %v4uint
37 %main = OpFunction %void None %3
38 %5 = OpLabel
39 %ints_ptr = OpAccessChain %_ptr_Uniform_v4int %_ %int_0
40 %uints_ptr = OpAccessChain %_ptr_Uniform_v4uint %_ %int_1
41 %ints = OpLoad %v4int %ints_ptr
42 %uints = OpLoad %v4uint %uints_ptr
43
44 %ints_alt = OpVectorShuffle %v4int %ints %ints 3 2 1 0
45 %uints_alt = OpVectorShuffle %v4uint %uints %uints 3 2 1 0
46
47 %int_to_int_popcount = OpBitCount %v4int %ints
48 %int_to_uint_popcount = OpBitCount %v4uint %ints
49 %uint_to_int_popcount = OpBitCount %v4int %uints
50 %uint_to_uint_popcount = OpBitCount %v4uint %uints
51
52 ; BitReverse must have matching types w.r.t. sign, yay.
53 %int_to_int_reverse = OpBitReverse %v4int %ints
54 ;%int_to_uint_reverse = OpBitReverse %v4uint %ints
55 ;%uint_to_int_reverse = OpBitReverse %v4int %uints
56 %uint_to_uint_reverse = OpBitReverse %v4uint %uints
57
58 ; Base and Result must match.
59 %int_to_int_sbit = OpBitFieldSExtract %v4int %ints %int_1 %uint_11
60 ;%int_to_uint_sbit = OpBitFieldSExtract %v4uint %ints %offset %count
61 ;%uint_to_int_sbit = OpBitFieldSExtract %v4int %uints %offset %count
62 %uint_to_uint_sbit = OpBitFieldSExtract %v4uint %uints %uint_11 %int_1
63
64 ; Base and Result must match.
65 %int_to_int_ubit = OpBitFieldUExtract %v4int %ints %int_1 %uint_11
66 ;%int_to_uint_ubit = OpBitFieldUExtract %v4uint %ints %offset %count
67 ;%uint_to_int_ubit = OpBitFieldUExtract %v4int %uints %offset %count
68 %uint_to_uint_ubit = OpBitFieldUExtract %v4uint %uints %uint_11 %int_1
69
70 %int_to_int_insert = OpBitFieldInsert %v4int %ints %ints_alt %int_1 %uint_11
71 %uint_to_uint_insert = OpBitFieldInsert %v4uint %uints %uints_alt %uint_11 %int_1
72
73 OpStore %ints_ptr %int_to_int_popcount
74 OpStore %uints_ptr %int_to_uint_popcount
75 OpStore %ints_ptr %uint_to_int_popcount
76 OpStore %uints_ptr %uint_to_uint_popcount
77
78 OpStore %ints_ptr %int_to_int_reverse
79 ;OpStore %uints_ptr %int_to_uint_reverse
80 ;OpStore %ints_ptr %uint_to_int_reverse
81 OpStore %uints_ptr %uint_to_uint_reverse
82
83 OpStore %ints_ptr %int_to_int_sbit
84 ;OpStore %uints_ptr %int_to_uint_sbit
85 ;OpStore %ints_ptr %uint_to_int_sbit
86 OpStore %uints_ptr %uint_to_uint_sbit
87
88 OpStore %ints_ptr %int_to_int_ubit
89 ;OpStore %uints_ptr %int_to_uint_ubit
90 ;OpStore %ints_ptr %uint_to_int_ubit
91 OpStore %uints_ptr %uint_to_uint_ubit
92
93 OpStore %ints_ptr %int_to_int_insert
94 OpStore %uints_ptr %uint_to_uint_insert
95
96 OpReturn
97 OpFunctionEnd