nir_intrinsics.h revision b8e80941
1/* Copyright (C) 2018 Red Hat
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
12 * Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 * IN THE SOFTWARE.
21 */
22
23#ifndef _NIR_INTRINSICS_
24#define _NIR_INTRINSICS_
25
26
27
28typedef enum {
29   nir_intrinsic_atomic_counter_add,
30   nir_intrinsic_atomic_counter_add_deref,
31   nir_intrinsic_atomic_counter_and,
32   nir_intrinsic_atomic_counter_and_deref,
33   nir_intrinsic_atomic_counter_comp_swap,
34   nir_intrinsic_atomic_counter_comp_swap_deref,
35   nir_intrinsic_atomic_counter_exchange,
36   nir_intrinsic_atomic_counter_exchange_deref,
37   nir_intrinsic_atomic_counter_inc,
38   nir_intrinsic_atomic_counter_inc_deref,
39   nir_intrinsic_atomic_counter_max,
40   nir_intrinsic_atomic_counter_max_deref,
41   nir_intrinsic_atomic_counter_min,
42   nir_intrinsic_atomic_counter_min_deref,
43   nir_intrinsic_atomic_counter_or,
44   nir_intrinsic_atomic_counter_or_deref,
45   nir_intrinsic_atomic_counter_post_dec,
46   nir_intrinsic_atomic_counter_post_dec_deref,
47   nir_intrinsic_atomic_counter_pre_dec,
48   nir_intrinsic_atomic_counter_pre_dec_deref,
49   nir_intrinsic_atomic_counter_read,
50   nir_intrinsic_atomic_counter_read_deref,
51   nir_intrinsic_atomic_counter_xor,
52   nir_intrinsic_atomic_counter_xor_deref,
53   nir_intrinsic_ballot,
54   nir_intrinsic_ballot_bit_count_exclusive,
55   nir_intrinsic_ballot_bit_count_inclusive,
56   nir_intrinsic_ballot_bit_count_reduce,
57   nir_intrinsic_ballot_bitfield_extract,
58   nir_intrinsic_ballot_find_lsb,
59   nir_intrinsic_ballot_find_msb,
60   nir_intrinsic_barrier,
61   nir_intrinsic_begin_invocation_interlock,
62   nir_intrinsic_bindless_image_atomic_add,
63   nir_intrinsic_bindless_image_atomic_and,
64   nir_intrinsic_bindless_image_atomic_comp_swap,
65   nir_intrinsic_bindless_image_atomic_exchange,
66   nir_intrinsic_bindless_image_atomic_fadd,
67   nir_intrinsic_bindless_image_atomic_max,
68   nir_intrinsic_bindless_image_atomic_min,
69   nir_intrinsic_bindless_image_atomic_or,
70   nir_intrinsic_bindless_image_atomic_xor,
71   nir_intrinsic_bindless_image_load,
72   nir_intrinsic_bindless_image_load_raw_intel,
73   nir_intrinsic_bindless_image_samples,
74   nir_intrinsic_bindless_image_size,
75   nir_intrinsic_bindless_image_store,
76   nir_intrinsic_bindless_image_store_raw_intel,
77   nir_intrinsic_copy_deref,
78   nir_intrinsic_deref_atomic_add,
79   nir_intrinsic_deref_atomic_and,
80   nir_intrinsic_deref_atomic_comp_swap,
81   nir_intrinsic_deref_atomic_exchange,
82   nir_intrinsic_deref_atomic_fadd,
83   nir_intrinsic_deref_atomic_fcomp_swap,
84   nir_intrinsic_deref_atomic_fmax,
85   nir_intrinsic_deref_atomic_fmin,
86   nir_intrinsic_deref_atomic_imax,
87   nir_intrinsic_deref_atomic_imin,
88   nir_intrinsic_deref_atomic_or,
89   nir_intrinsic_deref_atomic_umax,
90   nir_intrinsic_deref_atomic_umin,
91   nir_intrinsic_deref_atomic_xor,
92   nir_intrinsic_deref_buffer_array_length,
93   nir_intrinsic_discard,
94   nir_intrinsic_discard_if,
95   nir_intrinsic_elect,
96   nir_intrinsic_emit_vertex,
97   nir_intrinsic_emit_vertex_with_counter,
98   nir_intrinsic_end_invocation_interlock,
99   nir_intrinsic_end_primitive,
100   nir_intrinsic_end_primitive_with_counter,
101   nir_intrinsic_exclusive_scan,
102   nir_intrinsic_first_invocation,
103   nir_intrinsic_get_buffer_size,
104   nir_intrinsic_global_atomic_add,
105   nir_intrinsic_global_atomic_and,
106   nir_intrinsic_global_atomic_comp_swap,
107   nir_intrinsic_global_atomic_exchange,
108   nir_intrinsic_global_atomic_fadd,
109   nir_intrinsic_global_atomic_fcomp_swap,
110   nir_intrinsic_global_atomic_fmax,
111   nir_intrinsic_global_atomic_fmin,
112   nir_intrinsic_global_atomic_imax,
113   nir_intrinsic_global_atomic_imin,
114   nir_intrinsic_global_atomic_or,
115   nir_intrinsic_global_atomic_umax,
116   nir_intrinsic_global_atomic_umin,
117   nir_intrinsic_global_atomic_xor,
118   nir_intrinsic_group_memory_barrier,
119   nir_intrinsic_image_atomic_add,
120   nir_intrinsic_image_atomic_and,
121   nir_intrinsic_image_atomic_comp_swap,
122   nir_intrinsic_image_atomic_exchange,
123   nir_intrinsic_image_atomic_fadd,
124   nir_intrinsic_image_atomic_max,
125   nir_intrinsic_image_atomic_min,
126   nir_intrinsic_image_atomic_or,
127   nir_intrinsic_image_atomic_xor,
128   nir_intrinsic_image_deref_atomic_add,
129   nir_intrinsic_image_deref_atomic_and,
130   nir_intrinsic_image_deref_atomic_comp_swap,
131   nir_intrinsic_image_deref_atomic_exchange,
132   nir_intrinsic_image_deref_atomic_fadd,
133   nir_intrinsic_image_deref_atomic_max,
134   nir_intrinsic_image_deref_atomic_min,
135   nir_intrinsic_image_deref_atomic_or,
136   nir_intrinsic_image_deref_atomic_xor,
137   nir_intrinsic_image_deref_load,
138   nir_intrinsic_image_deref_load_param_intel,
139   nir_intrinsic_image_deref_load_raw_intel,
140   nir_intrinsic_image_deref_samples,
141   nir_intrinsic_image_deref_size,
142   nir_intrinsic_image_deref_store,
143   nir_intrinsic_image_deref_store_raw_intel,
144   nir_intrinsic_image_load,
145   nir_intrinsic_image_load_raw_intel,
146   nir_intrinsic_image_samples,
147   nir_intrinsic_image_size,
148   nir_intrinsic_image_store,
149   nir_intrinsic_image_store_raw_intel,
150   nir_intrinsic_inclusive_scan,
151   nir_intrinsic_interp_deref_at_centroid,
152   nir_intrinsic_interp_deref_at_offset,
153   nir_intrinsic_interp_deref_at_sample,
154   nir_intrinsic_load_alpha_ref_float,
155   nir_intrinsic_load_barycentric_at_offset,
156   nir_intrinsic_load_barycentric_at_sample,
157   nir_intrinsic_load_barycentric_centroid,
158   nir_intrinsic_load_barycentric_pixel,
159   nir_intrinsic_load_barycentric_sample,
160   nir_intrinsic_load_base_instance,
161   nir_intrinsic_load_base_vertex,
162   nir_intrinsic_load_blend_const_color_a_float,
163   nir_intrinsic_load_blend_const_color_aaaa8888_unorm,
164   nir_intrinsic_load_blend_const_color_b_float,
165   nir_intrinsic_load_blend_const_color_g_float,
166   nir_intrinsic_load_blend_const_color_r_float,
167   nir_intrinsic_load_blend_const_color_rgba8888_unorm,
168   nir_intrinsic_load_constant,
169   nir_intrinsic_load_deref,
170   nir_intrinsic_load_draw_id,
171   nir_intrinsic_load_first_vertex,
172   nir_intrinsic_load_frag_coord,
173   nir_intrinsic_load_front_face,
174   nir_intrinsic_load_global,
175   nir_intrinsic_load_global_invocation_id,
176   nir_intrinsic_load_global_invocation_index,
177   nir_intrinsic_load_helper_invocation,
178   nir_intrinsic_load_input,
179   nir_intrinsic_load_instance_id,
180   nir_intrinsic_load_interpolated_input,
181   nir_intrinsic_load_invocation_id,
182   nir_intrinsic_load_is_indexed_draw,
183   nir_intrinsic_load_kernel_input,
184   nir_intrinsic_load_layer_id,
185   nir_intrinsic_load_local_group_size,
186   nir_intrinsic_load_local_invocation_id,
187   nir_intrinsic_load_local_invocation_index,
188   nir_intrinsic_load_num_subgroups,
189   nir_intrinsic_load_num_work_groups,
190   nir_intrinsic_load_output,
191   nir_intrinsic_load_param,
192   nir_intrinsic_load_patch_vertices_in,
193   nir_intrinsic_load_per_vertex_input,
194   nir_intrinsic_load_per_vertex_output,
195   nir_intrinsic_load_primitive_id,
196   nir_intrinsic_load_push_constant,
197   nir_intrinsic_load_sample_id,
198   nir_intrinsic_load_sample_id_no_per_sample,
199   nir_intrinsic_load_sample_mask_in,
200   nir_intrinsic_load_sample_pos,
201   nir_intrinsic_load_sample_pos_from_id,
202   nir_intrinsic_load_scratch,
203   nir_intrinsic_load_shared,
204   nir_intrinsic_load_size_ir3,
205   nir_intrinsic_load_ssbo,
206   nir_intrinsic_load_ssbo_ir3,
207   nir_intrinsic_load_subgroup_eq_mask,
208   nir_intrinsic_load_subgroup_ge_mask,
209   nir_intrinsic_load_subgroup_gt_mask,
210   nir_intrinsic_load_subgroup_id,
211   nir_intrinsic_load_subgroup_invocation,
212   nir_intrinsic_load_subgroup_le_mask,
213   nir_intrinsic_load_subgroup_lt_mask,
214   nir_intrinsic_load_subgroup_size,
215   nir_intrinsic_load_tess_coord,
216   nir_intrinsic_load_tess_level_inner,
217   nir_intrinsic_load_tess_level_outer,
218   nir_intrinsic_load_ubo,
219   nir_intrinsic_load_uniform,
220   nir_intrinsic_load_user_clip_plane,
221   nir_intrinsic_load_vertex_id,
222   nir_intrinsic_load_vertex_id_zero_base,
223   nir_intrinsic_load_view_index,
224   nir_intrinsic_load_viewport_offset,
225   nir_intrinsic_load_viewport_scale,
226   nir_intrinsic_load_viewport_x_scale,
227   nir_intrinsic_load_viewport_y_scale,
228   nir_intrinsic_load_viewport_z_offset,
229   nir_intrinsic_load_viewport_z_scale,
230   nir_intrinsic_load_vulkan_descriptor,
231   nir_intrinsic_load_work_dim,
232   nir_intrinsic_load_work_group_id,
233   nir_intrinsic_memory_barrier,
234   nir_intrinsic_memory_barrier_atomic_counter,
235   nir_intrinsic_memory_barrier_buffer,
236   nir_intrinsic_memory_barrier_image,
237   nir_intrinsic_memory_barrier_shared,
238   nir_intrinsic_nop,
239   nir_intrinsic_quad_broadcast,
240   nir_intrinsic_quad_swap_diagonal,
241   nir_intrinsic_quad_swap_horizontal,
242   nir_intrinsic_quad_swap_vertical,
243   nir_intrinsic_read_first_invocation,
244   nir_intrinsic_read_invocation,
245   nir_intrinsic_reduce,
246   nir_intrinsic_set_vertex_count,
247   nir_intrinsic_shader_clock,
248   nir_intrinsic_shared_atomic_add,
249   nir_intrinsic_shared_atomic_and,
250   nir_intrinsic_shared_atomic_comp_swap,
251   nir_intrinsic_shared_atomic_exchange,
252   nir_intrinsic_shared_atomic_fadd,
253   nir_intrinsic_shared_atomic_fcomp_swap,
254   nir_intrinsic_shared_atomic_fmax,
255   nir_intrinsic_shared_atomic_fmin,
256   nir_intrinsic_shared_atomic_imax,
257   nir_intrinsic_shared_atomic_imin,
258   nir_intrinsic_shared_atomic_or,
259   nir_intrinsic_shared_atomic_umax,
260   nir_intrinsic_shared_atomic_umin,
261   nir_intrinsic_shared_atomic_xor,
262   nir_intrinsic_shuffle,
263   nir_intrinsic_shuffle_down,
264   nir_intrinsic_shuffle_up,
265   nir_intrinsic_shuffle_xor,
266   nir_intrinsic_ssbo_atomic_add,
267   nir_intrinsic_ssbo_atomic_add_ir3,
268   nir_intrinsic_ssbo_atomic_and,
269   nir_intrinsic_ssbo_atomic_and_ir3,
270   nir_intrinsic_ssbo_atomic_comp_swap,
271   nir_intrinsic_ssbo_atomic_comp_swap_ir3,
272   nir_intrinsic_ssbo_atomic_exchange,
273   nir_intrinsic_ssbo_atomic_exchange_ir3,
274   nir_intrinsic_ssbo_atomic_fadd,
275   nir_intrinsic_ssbo_atomic_fcomp_swap,
276   nir_intrinsic_ssbo_atomic_fmax,
277   nir_intrinsic_ssbo_atomic_fmin,
278   nir_intrinsic_ssbo_atomic_imax,
279   nir_intrinsic_ssbo_atomic_imax_ir3,
280   nir_intrinsic_ssbo_atomic_imin,
281   nir_intrinsic_ssbo_atomic_imin_ir3,
282   nir_intrinsic_ssbo_atomic_or,
283   nir_intrinsic_ssbo_atomic_or_ir3,
284   nir_intrinsic_ssbo_atomic_umax,
285   nir_intrinsic_ssbo_atomic_umax_ir3,
286   nir_intrinsic_ssbo_atomic_umin,
287   nir_intrinsic_ssbo_atomic_umin_ir3,
288   nir_intrinsic_ssbo_atomic_xor,
289   nir_intrinsic_ssbo_atomic_xor_ir3,
290   nir_intrinsic_store_deref,
291   nir_intrinsic_store_global,
292   nir_intrinsic_store_output,
293   nir_intrinsic_store_per_vertex_output,
294   nir_intrinsic_store_scratch,
295   nir_intrinsic_store_shared,
296   nir_intrinsic_store_ssbo,
297   nir_intrinsic_store_ssbo_ir3,
298   nir_intrinsic_vote_all,
299   nir_intrinsic_vote_any,
300   nir_intrinsic_vote_feq,
301   nir_intrinsic_vote_ieq,
302   nir_intrinsic_vulkan_resource_index,
303   nir_intrinsic_vulkan_resource_reindex,
304
305   nir_last_intrinsic = nir_intrinsic_vulkan_resource_reindex,
306   nir_num_intrinsics = nir_last_intrinsic + 1
307} nir_intrinsic_op;
308
309#endif /* _NIR_INTRINSICS_ */