110e230b6Smaya/*
210e230b6Smaya * Copyright (C) 2010 Intel Corporation
310e230b6Smaya *
410e230b6Smaya * Permission is hereby granted, free of charge, to any person obtaining a
510e230b6Smaya * copy of this software and associated documentation files (the "Software"),
610e230b6Smaya * to deal in the Software without restriction, including without limitation
710e230b6Smaya * the rights to use, copy, modify, merge, publish, distribute, sublicense,
810e230b6Smaya * and/or sell copies of the Software, and to permit persons to whom the
910e230b6Smaya * Software is furnished to do so, subject to the following conditions:
1010e230b6Smaya *
1110e230b6Smaya * The above copyright notice and this permission notice (including the next
1210e230b6Smaya * paragraph) shall be included in all copies or substantial portions of the
1310e230b6Smaya * Software.
1410e230b6Smaya *
1510e230b6Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1610e230b6Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1710e230b6Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1810e230b6Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1910e230b6Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2010e230b6Smaya * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2110e230b6Smaya * DEALINGS IN THE SOFTWARE.
2210e230b6Smaya */
2310e230b6Smaya
2410e230b6Smayaenum ir_expression_operation {
2510e230b6Smaya   ir_unop_bit_not,
2610e230b6Smaya   ir_unop_logic_not,
2710e230b6Smaya   ir_unop_neg,
2810e230b6Smaya   ir_unop_abs,
2910e230b6Smaya   ir_unop_sign,
3010e230b6Smaya   ir_unop_rcp,
3110e230b6Smaya   ir_unop_rsq,
3210e230b6Smaya   ir_unop_sqrt,
3310e230b6Smaya   ir_unop_exp,
3410e230b6Smaya   ir_unop_log,
3510e230b6Smaya   ir_unop_exp2,
3610e230b6Smaya   ir_unop_log2,
3710e230b6Smaya   ir_unop_f2i,
3810e230b6Smaya   ir_unop_f2u,
3910e230b6Smaya   ir_unop_i2f,
4010e230b6Smaya   ir_unop_f2b,
4110e230b6Smaya   ir_unop_b2f,
4296c5ddc4Srjs   ir_unop_b2f16,
4310e230b6Smaya   ir_unop_i2b,
4410e230b6Smaya   ir_unop_b2i,
4510e230b6Smaya   ir_unop_u2f,
4610e230b6Smaya   ir_unop_i2u,
4710e230b6Smaya   ir_unop_u2i,
4810e230b6Smaya   ir_unop_d2f,
4910e230b6Smaya   ir_unop_f2d,
5096c5ddc4Srjs   ir_unop_f2f16,
5196c5ddc4Srjs   ir_unop_f2fmp,
5296c5ddc4Srjs   ir_unop_f162f,
5396c5ddc4Srjs   ir_unop_i2i,
5496c5ddc4Srjs   ir_unop_i2imp,
5596c5ddc4Srjs   ir_unop_u2u,
5696c5ddc4Srjs   ir_unop_u2ump,
5710e230b6Smaya   ir_unop_d2i,
5810e230b6Smaya   ir_unop_i2d,
5910e230b6Smaya   ir_unop_d2u,
6010e230b6Smaya   ir_unop_u2d,
6110e230b6Smaya   ir_unop_d2b,
6296c5ddc4Srjs   ir_unop_f162b,
6310e230b6Smaya   ir_unop_bitcast_i2f,
6410e230b6Smaya   ir_unop_bitcast_f2i,
6510e230b6Smaya   ir_unop_bitcast_u2f,
6610e230b6Smaya   ir_unop_bitcast_f2u,
6710e230b6Smaya   ir_unop_bitcast_u642d,
6810e230b6Smaya   ir_unop_bitcast_i642d,
6910e230b6Smaya   ir_unop_bitcast_d2u64,
7010e230b6Smaya   ir_unop_bitcast_d2i64,
7110e230b6Smaya   ir_unop_i642i,
7210e230b6Smaya   ir_unop_u642i,
7310e230b6Smaya   ir_unop_i642u,
7410e230b6Smaya   ir_unop_u642u,
7510e230b6Smaya   ir_unop_i642b,
7610e230b6Smaya   ir_unop_i642f,
7710e230b6Smaya   ir_unop_u642f,
7810e230b6Smaya   ir_unop_i642d,
7910e230b6Smaya   ir_unop_u642d,
8010e230b6Smaya   ir_unop_i2i64,
8110e230b6Smaya   ir_unop_u2i64,
8210e230b6Smaya   ir_unop_b2i64,
8310e230b6Smaya   ir_unop_f2i64,
8410e230b6Smaya   ir_unop_d2i64,
8510e230b6Smaya   ir_unop_i2u64,
8610e230b6Smaya   ir_unop_u2u64,
8710e230b6Smaya   ir_unop_f2u64,
8810e230b6Smaya   ir_unop_d2u64,
8910e230b6Smaya   ir_unop_u642i64,
9010e230b6Smaya   ir_unop_i642u64,
9110e230b6Smaya   ir_unop_trunc,
9210e230b6Smaya   ir_unop_ceil,
9310e230b6Smaya   ir_unop_floor,
9410e230b6Smaya   ir_unop_fract,
9510e230b6Smaya   ir_unop_round_even,
9610e230b6Smaya   ir_unop_sin,
9710e230b6Smaya   ir_unop_cos,
9896c5ddc4Srjs   ir_unop_atan,
9910e230b6Smaya   ir_unop_dFdx,
10010e230b6Smaya   ir_unop_dFdx_coarse,
10110e230b6Smaya   ir_unop_dFdx_fine,
10210e230b6Smaya   ir_unop_dFdy,
10310e230b6Smaya   ir_unop_dFdy_coarse,
10410e230b6Smaya   ir_unop_dFdy_fine,
10510e230b6Smaya   ir_unop_pack_snorm_2x16,
10610e230b6Smaya   ir_unop_pack_snorm_4x8,
10710e230b6Smaya   ir_unop_pack_unorm_2x16,
10810e230b6Smaya   ir_unop_pack_unorm_4x8,
10910e230b6Smaya   ir_unop_pack_half_2x16,
11010e230b6Smaya   ir_unop_unpack_snorm_2x16,
11110e230b6Smaya   ir_unop_unpack_snorm_4x8,
11210e230b6Smaya   ir_unop_unpack_unorm_2x16,
11310e230b6Smaya   ir_unop_unpack_unorm_4x8,
11410e230b6Smaya   ir_unop_unpack_half_2x16,
11510e230b6Smaya   ir_unop_bitfield_reverse,
11610e230b6Smaya   ir_unop_bit_count,
11710e230b6Smaya   ir_unop_find_msb,
11810e230b6Smaya   ir_unop_find_lsb,
11996c5ddc4Srjs   ir_unop_clz,
12010e230b6Smaya   ir_unop_saturate,
12110e230b6Smaya   ir_unop_pack_double_2x32,
12210e230b6Smaya   ir_unop_unpack_double_2x32,
12310e230b6Smaya   ir_unop_pack_sampler_2x32,
12410e230b6Smaya   ir_unop_pack_image_2x32,
12510e230b6Smaya   ir_unop_unpack_sampler_2x32,
12610e230b6Smaya   ir_unop_unpack_image_2x32,
12710e230b6Smaya   ir_unop_frexp_sig,
12810e230b6Smaya   ir_unop_frexp_exp,
12910e230b6Smaya   ir_unop_subroutine_to_int,
13010e230b6Smaya   ir_unop_interpolate_at_centroid,
13110e230b6Smaya   ir_unop_get_buffer_size,
13210e230b6Smaya   ir_unop_ssbo_unsized_array_length,
13396c5ddc4Srjs   ir_unop_implicitly_sized_array_length,
13410e230b6Smaya   ir_unop_pack_int_2x32,
13510e230b6Smaya   ir_unop_pack_uint_2x32,
13610e230b6Smaya   ir_unop_unpack_int_2x32,
13710e230b6Smaya   ir_unop_unpack_uint_2x32,
13810e230b6Smaya   ir_binop_add,
13910e230b6Smaya   ir_binop_sub,
14096c5ddc4Srjs   ir_binop_add_sat,
14196c5ddc4Srjs   ir_binop_sub_sat,
14296c5ddc4Srjs   ir_binop_abs_sub,
14396c5ddc4Srjs   ir_binop_avg,
14496c5ddc4Srjs   ir_binop_avg_round,
14510e230b6Smaya   ir_binop_mul,
14696c5ddc4Srjs   ir_binop_mul_32x16,
14710e230b6Smaya   ir_binop_imul_high,
14810e230b6Smaya   ir_binop_div,
14910e230b6Smaya   ir_binop_carry,
15010e230b6Smaya   ir_binop_borrow,
15110e230b6Smaya   ir_binop_mod,
15210e230b6Smaya   ir_binop_less,
15310e230b6Smaya   ir_binop_gequal,
15410e230b6Smaya   ir_binop_equal,
15510e230b6Smaya   ir_binop_nequal,
15610e230b6Smaya   ir_binop_all_equal,
15710e230b6Smaya   ir_binop_any_nequal,
15810e230b6Smaya   ir_binop_lshift,
15910e230b6Smaya   ir_binop_rshift,
16010e230b6Smaya   ir_binop_bit_and,
16110e230b6Smaya   ir_binop_bit_xor,
16210e230b6Smaya   ir_binop_bit_or,
16310e230b6Smaya   ir_binop_logic_and,
16410e230b6Smaya   ir_binop_logic_xor,
16510e230b6Smaya   ir_binop_logic_or,
16610e230b6Smaya   ir_binop_dot,
16710e230b6Smaya   ir_binop_min,
16810e230b6Smaya   ir_binop_max,
16910e230b6Smaya   ir_binop_pow,
17010e230b6Smaya   ir_binop_ubo_load,
17110e230b6Smaya   ir_binop_ldexp,
17210e230b6Smaya   ir_binop_vector_extract,
17310e230b6Smaya   ir_binop_interpolate_at_offset,
17410e230b6Smaya   ir_binop_interpolate_at_sample,
17596c5ddc4Srjs   ir_binop_atan2,
17610e230b6Smaya   ir_triop_fma,
17710e230b6Smaya   ir_triop_lrp,
17810e230b6Smaya   ir_triop_csel,
17910e230b6Smaya   ir_triop_bitfield_extract,
18010e230b6Smaya   ir_triop_vector_insert,
18110e230b6Smaya   ir_quadop_bitfield_insert,
18210e230b6Smaya   ir_quadop_vector,
18310e230b6Smaya
18410e230b6Smaya   /* Sentinels marking the last of each kind of operation. */
18510e230b6Smaya   ir_last_unop = ir_unop_unpack_uint_2x32,
18696c5ddc4Srjs   ir_last_binop = ir_binop_atan2,
18710e230b6Smaya   ir_last_triop = ir_triop_vector_insert,
18810e230b6Smaya   ir_last_quadop = ir_quadop_vector,
18910e230b6Smaya   ir_last_opcode = ir_quadop_vector
19010e230b6Smaya};
191