1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
/*
* Copyright (C) 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/* Update ir_expression::get_num_operands() and operator_strs when
* updating this list.
*/
enum ir_expression_operation {
ir_unop_bit_not,
ir_unop_logic_not,
ir_unop_neg,
ir_unop_abs,
ir_unop_sign,
ir_unop_rcp,
ir_unop_rsq,
ir_unop_sqrt,
ir_unop_exp, /**< Log base e on gentype */
ir_unop_log, /**< Natural log on gentype */
ir_unop_exp2,
ir_unop_log2,
ir_unop_f2i, /**< Float-to-integer conversion. */
ir_unop_f2u, /**< Float-to-unsigned conversion. */
ir_unop_i2f, /**< Integer-to-float conversion. */
ir_unop_f2b, /**< Float-to-boolean conversion */
ir_unop_b2f, /**< Boolean-to-float conversion */
ir_unop_i2b, /**< int-to-boolean conversion */
ir_unop_b2i, /**< Boolean-to-int conversion */
ir_unop_u2f, /**< Unsigned-to-float conversion. */
ir_unop_i2u, /**< Integer-to-unsigned conversion. */
ir_unop_u2i, /**< Unsigned-to-integer conversion. */
ir_unop_d2f, /**< Double-to-float conversion. */
ir_unop_f2d, /**< Float-to-double conversion. */
ir_unop_d2i, /**< Double-to-integer conversion. */
ir_unop_i2d, /**< Integer-to-double conversion. */
ir_unop_d2u, /**< Double-to-unsigned conversion. */
ir_unop_u2d, /**< Unsigned-to-double conversion. */
ir_unop_d2b, /**< Double-to-boolean conversion. */
ir_unop_bitcast_i2f, /**< Bit-identical int-to-float "conversion" */
ir_unop_bitcast_f2i, /**< Bit-identical float-to-int "conversion" */
ir_unop_bitcast_u2f, /**< Bit-identical uint-to-float "conversion" */
ir_unop_bitcast_f2u, /**< Bit-identical float-to-uint "conversion" */
/**
* \name Unary floating-point rounding operations.
*/
/*@{*/
ir_unop_trunc,
ir_unop_ceil,
ir_unop_floor,
ir_unop_fract,
ir_unop_round_even,
/*@}*/
/**
* \name Trigonometric operations.
*/
/*@{*/
ir_unop_sin,
ir_unop_cos,
/*@}*/
/**
* \name Partial derivatives.
*/
/*@{*/
ir_unop_dFdx,
ir_unop_dFdx_coarse,
ir_unop_dFdx_fine,
ir_unop_dFdy,
ir_unop_dFdy_coarse,
ir_unop_dFdy_fine,
/*@}*/
/**
* \name Floating point pack and unpack operations.
*/
/*@{*/
ir_unop_pack_snorm_2x16,
ir_unop_pack_snorm_4x8,
ir_unop_pack_unorm_2x16,
ir_unop_pack_unorm_4x8,
ir_unop_pack_half_2x16,
ir_unop_unpack_snorm_2x16,
ir_unop_unpack_snorm_4x8,
ir_unop_unpack_unorm_2x16,
ir_unop_unpack_unorm_4x8,
ir_unop_unpack_half_2x16,
/*@}*/
/**
* \name Bit operations, part of ARB_gpu_shader5.
*/
/*@{*/
ir_unop_bitfield_reverse,
ir_unop_bit_count,
ir_unop_find_msb,
ir_unop_find_lsb,
/*@}*/
ir_unop_saturate,
/**
* \name Double packing, part of ARB_gpu_shader_fp64.
*/
/*@{*/
ir_unop_pack_double_2x32,
ir_unop_unpack_double_2x32,
/*@}*/
ir_unop_frexp_sig,
ir_unop_frexp_exp,
ir_unop_noise,
ir_unop_subroutine_to_int,
/**
* Interpolate fs input at centroid
*
* operand0 is the fs input.
*/
ir_unop_interpolate_at_centroid,
/**
* Ask the driver for the total size of a buffer block.
*
* operand0 is the ir_constant buffer block index in the linked shader.
*/
ir_unop_get_buffer_size,
/**
* Calculate length of an unsized array inside a buffer block.
* This opcode is going to be replaced in a lowering pass inside
* the linker.
*
* operand0 is the unsized array's ir_value for the calculation
* of its length.
*/
ir_unop_ssbo_unsized_array_length,
/**
* Vote among threads on the value of the boolean argument.
*/
ir_unop_vote_any,
ir_unop_vote_all,
ir_unop_vote_eq,
/**
* A sentinel marking the last of the unary operations.
*/
ir_last_unop = ir_unop_vote_eq,
ir_binop_add,
ir_binop_sub,
ir_binop_mul, /**< Floating-point or low 32-bit integer multiply. */
ir_binop_imul_high, /**< Calculates the high 32-bits of a 64-bit multiply. */
ir_binop_div,
/**
* Returns the carry resulting from the addition of the two arguments.
*/
/*@{*/
ir_binop_carry,
/*@}*/
/**
* Returns the borrow resulting from the subtraction of the second argument
* from the first argument.
*/
/*@{*/
ir_binop_borrow,
/*@}*/
/**
* Takes one of two combinations of arguments:
*
* - mod(vecN, vecN)
* - mod(vecN, float)
*
* Does not take integer types.
*/
ir_binop_mod,
/**
* \name Binary comparison operators which return a boolean vector.
* The type of both operands must be equal.
*/
/*@{*/
ir_binop_less,
ir_binop_greater,
ir_binop_lequal,
ir_binop_gequal,
ir_binop_equal,
ir_binop_nequal,
/**
* Returns single boolean for whether all components of operands[0]
* equal the components of operands[1].
*/
ir_binop_all_equal,
/**
* Returns single boolean for whether any component of operands[0]
* is not equal to the corresponding component of operands[1].
*/
ir_binop_any_nequal,
/*@}*/
/**
* \name Bit-wise binary operations.
*/
/*@{*/
ir_binop_lshift,
ir_binop_rshift,
ir_binop_bit_and,
ir_binop_bit_xor,
ir_binop_bit_or,
/*@}*/
ir_binop_logic_and,
ir_binop_logic_xor,
ir_binop_logic_or,
ir_binop_dot,
ir_binop_min,
ir_binop_max,
ir_binop_pow,
/**
* Load a value the size of a given GLSL type from a uniform block.
*
* operand0 is the ir_constant uniform block index in the linked shader.
* operand1 is a byte offset within the uniform block.
*/
ir_binop_ubo_load,
/**
* \name Multiplies a number by two to a power, part of ARB_gpu_shader5.
*/
/*@{*/
ir_binop_ldexp,
/*@}*/
/**
* Extract a scalar from a vector
*
* operand0 is the vector
* operand1 is the index of the field to read from operand0
*/
ir_binop_vector_extract,
/**
* Interpolate fs input at offset
*
* operand0 is the fs input
* operand1 is the offset from the pixel center
*/
ir_binop_interpolate_at_offset,
/**
* Interpolate fs input at sample position
*
* operand0 is the fs input
* operand1 is the sample ID
*/
ir_binop_interpolate_at_sample,
/**
* A sentinel marking the last of the binary operations.
*/
ir_last_binop = ir_binop_interpolate_at_sample,
/**
* \name Fused floating-point multiply-add, part of ARB_gpu_shader5.
*/
/*@{*/
ir_triop_fma,
/*@}*/
ir_triop_lrp,
/**
* \name Conditional Select
*
* A vector conditional select instruction (like ?:, but operating per-
* component on vectors).
*
* \see lower_instructions_visitor::ldexp_to_arith
*/
/*@{*/
ir_triop_csel,
/*@}*/
ir_triop_bitfield_extract,
/**
* Generate a value with one field of a vector changed
*
* operand0 is the vector
* operand1 is the value to write into the vector result
* operand2 is the index in operand0 to be modified
*/
ir_triop_vector_insert,
/**
* A sentinel marking the last of the ternary operations.
*/
ir_last_triop = ir_triop_vector_insert,
ir_quadop_bitfield_insert,
ir_quadop_vector,
/**
* A sentinel marking the last of the ternary operations.
*/
ir_last_quadop = ir_quadop_vector,
/**
* A sentinel marking the last of all operations.
*/
ir_last_opcode = ir_quadop_vector
};
|