• Home
  • Raw
  • Download

Lines Matching refs:operands

205    ir->operands[1] = new(ir) ir_expression(ir_unop_neg, ir->operands[1]->type,  in sub_to_add_neg()
206 ir->operands[1], NULL); in sub_to_add_neg()
213 assert(ir->operands[1]->type->is_float_16_32_64()); in div_to_mul_rcp()
218 ir->operands[1]->type, in div_to_mul_rcp()
219 ir->operands[1]); in div_to_mul_rcp()
224 ir->operands[1] = expr; in div_to_mul_rcp()
232 assert(ir->operands[1]->type->is_integer_32()); in int_div_to_mul_rcp()
242 ir->operands[1]->type->vector_elements, in int_div_to_mul_rcp()
243 ir->operands[1]->type->matrix_columns); in int_div_to_mul_rcp()
245 if (ir->operands[1]->type->base_type == GLSL_TYPE_INT) in int_div_to_mul_rcp()
246 op1 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[1], NULL); in int_div_to_mul_rcp()
248 op1 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[1], NULL); in int_div_to_mul_rcp()
253 ir->operands[0]->type->vector_elements, in int_div_to_mul_rcp()
254 ir->operands[0]->type->matrix_columns); in int_div_to_mul_rcp()
256 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT) in int_div_to_mul_rcp()
257 op0 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[0], NULL); in int_div_to_mul_rcp()
259 op0 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[0], NULL); in int_div_to_mul_rcp()
267 if (ir->operands[1]->type->base_type == GLSL_TYPE_INT) { in int_div_to_mul_rcp()
269 ir->operands[0] = op0; in int_div_to_mul_rcp()
272 ir->operands[0] = new(ir) ir_expression(ir_unop_f2i, op0); in int_div_to_mul_rcp()
275 ir->operands[1] = NULL; in int_div_to_mul_rcp()
287 ir->operands[0] = new(ir) ir_expression(ir_binop_mul, ir->operands[0]->type, in exp_to_exp2()
288 ir->operands[0], log2_e); in exp_to_exp2()
296 new(ir) ir_expression(ir_unop_log2, ir->operands[0]->type, in pow_to_exp2()
297 ir->operands[0]); in pow_to_exp2()
301 ir->operands[0] = new(ir) ir_expression(ir_binop_mul, ir->operands[1]->type, in pow_to_exp2()
302 ir->operands[1], log2_x); in pow_to_exp2()
303 ir->operands[1] = NULL; in pow_to_exp2()
312 ir->operands[0] = new(ir) ir_expression(ir_unop_log2, ir->operands[0]->type, in log_to_log2()
313 ir->operands[0], NULL); in log_to_log2()
314 ir->operands[1] = _imm_fp(ir, ir->operands[0]->type, 1.0 / M_LOG2E); in log_to_log2()
321 ir_variable *x = new(ir) ir_variable(ir->operands[0]->type, "mod_x", in mod_to_floor()
323 ir_variable *y = new(ir) ir_variable(ir->operands[1]->type, "mod_y", in mod_to_floor()
330 ir->operands[0]); in mod_to_floor()
333 ir->operands[1]); in mod_to_floor()
363 ir->operands[0] = new(ir) ir_dereference_variable(x); in mod_to_floor()
364 ir->operands[1] = mul_expr; in mod_to_floor()
455 i.insert_before(assign(x, ir->operands[0])); in ldexp_to_arith()
457 i.insert_before(assign(exp, ir->operands[1])); in ldexp_to_arith()
534 ir->operands[0] = gequal(extracted_biased_exp, in ldexp_to_arith()
536 ir->operands[1] = new(ir) ir_dereference_variable(x); in ldexp_to_arith()
537 ir->operands[2] = bitcast_u2f(result); in ldexp_to_arith()
583 i.insert_before(assign(x, ir->operands[0])); in dldexp_to_arith()
585 i.insert_before(assign(exp, ir->operands[1])); in dldexp_to_arith()
660 ir->operands[0] = results[0]; in dldexp_to_arith()
661 ir->operands[1] = results[1]; in dldexp_to_arith()
662 ir->operands[2] = results[2]; in dldexp_to_arith()
663 ir->operands[3] = results[3]; in dldexp_to_arith()
698 nequal(abs(ir->operands[0]->clone(ir, NULL)), dzero))); in dfrexp_sig_to_arith()
715 ir_rvalue *x = swizzle(ir->operands[0]->clone(ir, NULL), elem, 1); in dfrexp_sig_to_arith()
737 ir->operands[0] = results[0]; in dfrexp_sig_to_arith()
738 ir->operands[1] = results[1]; in dfrexp_sig_to_arith()
739 ir->operands[2] = results[2]; in dfrexp_sig_to_arith()
740 ir->operands[3] = results[3]; in dfrexp_sig_to_arith()
770 ir_rvalue *absval = abs(ir->operands[0]); in dfrexp_exp_to_arith()
791 ir->operands[0] = new(ir) ir_dereference_variable(is_not_zero); in dfrexp_exp_to_arith()
792 ir->operands[1] = add(exponent_bias, u2i(rshift(high_words, exponent_shift))); in dfrexp_exp_to_arith()
793 ir->operands[2] = izero; in dfrexp_exp_to_arith()
809 ir_rvalue *x_clone = ir->operands[0]->clone(ir, NULL); in carry_to_arith()
812 ir->operands[0] = b2i(less(add(ir->operands[0], ir->operands[1]), x_clone)); in carry_to_arith()
813 ir->operands[1] = NULL; in carry_to_arith()
830 ir->operands[0] = b2i(less(ir->operands[0], ir->operands[1])); in borrow_to_arith()
831 ir->operands[1] = NULL; in borrow_to_arith()
848 ir_constant *zero = _imm_fp(ir, ir->operands[0]->type, 0.0); in sat_to_clamp()
849 ir->operands[0] = new(ir) ir_expression(ir_binop_max, ir->operands[0]->type, in sat_to_clamp()
850 ir->operands[0], zero); in sat_to_clamp()
851 ir->operands[1] = _imm_fp(ir, ir->operands[0]->type, 1.0); in sat_to_clamp()
859 ir_variable *temp = new(ir) ir_variable(ir->operands[0]->type->get_base_type(), "dot_res", in double_dot_to_fma()
863 int nc = ir->operands[0]->type->components(); in double_dot_to_fma()
867 assig = assign(temp, mul(swizzle(ir->operands[0]->clone(ir, NULL), i, 1), in double_dot_to_fma()
868 swizzle(ir->operands[1]->clone(ir, NULL), i, 1))); in double_dot_to_fma()
870 assig = assign(temp, fma(swizzle(ir->operands[0]->clone(ir, NULL), i, 1), in double_dot_to_fma()
871 swizzle(ir->operands[1]->clone(ir, NULL), i, 1), in double_dot_to_fma()
879 ir->operands[0] = swizzle(ir->operands[0], 0, 1); in double_dot_to_fma()
880 ir->operands[1] = swizzle(ir->operands[1], 0, 1); in double_dot_to_fma()
881 ir->operands[2] = new(ir) ir_dereference_variable(temp); in double_dot_to_fma()
891 ir_rvalue *op0 = ir->operands[0], *op2 = ir->operands[2]; in double_lrp()
906 ir->operands[0] = swizzle(op2, swizval, op0->type->vector_elements); in double_lrp()
907 ir->operands[2] = mul(sub(one, op2->clone(ir, NULL)), op0); in double_lrp()
921 ir_constant *zero = new(ir) ir_constant(0.0, ir->operands[0]->type->vector_elements); in dceil_to_dfrac()
922 ir_constant *one = new(ir) ir_constant(1.0, ir->operands[0]->type->vector_elements); in dceil_to_dfrac()
923 ir_variable *frtemp = new(ir) ir_variable(ir->operands[0]->type, "frtemp", in dceil_to_dfrac()
927 i.insert_before(assign(frtemp, fract(ir->operands[0]))); in dceil_to_dfrac()
931 ir->operands[0] = sub(ir->operands[0]->clone(ir, NULL), frtemp); in dceil_to_dfrac()
932 ir->operands[1] = csel(nequal(frtemp, zero), one, zero->clone(ir, NULL)); in dceil_to_dfrac()
946 ir->operands[1] = fract(ir->operands[0]->clone(ir, NULL)); in dfloor_to_dfrac()
965 ir_variable *frtemp = new(ir) ir_variable(ir->operands[0]->type, "frtemp", in dround_even_to_dfrac()
967 ir_variable *temp = new(ir) ir_variable(ir->operands[0]->type, "temp", in dround_even_to_dfrac()
969 ir_variable *t2 = new(ir) ir_variable(ir->operands[0]->type, "t2", in dround_even_to_dfrac()
971 ir_constant *p5 = new(ir) ir_constant(0.5, ir->operands[0]->type->vector_elements); in dround_even_to_dfrac()
972 ir_constant *one = new(ir) ir_constant(1.0, ir->operands[0]->type->vector_elements); in dround_even_to_dfrac()
973 ir_constant *zero = new(ir) ir_constant(0.0, ir->operands[0]->type->vector_elements); in dround_even_to_dfrac()
976 i.insert_before(assign(temp, add(ir->operands[0], p5))); in dround_even_to_dfrac()
986 ir->operands[0] = equal(fract(ir->operands[0]->clone(ir, NULL)), in dround_even_to_dfrac()
988 ir->operands[1] = csel(equal(fract(mul(t2, p5->clone(ir, NULL))), in dround_even_to_dfrac()
992 ir->operands[2] = new(ir) ir_dereference_variable(t2); in dround_even_to_dfrac()
1005 ir_rvalue *arg = ir->operands[0]; in dtrunc_to_dfrac()
1012 ir_variable *temp = new(ir) ir_variable(ir->operands[0]->type, "temp", in dtrunc_to_dfrac()
1022 ir->operands[0] = gequal(arg->clone(ir, NULL), zero); in dtrunc_to_dfrac()
1023 ir->operands[1] = new (ir) ir_dereference_variable(temp); in dtrunc_to_dfrac()
1024 ir->operands[2] = add(temp, in dtrunc_to_dfrac()
1039 ir_rvalue *arg = ir->operands[0]; in dsign_to_csel()
1046 ir->operands[0] = less(arg->clone(ir, NULL), in dsign_to_csel()
1048 ir->operands[1] = neg_one; in dsign_to_csel()
1049 ir->operands[2] = csel(greater(arg, zero), in dsign_to_csel()
1063 const unsigned elements = ir->operands[0]->type->vector_elements; in bit_count_to_math()
1077 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in bit_count_to_math()
1078 base_ir->insert_before(assign(temp, ir->operands[0])); in bit_count_to_math()
1080 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in bit_count_to_math()
1081 base_ir->insert_before(assign(temp, i2u(ir->operands[0]))); in bit_count_to_math()
1096 ir->operands[0] = rshift(mul(bit_and(add(temp, rshift(temp, c4)), c0F0F0F0F), in bit_count_to_math()
1107 new(ir) ir_variable(ir->operands[0]->type, "bits", ir_var_temporary); in extract_to_shifts()
1110 base_ir->insert_before(assign(bits, ir->operands[2])); in extract_to_shifts()
1112 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in extract_to_shifts()
1114 new(ir) ir_constant(1u, ir->operands[0]->type->vector_elements); in extract_to_shifts()
1116 new(ir) ir_constant(32u, ir->operands[0]->type->vector_elements); in extract_to_shifts()
1118 new(ir) ir_constant(0xFFFFFFFFu, ir->operands[0]->type->vector_elements); in extract_to_shifts()
1140 ir->operands[0] = rshift(ir->operands[0], ir->operands[1]); in extract_to_shifts()
1141 ir->operands[1] = mask; in extract_to_shifts()
1142 ir->operands[2] = NULL; in extract_to_shifts()
1145 new(ir) ir_constant(int(0), ir->operands[0]->type->vector_elements); in extract_to_shifts()
1147 new(ir) ir_constant(int(32), ir->operands[0]->type->vector_elements); in extract_to_shifts()
1149 new(ir) ir_variable(ir->operands[0]->type, "temp", ir_var_temporary); in extract_to_shifts()
1157 rshift(lshift(ir->operands[0], sub(temp, ir->operands[1])), temp); in extract_to_shifts()
1171 ir->operands[0] = equal(c0, bits); in extract_to_shifts()
1172 ir->operands[1] = c0->clone(ir, NULL); in extract_to_shifts()
1173 ir->operands[2] = expr; in extract_to_shifts()
1186 new(ir) ir_variable(ir->operands[0]->type, "offset", ir_var_temporary); in insert_to_shifts()
1188 new(ir) ir_variable(ir->operands[0]->type, "bits", ir_var_temporary); in insert_to_shifts()
1190 new(ir) ir_variable(ir->operands[0]->type, "mask", ir_var_temporary); in insert_to_shifts()
1192 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT) { in insert_to_shifts()
1193 c1 = new(ir) ir_constant(int(1), ir->operands[0]->type->vector_elements); in insert_to_shifts()
1194 c32 = new(ir) ir_constant(int(32), ir->operands[0]->type->vector_elements); in insert_to_shifts()
1195 cFFFFFFFF = new(ir) ir_constant(int(0xFFFFFFFF), ir->operands[0]->type->vector_elements); in insert_to_shifts()
1197 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in insert_to_shifts()
1199 c1 = new(ir) ir_constant(1u, ir->operands[0]->type->vector_elements); in insert_to_shifts()
1200 c32 = new(ir) ir_constant(32u, ir->operands[0]->type->vector_elements); in insert_to_shifts()
1201 cFFFFFFFF = new(ir) ir_constant(0xFFFFFFFFu, ir->operands[0]->type->vector_elements); in insert_to_shifts()
1205 base_ir->insert_before(assign(offset, ir->operands[2])); in insert_to_shifts()
1208 base_ir->insert_before(assign(bits, ir->operands[3])); in insert_to_shifts()
1238 ir->operands[0] = bit_and(ir->operands[0], bit_not(mask)); in insert_to_shifts()
1239 ir->operands[1] = bit_and(lshift(ir->operands[1], offset), mask); in insert_to_shifts()
1240 ir->operands[2] = NULL; in insert_to_shifts()
1241 ir->operands[3] = NULL; in insert_to_shifts()
1254 new(ir) ir_constant(1u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1256 new(ir) ir_constant(2u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1258 new(ir) ir_constant(4u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1260 new(ir) ir_constant(8u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1262 new(ir) ir_constant(16u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1264 new(ir) ir_constant(0x33333333u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1266 new(ir) ir_constant(0x55555555u, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1268 new(ir) ir_constant(0x0F0F0F0Fu, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1270 new(ir) ir_constant(0x00FF00FFu, ir->operands[0]->type->vector_elements); in reverse_to_shifts()
1272 new(ir) ir_variable(glsl_type::uvec(ir->operands[0]->type->vector_elements), in reverse_to_shifts()
1278 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in reverse_to_shifts()
1279 i.insert_before(assign(temp, ir->operands[0])); in reverse_to_shifts()
1281 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in reverse_to_shifts()
1282 i.insert_before(assign(temp, i2u(ir->operands[0]))); in reverse_to_shifts()
1319 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in reverse_to_shifts()
1322 ir->operands[0] = rshift(temp, c16); in reverse_to_shifts()
1323 ir->operands[1] = lshift(temp, c16->clone(ir, NULL)); in reverse_to_shifts()
1327 ir->operands[0] = bit_or(rshift(temp, c16), in reverse_to_shifts()
1341 const unsigned elements = ir->operands[0]->type->vector_elements; in find_lsb_to_float_cast()
1359 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT) { in find_lsb_to_float_cast()
1360 i.insert_before(assign(temp, ir->operands[0])); in find_lsb_to_float_cast()
1362 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in find_lsb_to_float_cast()
1363 i.insert_before(assign(temp, u2i(ir->operands[0]))); in find_lsb_to_float_cast()
1408 ir->operands[0] = equal(lsb_only, c0); in find_lsb_to_float_cast()
1409 ir->operands[1] = cminus1; in find_lsb_to_float_cast()
1410 ir->operands[2] = new(ir) ir_dereference_variable(lsb); in find_lsb_to_float_cast()
1422 const unsigned elements = ir->operands[0]->type->vector_elements; in find_msb_to_float_cast()
1440 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in find_msb_to_float_cast()
1441 i.insert_before(assign(temp, ir->operands[0])); in find_msb_to_float_cast()
1443 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in find_msb_to_float_cast()
1466 i.insert_before(assign(as_int, ir->operands[0])); in find_msb_to_float_cast()
1509 ir->operands[0] = less(msb, c0); in find_msb_to_float_cast()
1510 ir->operands[1] = cminus1; in find_msb_to_float_cast()
1511 ir->operands[2] = new(ir) ir_dereference_variable(msb); in find_msb_to_float_cast()
1571 const unsigned elements = ir->operands[0]->type->vector_elements; in imul_high_to_mul()
1605 if (ir->operands[0]->type->base_type == GLSL_TYPE_UINT) { in imul_high_to_mul()
1606 i.insert_before(assign(src1, ir->operands[0])); in imul_high_to_mul()
1607 i.insert_before(assign(src2, ir->operands[1])); in imul_high_to_mul()
1609 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in imul_high_to_mul()
1619 i.insert_before(assign(itmp1, ir->operands[0])); in imul_high_to_mul()
1620 i.insert_before(assign(itmp2, ir->operands[1])); in imul_high_to_mul()
1657 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in imul_high_to_mul()
1661 ir->operands[0] = add(hi, rshift(t1, c16->clone(ir, NULL))); in imul_high_to_mul()
1662 ir->operands[1] = rshift(t2, c16->clone(ir, NULL)); in imul_high_to_mul()
1664 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in imul_high_to_mul()
1684 ir->operands[0] = new(ir) ir_dereference_variable(different_signs); in imul_high_to_mul()
1685 ir->operands[1] = new(ir) ir_dereference_variable(neg_hi); in imul_high_to_mul()
1686 ir->operands[2] = u2i(hi); in imul_high_to_mul()
1693 ir->operands[0] = new(ir) ir_expression(ir_unop_abs, ir->operands[0]); in sqrt_to_abs_sqrt()
1704 const unsigned elements = ir->operands[0]->type->vector_elements; in mul64_to_mul_and_mul_high()
1730 i.insert_before(assign(x, ir->operands[0])); in mul64_to_mul_and_mul_high()
1732 i.insert_before(assign(y, ir->operands[1])); in mul64_to_mul_and_mul_high()
1749 ir->operands[0] = result[0]; in mul64_to_mul_and_mul_high()
1750 ir->operands[1] = result[1]; in mul64_to_mul_and_mul_high()
1751 ir->operands[2] = result[2]; in mul64_to_mul_and_mul_high()
1752 ir->operands[3] = result[3]; in mul64_to_mul_and_mul_high()
1762 if (ir->operands[0]->type->is_double()) in visit_leave()
1766 if (ir->operands[0]->type->is_double()) in visit_leave()
1775 if (ir->operands[1]->type->is_integer_32() && lowering(INT_DIV_TO_MUL_RCP)) in visit_leave()
1777 else if ((ir->operands[1]->type->is_float_16_32() && lowering(FDIV_TO_MUL_RCP)) || in visit_leave()
1778 (ir->operands[1]->type->is_double() && lowering(DDIV_TO_MUL_RCP))) in visit_leave()
1810 if (lowering(DFREXP_DLDEXP_TO_ARITH) && ir->operands[0]->type->is_double()) in visit_leave()
1815 if (lowering(DFREXP_DLDEXP_TO_ARITH) && ir->operands[0]->type->is_double()) in visit_leave()
1898 (ir->operands[0]->type->base_type == GLSL_TYPE_INT || in visit_leave()
1899 ir->operands[1]->type->base_type == GLSL_TYPE_UINT)) in visit_leave()