Lines Matching refs:emit

46  *    A series of functions which create ir_function_signatures and emit IR
1060 * If \p glsl is \c true, use the GLSL built-in names and emit code
1062 * false, emit a function prototype with no body for each image
5764 body.emit(ret(expr(opcode, x)));
5795 body.emit(ret(expr(opcode, y, x)));
5797 body.emit(ret(expr(opcode, x, y)));
5820 body.emit(ret(mul(degrees, imm(0.0174532925f))));
5829 body.emit(ret(mul(radians, imm(57.29578f))));
5841 body.emit(ret(div(sin(theta), cos(theta))));
5901 body.emit(ret(asin_expr(x, 0.086566724f, -0.03102955f)));
5912 body.emit(ret(sub(imm(M_PI_2f), asin_expr(x, 0.08132463f, -0.02363318f))));
5924 body.emit(ret(mul(imm(0.5f), sub(exp(x), exp(neg(x))))));
5936 body.emit(ret(mul(imm(0.5f), add(exp(x), exp(neg(x))))));
5953 body.emit(assign(t, min2(max2(x, imm(-10.0f)), imm(10.0f))));
5956 body.emit(ret(div(sub(exp(t), exp(neg(t))),
5968 body.emit(ret(mul(sign(x), log(add(abs(x), sqrt(add(mul(x, x),
5979 body.emit(ret(log(add(x, sqrt(sub(mul(x, x), imm(1.0f)))))));
5989 body.emit(ret(mul(imm(0.5f), log(div(add(imm(1.0f), x),
6040 body.emit(assign(t, expr(ir_unop_trunc, x)));
6041 body.emit(assign(i, t));
6042 body.emit(ret(sub(x, t)));
6070 body.emit(ret(clamp(x, minVal, maxVal)));
6083 body.emit(ret(lrp(x, y, a)));
6105 body.emit(ret(csel(a, y, x)));
6121 body.emit(assign(t, f2d(b2f(gequal(x, edge)))));
6123 body.emit(assign(t, b2f(gequal(x, edge))));
6128 body.emit(assign(t, f2d(b2f(gequal(swizzle(x, i, 1), edge))), 1 << i));
6130 body.emit(assign(t, b2f(gequal(swizzle(x, i, 1), edge)), 1 << i));
6136 body.emit(assign(t, f2d(b2f(gequal(swizzle(x, i, 1), swizzle(edge, i, 1)))),
6139 body.emit(assign(t, b2f(gequal(swizzle(x, i, 1), swizzle(edge, i, 1))),
6144 body.emit(ret(t));
6165 body.emit(assign(t, clamp(div(sub(x, edge0), sub(edge1, edge0)),
6168 body.emit(ret(mul(t, mul(t, sub(IMM_FP(x_type, 3.0), mul(IMM_FP(x_type, 2.0), t))))));
6179 body.emit(ret(nequal(x, x)));
6204 body.emit(ret(equal(abs(x), imm(type, infinities))));
6220 body.emit(ret(bitcast_f2i(x)));
6229 body.emit(ret(bitcast_f2u(x)));
6238 body.emit(ret(bitcast_i2f(x)));
6247 body.emit(ret(bitcast_u2f(x)));
6256 body.emit(ret(bitcast_d2i64(x)));
6265 body.emit(ret(bitcast_d2u64(x)));
6274 body.emit(ret(bitcast_i642d(x)));
6283 body.emit(ret(bitcast_u642d(x)));
6292 body.emit(ret(expr(ir_unop_pack_unorm_2x16, v)));
6301 body.emit(ret(expr(ir_unop_pack_snorm_2x16, v)));
6310 body.emit(ret(expr(ir_unop_pack_unorm_4x8, v)));
6319 body.emit(ret(expr(ir_unop_pack_snorm_4x8, v)));
6328 body.emit(ret(expr(ir_unop_unpack_unorm_2x16, p)));
6337 body.emit(ret(expr(ir_unop_unpack_snorm_2x16, p)));
6347 body.emit(ret(expr(ir_unop_unpack_unorm_4x8, p)));
6356 body.emit(ret(expr(ir_unop_unpack_snorm_4x8, p)));
6365 body.emit(ret(expr(ir_unop_pack_half_2x16, v)));
6374 body.emit(ret(expr(ir_unop_unpack_half_2x16, p)));
6383 body.emit(ret(expr(ir_unop_pack_double_2x32, v)));
6392 body.emit(ret(expr(ir_unop_unpack_double_2x32, p)));
6401 body.emit(ret(expr(ir_unop_pack_int_2x32, v)));
6410 body.emit(ret(expr(ir_unop_unpack_int_2x32, p)));
6419 body.emit(ret(expr(ir_unop_pack_uint_2x32, v)));
6428 body.emit(ret(expr(ir_unop_unpack_uint_2x32, p)));
6438 body.emit(ret(sqrt(dot(x, x))));
6451 body.emit(ret(abs(sub(p0, p1))));
6454 body.emit(assign(p, sub(p0, p1)));
6455 body.emit(ret(sqrt(dot(p, p))));
6481 body.emit(ret(sub(mul(swizzle(a, yzx, 3), swizzle(b, zxy, 3)),
6494 body.emit(ret(sign(x)));
6496 body.emit(ret(mul(x, rsq(dot(x, x)))));
6508 * directly by ast_function.cpp. Just emit a prototype here so we
6522 body.emit(if_tree(less(dot(Nref, I), IMM_FP(type, 0.0)),
6536 body.emit(ret(sub(I, mul(IMM_FP(type, 2.0), mul(dot(N, I), N)))));
6550 body.emit(assign(n_dot_i, dot(N, I)));
6560 body.emit(assign(k, sub(IMM_FP(type, 1.0),
6563 body.emit(if_tree(less(k, IMM_FP(type, 0.0)),
6580 body.emit(assign(array_ref(z, i), mul(array_ref(x, i), array_ref(y, i))));
6582 body.emit(ret(z));
6604 body.emit(assign(array_ref(m, i), mul(c, swizzle(r, i, 1))));
6606 body.emit(ret(m));
6625 body.emit(assign(array_ref(t, j),
6630 body.emit(ret(t));
6641 body.emit(ret(sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 1, 1)),
6665 body.emit(ret(add(sub(mul(matrix_elt(m, 0, 0), f1),
6699 body.emit(assign(SubFactor00, sub(mul(matrix_elt(m, 2, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 2, 3)))));
6700 body.emit(assign(SubFactor01, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 3)))));
6701 body.emit(assign(SubFactor02, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 2)))));
6702 body.emit(assign(SubFactor03, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 3)))));
6703 body.emit(assign(SubFactor04, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 2)))));
6704 body.emit(assign(SubFactor05, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 1)))));
6705 body.emit(assign(SubFactor06, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 1, 3)))));
6706 body.emit(assign(SubFactor07, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3)))));
6707 body.emit(assign(SubFactor08, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 2)))));
6708 body.emit(assign(SubFactor09, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 3)))));
6709 body.emit(assign(SubFactor10, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 2)))));
6710 body.emit(assign(SubFactor11, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3)))));
6711 body.emit(assign(SubFactor12, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 1)))));
6712 body.emit(assign(SubFactor13, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 2), matrix_elt(m, 1, 3)))));
6713 body.emit(assign(SubFactor14, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 3)))));
6714 body.emit(assign(SubFactor15, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 2)))));
6715 body.emit(assign(SubFactor16, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 3)))));
6716 body.emit(assign(SubFactor17, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 2)))));
6717 body.emit(assign(SubFactor18, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 1)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 1)))));
6721 body.emit(assign(adj_0,
6726 body.emit(assign(adj_0, neg(
6731 body.emit(assign(adj_0,
6736 body.emit(assign(adj_0, neg(
6742 body.emit(ret(dot(array_ref(m, 0), adj_0)));
6754 body.emit(assign(array_ref(adj, 0), matrix_elt(m, 1, 1), 1 << 0));
6755 body.emit(assign(array_ref(adj, 0), neg(matrix_elt(m, 0, 1)), 1 << 1));
6756 body.emit(assign(array_ref(adj, 1), neg(matrix_elt(m, 1, 0)), 1 << 0));
6757 body.emit(assign(array_ref(adj, 1), matrix_elt(m, 0, 0), 1 << 1));
6763 body.emit(ret(div(adj, det)));
6778 body.emit(assign(f11_22_21_12,
6781 body.emit(assign(f10_22_20_12,
6784 body.emit(assign(f10_21_20_11,
6789 body.emit(assign(array_ref(adj, 0), f11_22_21_12, WRITEMASK_X));
6790 body.emit(assign(array_ref(adj, 1), neg(f10_22_20_12), WRITEMASK_X));
6791 body.emit(assign(array_ref(adj, 2), f10_21_20_11, WRITEMASK_X));
6793 body.emit(assign(array_ref(adj, 0), neg(
6797 body.emit(assign(array_ref(adj, 1),
6801 body.emit(assign(array_ref(adj, 2), neg(
6806 body.emit(assign(array_ref(adj, 0),
6810 body.emit(assign(array_ref(adj, 1), neg(
6814 body.emit(assign(array_ref(adj, 2),
6824 body.emit(ret(div(adj, det)));
6856 body.emit(assign(SubFactor00, sub(mul(matrix_elt(m, 2, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 2, 3)))));
6857 body.emit(assign(SubFactor01, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 3)))));
6858 body.emit(assign(SubFactor02, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 2)))));
6859 body.emit(assign(SubFactor03, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 3)))));
6860 body.emit(assign(SubFactor04, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 2)))));
6861 body.emit(assign(SubFactor05, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 1)))));
6862 body.emit(assign(SubFactor06, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 1, 3)))));
6863 body.emit(assign(SubFactor07, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3)))));
6864 body.emit(assign(SubFactor08, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 2)))));
6865 body.emit(assign(SubFactor09, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 3)))));
6866 body.emit(assign(SubFactor10, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 2)))));
6867 body.emit(assign(SubFactor11, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3)))));
6868 body.emit(assign(SubFactor12, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 1)))));
6869 body.emit(assign(SubFactor13, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 2), matrix_elt(m, 1, 3)))));
6870 body.emit(assign(SubFactor14, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 3)))));
6871 body.emit(assign(SubFactor15, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 2)))));
6872 body.emit(assign(SubFactor16, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 3)))));
6873 body.emit(assign(SubFactor17, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 2)))));
6874 body.emit(assign(SubFactor18, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 1)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 1)))));
6877 body.emit(assign(array_ref(adj, 0),
6882 body.emit(assign(array_ref(adj, 1), neg(
6887 body.emit(assign(array_ref(adj, 2),
6892 body.emit(assign(array_ref(adj, 3), neg(
6898 body.emit(assign(array_ref(adj, 0), neg(
6903 body.emit(assign(array_ref(adj, 1),
6908 body.emit(assign(array_ref(adj, 2), neg(
6913 body.emit(assign(array_ref(adj, 3),
6919 body.emit(assign(array_ref(adj, 0),
6924 body.emit(assign(array_ref(adj, 1), neg(
6929 body.emit(assign(array_ref(adj, 2),
6934 body.emit(assign(array_ref(adj, 3), neg(
6940 body.emit(assign(array_ref(adj, 0), neg(
6945 body.emit(assign(array_ref(adj, 1),
6950 body.emit(assign(array_ref(adj, 2), neg(
6955 body.emit(assign(array_ref(adj, 3),
6967 body.emit(ret(div(adj, det)));
7030 body.emit(ret(expr(ir_binop_any_nequal, v, imm(false, vec_elem))));
7042 body.emit(ret(expr(ir_binop_all_equal, v, imm(true, vec_elem))));
7084 body.emit(ret(tex));
7098 body.emit(ret(tex));
7113 body.emit(call(f, retval, sig->parameters));
7114 body.emit(ret(retval));
7242 body.emit(assign(r, tex));
7243 body.emit(assign(texel, record_ref(r, "texel")));
7244 body.emit(ret(record_ref(r, "code")));
7246 body.emit(ret(tex));
7299 body.emit(assign(r, tex));
7300 body.emit(assign(texel, record_ref(r, "texel")));
7301 body.emit(ret(record_ref(r, "code")));
7303 body.emit(ret(tex));
7352 body.emit(assign(r, tex));
7353 body.emit(assign(texel, record_ref(r, "texel")));
7354 body.emit(ret(record_ref(r, "code")));
7356 body.emit(ret(tex));
7367 body.emit(new(mem_ctx) ir_emit_vertex(stream));
7387 body.emit(new(mem_ctx) ir_emit_vertex(var_ref(stream)));
7398 body.emit(new(mem_ctx) ir_end_primitive(stream));
7418 body.emit(new(mem_ctx) ir_end_primitive(var_ref(stream)));
7428 body.emit(new(mem_ctx) ir_barrier());
7446 body.emit(ret(tex));
7462 body.emit(ret(tex));
7481 body.emit(ret(tex));
7499 body.emit(ret(add(abs(expr(ir_unop_dFdx, p)), abs(expr(ir_unop_dFdy, p)))));
7510 body.emit(ret(add(abs(expr(ir_unop_dFdx_coarse, p)),
7522 body.emit(ret(add(abs(expr(ir_unop_dFdx_fine, p)),
7546 body.emit(ret(imm(glsl_type::float_type, ir_constant_data())));
7556 body.emit(ret(imm(glsl_type::vec2_type, ir_constant_data())));
7566 body.emit(ret(imm(glsl_type::vec3_type, ir_constant_data())));
7576 body.emit(ret(imm(glsl_type::vec4_type, ir_constant_data())));
7593 body.emit(ret(expr(ir_triop_bitfield_extract, value,
7614 body.emit(ret(bitfield_insert(base, insert,
7659 body.emit(ret(ir_builder::min2(
7674 body.emit(ret(ir_builder::fma(a, b, c)));
7693 body.emit(assign(exponent, expr(ir_unop_frexp_exp, x)));
7695 body.emit(ret(expr(ir_unop_frexp_sig, x)));
7728 body.emit(assign(is_not_zero, nequal(abs(x), imm(0.0f, vec_elem))));
7733 body.emit(assign(exponent, rshift(bitcast_f2i(abs(x)), exponent_shift)));
7734 body.emit(assign(exponent, add(exponent, csel(is_not_zero, exponent_bias,
7738 body.emit(assign(bits, bitcast_f2u(x)));
7739 body.emit(assign(bits, bit_and(bits, sign_mantissa_mask)));
7740 body.emit(assign(bits, bit_or(bits, csel(is_not_zero, exponent_value,
7742 body.emit(ret(bitcast_u2f(bits)));
7755 body.emit(assign(carry, ir_builder::carry(x, y)));
7756 body.emit(ret(add(x, y)));
7776 body.emit(assign(borrow, ir_builder::borrow(x, y)));
7777 body.emit(ret(sub(x, y)));
7848 body.emit(assign(unpack_val, expr(unpack_op, mul_res)));
7849 body.emit(assign(msb, swizzle_y(unpack_val)));
7850 body.emit(assign(lsb, swizzle_x(unpack_val)));
7853 body.emit(assign(unpack_val, expr(unpack_op, swizzle(mul_res, i, 1))));
7854 body.emit(assign(array_ref(msb, i), swizzle_y(unpack_val)));
7855 body.emit(assign(array_ref(lsb, i), swizzle_x(unpack_val)));
7876 body.emit(ret(interpolate_at_centroid(interpolant)));
7889 body.emit(ret(interpolate_at_offset(interpolant, offset)));
7902 body.emit(ret(interpolate_at_sample(interpolant, sample_num)));
7968 body.emit(call(shader->symbols->get_function(intrinsic), retval,
7970 body.emit(ret(retval));
7991 body.emit(assign(neg_data, neg(data)));
8005 body.emit(c);
8007 body.emit(call(shader->symbols->get_function(intrinsic), retval,
8011 body.emit(ret(retval));
8025 body.emit(call(shader->symbols->get_function(intrinsic), retval,
8027 body.emit(ret(retval));
8043 body.emit(call(shader->symbols->get_function(intrinsic), retval,
8045 body.emit(ret(retval));
8062 body.emit(call(shader->symbols->get_function(intrinsic), retval,
8064 body.emit(ret(retval));
8077 body.emit(ret(min3));
8091 body.emit(ret(max3));
8105 body.emit(ret(mid3));
8280 body.emit(call(f, NULL, sig->parameters));
8295 body.emit(call(f, ret_val, sig->parameters));
8298 body.emit(assign(texel, texel_field));
8299 body.emit(ret(record_ref(ret_val, "code")));
8303 body.emit(call(f, ret_val, sig->parameters));
8304 body.emit(ret(ret_val));
8329 body.emit(call(shader->symbols->get_function(intrinsic_name),
8351 body.emit(call(shader->symbols->get_function("__intrinsic_ballot"),
8353 body.emit(ret(retval));
8374 body.emit(call(shader->symbols->get_function("__intrinsic_read_first_invocation"),
8376 body.emit(ret(retval));
8399 body.emit(call(shader->symbols->get_function("__intrinsic_read_invocation"),
8401 body.emit(ret(retval));
8418 body.emit(call(shader->symbols->get_function(intrinsic_name),
8439 body.emit(call(shader->symbols->get_function("__intrinsic_shader_clock"),
8443 body.emit(ret(expr(ir_unop_pack_uint_2x32, retval)));
8445 body.emit(ret(retval));
8470 body.emit(call(shader->symbols->get_function(intrinsic_name),
8472 body.emit(ret(retval));
8491 body.emit(call(shader->symbols->get_function("__intrinsic_helper_invocation"),
8493 body.emit(ret(retval));