Lines Matching refs:operands
197 ir->operands[1] = new(ir) ir_expression(ir_unop_neg, ir->operands[1]->type, in sub_to_add_neg()
198 ir->operands[1], NULL); in sub_to_add_neg()
205 assert(ir->operands[1]->type->is_float() || ir->operands[1]->type->is_double()); in div_to_mul_rcp()
210 ir->operands[1]->type, in div_to_mul_rcp()
211 ir->operands[1]); in div_to_mul_rcp()
216 ir->operands[1] = expr; in div_to_mul_rcp()
224 assert(ir->operands[1]->type->is_integer()); in int_div_to_mul_rcp()
234 ir->operands[1]->type->vector_elements, in int_div_to_mul_rcp()
235 ir->operands[1]->type->matrix_columns); in int_div_to_mul_rcp()
237 if (ir->operands[1]->type->base_type == GLSL_TYPE_INT) in int_div_to_mul_rcp()
238 op1 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[1], NULL); in int_div_to_mul_rcp()
240 op1 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[1], NULL); in int_div_to_mul_rcp()
245 ir->operands[0]->type->vector_elements, in int_div_to_mul_rcp()
246 ir->operands[0]->type->matrix_columns); in int_div_to_mul_rcp()
248 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT) in int_div_to_mul_rcp()
249 op0 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[0], NULL); in int_div_to_mul_rcp()
251 op0 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[0], NULL); in int_div_to_mul_rcp()
259 if (ir->operands[1]->type->base_type == GLSL_TYPE_INT) { in int_div_to_mul_rcp()
261 ir->operands[0] = op0; in int_div_to_mul_rcp()
264 ir->operands[0] = new(ir) ir_expression(ir_unop_f2i, op0); in int_div_to_mul_rcp()
267 ir->operands[1] = NULL; in int_div_to_mul_rcp()
279 ir->operands[0] = new(ir) ir_expression(ir_binop_mul, ir->operands[0]->type, in exp_to_exp2()
280 ir->operands[0], log2_e); in exp_to_exp2()
288 new(ir) ir_expression(ir_unop_log2, ir->operands[0]->type, in pow_to_exp2()
289 ir->operands[0]); in pow_to_exp2()
293 ir->operands[0] = new(ir) ir_expression(ir_binop_mul, ir->operands[1]->type, in pow_to_exp2()
294 ir->operands[1], log2_x); in pow_to_exp2()
295 ir->operands[1] = NULL; in pow_to_exp2()
304 ir->operands[0] = new(ir) ir_expression(ir_unop_log2, ir->operands[0]->type, in log_to_log2()
305 ir->operands[0], NULL); in log_to_log2()
306 ir->operands[1] = new(ir) ir_constant(float(1.0 / M_LOG2E)); in log_to_log2()
313 ir_variable *x = new(ir) ir_variable(ir->operands[0]->type, "mod_x", in mod_to_floor()
315 ir_variable *y = new(ir) ir_variable(ir->operands[1]->type, "mod_y", in mod_to_floor()
322 ir->operands[0]); in mod_to_floor()
325 ir->operands[1]); in mod_to_floor()
355 ir->operands[0] = new(ir) ir_dereference_variable(x); in mod_to_floor()
356 ir->operands[1] = mul_expr; in mod_to_floor()
447 i.insert_before(assign(x, ir->operands[0])); in ldexp_to_arith()
449 i.insert_before(assign(exp, ir->operands[1])); in ldexp_to_arith()
526 ir->operands[0] = gequal(extracted_biased_exp, in ldexp_to_arith()
528 ir->operands[1] = new(ir) ir_dereference_variable(x); in ldexp_to_arith()
529 ir->operands[2] = bitcast_u2f(result); in ldexp_to_arith()
575 i.insert_before(assign(x, ir->operands[0])); in dldexp_to_arith()
577 i.insert_before(assign(exp, ir->operands[1])); in dldexp_to_arith()
652 ir->operands[0] = results[0]; in dldexp_to_arith()
653 ir->operands[1] = results[1]; in dldexp_to_arith()
654 ir->operands[2] = results[2]; in dldexp_to_arith()
655 ir->operands[3] = results[3]; in dldexp_to_arith()
690 nequal(abs(ir->operands[0]->clone(ir, NULL)), dzero))); in dfrexp_sig_to_arith()
707 ir_rvalue *x = swizzle(ir->operands[0]->clone(ir, NULL), elem, 1); in dfrexp_sig_to_arith()
729 ir->operands[0] = results[0]; in dfrexp_sig_to_arith()
730 ir->operands[1] = results[1]; in dfrexp_sig_to_arith()
731 ir->operands[2] = results[2]; in dfrexp_sig_to_arith()
732 ir->operands[3] = results[3]; in dfrexp_sig_to_arith()
762 ir_rvalue *absval = abs(ir->operands[0]); in dfrexp_exp_to_arith()
783 ir->operands[0] = new(ir) ir_dereference_variable(is_not_zero); in dfrexp_exp_to_arith()
784 ir->operands[1] = add(exponent_bias, u2i(rshift(high_words, exponent_shift))); in dfrexp_exp_to_arith()
785 ir->operands[2] = izero; in dfrexp_exp_to_arith()
801 ir_rvalue *x_clone = ir->operands[0]->clone(ir, NULL); in carry_to_arith()
804 ir->operands[0] = b2i(less(add(ir->operands[0], ir->operands[1]), x_clone)); in carry_to_arith()
805 ir->operands[1] = NULL; in carry_to_arith()
822 ir->operands[0] = b2i(less(ir->operands[0], ir->operands[1])); in borrow_to_arith()
823 ir->operands[1] = NULL; in borrow_to_arith()
839 ir->operands[0] = new(ir) ir_expression(ir_binop_max, ir->operands[0]->type, in sat_to_clamp()
840 ir->operands[0], in sat_to_clamp()
842 ir->operands[1] = new(ir) ir_constant(1.0f); in sat_to_clamp()
850 ir_variable *temp = new(ir) ir_variable(ir->operands[0]->type->get_base_type(), "dot_res", in double_dot_to_fma()
854 int nc = ir->operands[0]->type->components(); in double_dot_to_fma()
858 assig = assign(temp, mul(swizzle(ir->operands[0]->clone(ir, NULL), i, 1), in double_dot_to_fma()
859 swizzle(ir->operands[1]->clone(ir, NULL), i, 1))); in double_dot_to_fma()
861 assig = assign(temp, fma(swizzle(ir->operands[0]->clone(ir, NULL), i, 1), in double_dot_to_fma()
862 swizzle(ir->operands[1]->clone(ir, NULL), i, 1), in double_dot_to_fma()
870 ir->operands[0] = swizzle(ir->operands[0], 0, 1); in double_dot_to_fma()
871 ir->operands[1] = swizzle(ir->operands[1], 0, 1); in double_dot_to_fma()
872 ir->operands[2] = new(ir) ir_dereference_variable(temp); in double_dot_to_fma()
882 ir_rvalue *op0 = ir->operands[0], *op2 = ir->operands[2]; in double_lrp()
897 ir->operands[0] = swizzle(op2, swizval, op0->type->vector_elements); in double_lrp()
898 ir->operands[2] = mul(sub(one, op2->clone(ir, NULL)), op0); in double_lrp()
912 ir_constant *zero = new(ir) ir_constant(0.0, ir->operands[0]->type->vector_elements); in dceil_to_dfrac()
913 ir_constant *one = new(ir) ir_constant(1.0, ir->operands[0]->type->vector_elements); in dceil_to_dfrac()
914 ir_variable *frtemp = new(ir) ir_variable(ir->operands[0]->type, "frtemp", in dceil_to_dfrac()
918 i.insert_before(assign(frtemp, fract(ir->operands[0]))); in dceil_to_dfrac()
922 ir->operands[0] = sub(ir->operands[0]->clone(ir, NULL), frtemp); in dceil_to_dfrac()
923 ir->operands[1] = csel(nequal(frtemp, zero), one, zero->clone(ir, NULL)); in dceil_to_dfrac()
937 ir->operands[1] = fract(ir->operands[0]->clone(ir, NULL)); in dfloor_to_dfrac()
956 ir_variable *frtemp = new(ir) ir_variable(ir->operands[0]->type, "frtemp", in dround_even_to_dfrac()
958 ir_variable *temp = new(ir) ir_variable(ir->operands[0]->type, "temp", in dround_even_to_dfrac()
960 ir_variable *t2 = new(ir) ir_variable(ir->operands[0]->type, "t2", in dround_even_to_dfrac()
962 ir_constant *p5 = new(ir) ir_constant(0.5, ir->operands[0]->type->vector_elements); in dround_even_to_dfrac()
963 ir_constant *one = new(ir) ir_constant(1.0, ir->operands[0]->type->vector_elements); in dround_even_to_dfrac()
964 ir_constant *zero = new(ir) ir_constant(0.0, ir->operands[0]->type->vector_elements); in dround_even_to_dfrac()
967 i.insert_before(assign(temp, add(ir->operands[0], p5))); in dround_even_to_dfrac()
977 ir->operands[0] = equal(fract(ir->operands[0]->clone(ir, NULL)), in dround_even_to_dfrac()
979 ir->operands[1] = csel(equal(fract(mul(t2, p5->clone(ir, NULL))), in dround_even_to_dfrac()
983 ir->operands[2] = new(ir) ir_dereference_variable(t2); in dround_even_to_dfrac()
996 ir_rvalue *arg = ir->operands[0]; in dtrunc_to_dfrac()
1003 ir_variable *temp = new(ir) ir_variable(ir->operands[0]->type, "temp", in dtrunc_to_dfrac()
1013 ir->operands[0] = gequal(arg->clone(ir, NULL), zero); in dtrunc_to_dfrac()
1014 ir->operands[1] = new (ir) ir_dereference_variable(temp); in dtrunc_to_dfrac()
1015 ir->operands[2] = add(temp, in dtrunc_to_dfrac()
1030 ir_rvalue *arg = ir->operands[0]; in dsign_to_csel()
1037 ir->operands[0] = less(arg->clone(ir, NULL), in dsign_to_csel()
1039 ir->operands[1] = neg_one; in dsign_to_csel()
1040 ir->operands[2] = csel(greater(arg, zero), in dsign_to_csel()
1054 const unsigned elements = ir->operands[0]->type->vector_elements; in bit_count_to_math()
1068 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in bit_count_to_math()
1069 base_ir->insert_before(assign(temp, ir->operands[0])); in bit_count_to_math()
1071 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in bit_count_to_math()
1072 base_ir->insert_before(assign(temp, i2u(ir->operands[0]))); in bit_count_to_math()
1087 ir->operands[0] = rshift(mul(bit_and(add(temp, rshift(temp, c4)), c0F0F0F0F), in bit_count_to_math()
1098 new(ir) ir_variable(ir->operands[0]->type, "bits", ir_var_temporary); in extract_to_shifts()
1101 base_ir->insert_before(assign(bits, ir->operands[2])); in extract_to_shifts()
1103 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in extract_to_shifts()
1105 new(ir) ir_constant(1u, ir->operands[0]->type->vector_elements); in extract_to_shifts()
1107 new(ir) ir_constant(32u, ir->operands[0]->type->vector_elements); in extract_to_shifts()
1109 new(ir) ir_constant(0xFFFFFFFFu, ir->operands[0]->type->vector_elements); in extract_to_shifts()
1131 ir->operands[0] = rshift(ir->operands[0], ir->operands[1]); in extract_to_shifts()
1132 ir->operands[1] = mask; in extract_to_shifts()
1133 ir->operands[2] = NULL; in extract_to_shifts()
1136 new(ir) ir_constant(int(0), ir->operands[0]->type->vector_elements); in extract_to_shifts()
1138 new(ir) ir_constant(int(32), ir->operands[0]->type->vector_elements); in extract_to_shifts()
1140 new(ir) ir_variable(ir->operands[0]->type, "temp", ir_var_temporary); in extract_to_shifts()
1148 rshift(lshift(ir->operands[0], sub(temp, ir->operands[1])), temp); in extract_to_shifts()
1162 ir->operands[0] = equal(c0, bits); in extract_to_shifts()
1163 ir->operands[1] = c0->clone(ir, NULL); in extract_to_shifts()
1164 ir->operands[2] = expr; in extract_to_shifts()
1177 new(ir) ir_variable(ir->operands[0]->type, "offset", ir_var_temporary); in insert_to_shifts()
1179 new(ir) ir_variable(ir->operands[0]->type, "bits", ir_var_temporary); in insert_to_shifts()
1181 new(ir) ir_variable(ir->operands[0]->type, "mask", ir_var_temporary); in insert_to_shifts()
1183 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT) { in insert_to_shifts()
1184 c1 = new(ir) ir_constant(int(1), ir->operands[0]->type->vector_elements); in insert_to_shifts()
1185 c32 = new(ir) ir_constant(int(32), ir->operands[0]->type->vector_elements); in insert_to_shifts()
1186 cFFFFFFFF = new(ir) ir_constant(int(0xFFFFFFFF), ir->operands[0]->type->vector_elements); in insert_to_shifts()
1188 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in insert_to_shifts()
1190 c1 = new(ir) ir_constant(1u, ir->operands[0]->type->vector_elements); in insert_to_shifts()
1191 c32 = new(ir) ir_constant(32u, ir->operands[0]->type->vector_elements); in insert_to_shifts()
1192 cFFFFFFFF = new(ir) ir_constant(0xFFFFFFFFu, ir->operands[0]->type->vector_elements); in insert_to_shifts()
1196 base_ir->insert_before(assign(offset, ir->operands[2])); in insert_to_shifts()
1199 base_ir->insert_before(assign(bits, ir->operands[3])); in insert_to_shifts()
1229 ir->operands[0] = bit_and(ir->operands[0], bit_not(mask)); in insert_to_shifts()
1230 ir->operands[1] = bit_and(lshift(ir->operands[1], offset), mask); in insert_to_shifts()
1231 ir->operands[2] = NULL; in insert_to_shifts()
1232 ir->operands[3] = NULL; in insert_to_shifts()
1245 new(ir) ir_constant(1u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1247 new(ir) ir_constant(2u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1249 new(ir) ir_constant(4u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1251 new(ir) ir_constant(8u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1253 new(ir) ir_constant(16u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1255 new(ir) ir_constant(0x33333333u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1257 new(ir) ir_constant(0x55555555u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1259 new(ir) ir_constant(0x0F0F0F0Fu, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1261 new(ir) ir_constant(0x00FF00FFu, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1263 new(ir) ir_variable(glsl_type::uvec(ir->operands[0]->type->vector_elements), in reverse_to_shifts()
1269 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in reverse_to_shifts()
1270 i.insert_before(assign(temp, ir->operands[0])); in reverse_to_shifts()
1272 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in reverse_to_shifts()
1273 i.insert_before(assign(temp, i2u(ir->operands[0]))); in reverse_to_shifts()
1310 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in reverse_to_shifts()
1313 ir->operands[0] = rshift(temp, c16); in reverse_to_shifts()
1314 ir->operands[1] = lshift(temp, c16->clone(ir, NULL)); in reverse_to_shifts()
1318 ir->operands[0] = bit_or(rshift(temp, c16), in reverse_to_shifts()
1332 const unsigned elements = ir->operands[0]->type->vector_elements; in find_lsb_to_float_cast()
1350 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT) { in find_lsb_to_float_cast()
1351 i.insert_before(assign(temp, ir->operands[0])); in find_lsb_to_float_cast()
1353 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in find_lsb_to_float_cast()
1354 i.insert_before(assign(temp, u2i(ir->operands[0]))); in find_lsb_to_float_cast()
1399 ir->operands[0] = equal(lsb_only, c0); in find_lsb_to_float_cast()
1400 ir->operands[1] = cminus1; in find_lsb_to_float_cast()
1401 ir->operands[2] = new(ir) ir_dereference_variable(lsb); in find_lsb_to_float_cast()
1413 const unsigned elements = ir->operands[0]->type->vector_elements; in find_msb_to_float_cast()
1431 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in find_msb_to_float_cast()
1432 i.insert_before(assign(temp, ir->operands[0])); in find_msb_to_float_cast()
1434 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in find_msb_to_float_cast()
1457 i.insert_before(assign(as_int, ir->operands[0])); in find_msb_to_float_cast()
1500 ir->operands[0] = less(msb, c0); in find_msb_to_float_cast()
1501 ir->operands[1] = cminus1; in find_msb_to_float_cast()
1502 ir->operands[2] = new(ir) ir_dereference_variable(msb); in find_msb_to_float_cast()
1543 const unsigned elements = ir->operands[0]->type->vector_elements; in imul_high_to_mul()
1577 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in imul_high_to_mul()
1578 i.insert_before(assign(src1, ir->operands[0])); in imul_high_to_mul()
1579 i.insert_before(assign(src2, ir->operands[1])); in imul_high_to_mul()
1581 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in imul_high_to_mul()
1591 i.insert_before(assign(itmp1, ir->operands[0])); in imul_high_to_mul()
1592 i.insert_before(assign(itmp2, ir->operands[1])); in imul_high_to_mul()
1629 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in imul_high_to_mul()
1633 ir->operands[0] = add(hi, rshift(t1, c16->clone(ir, NULL))); in imul_high_to_mul()
1634 ir->operands[1] = rshift(t2, c16->clone(ir, NULL)); in imul_high_to_mul()
1636 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in imul_high_to_mul()
1656 ir->operands[0] = new(ir) ir_dereference_variable(different_signs); in imul_high_to_mul()
1657 ir->operands[1] = new(ir) ir_dereference_variable(neg_hi); in imul_high_to_mul()
1658 ir->operands[2] = u2i(hi); in imul_high_to_mul()
1665 ir->operands[0] = new(ir) ir_expression(ir_unop_abs, ir->operands[0]); in sqrt_to_abs_sqrt()
1674 if (ir->operands[0]->type->is_double()) in visit_leave()
1678 if (ir->operands[0]->type->is_double()) in visit_leave()
1687 if (ir->operands[1]->type->is_integer() && lowering(INT_DIV_TO_MUL_RCP)) in visit_leave()
1689 else if ((ir->operands[1]->type->is_float() && lowering(FDIV_TO_MUL_RCP)) || in visit_leave()
1690 (ir->operands[1]->type->is_double() && lowering(DDIV_TO_MUL_RCP))) in visit_leave()
1722 if (lowering(DFREXP_DLDEXP_TO_ARITH) && ir->operands[0]->type->is_double()) in visit_leave()
1727 if (lowering(DFREXP_DLDEXP_TO_ARITH) && ir->operands[0]->type->is_double()) in visit_leave()