Lines Matching refs:bi_index
77 static bi_index
92 static bi_index
106 static inline bi_index
112 static inline bi_index
140 bi_index_to_key(bi_index idx)
154 static bi_index
155 bi_extract(bi_builder *b, bi_index vec, unsigned channel)
167 bi_index *components =
185 bi_cache_collect(bi_builder *b, bi_index dst, bi_index *s, unsigned n)
188 bi_index *channels = ralloc_array(b->shader, bi_index, n);
189 memcpy(channels, s, sizeof(bi_index) * n);
202 bi_emit_split_i32(bi_builder *b, bi_index dests[4], bi_index vec, unsigned n)
222 bi_emit_cached_split_i32(bi_builder *b, bi_index vec, unsigned n)
224 bi_index dests[4] = { bi_null(), bi_null(), bi_null(), bi_null() };
234 bi_emit_cached_split(bi_builder *b, bi_index vec, unsigned bits)
248 bi_emit_collect_to(bi_builder *b, bi_index dst, bi_index *chan, unsigned n)
265 bi_collect_v2i32_to(bi_builder *b, bi_index dst, bi_index s0, bi_index s1)
267 return bi_emit_collect_to(b, dst, (bi_index[]) { s0, s1 }, 2);
271 bi_collect_v3i32_to(bi_builder *b, bi_index dst, bi_index s0, bi_index s1, bi_index s2)
273 return bi_emit_collect_to(b, dst, (bi_index[]) { s0, s1, s2 }, 3);
276 static bi_index
277 bi_collect_v2i32(bi_builder *b, bi_index s0, bi_index s1)
279 bi_index dst = bi_temp(b->shader);
284 static bi_index
310 bi_index offset = bi_src_index(&intr->src[0]);
311 bi_index f16 = bi_null();
319 bi_index f[2];
387 bi_make_vec_to(bi_builder *b, bi_index final_dst,
388 bi_index *src,
399 bi_copy_component(bi_builder *b, nir_intrinsic_instr *instr, bi_index tmp)
412 bi_index srcs[] = { tmp, tmp, tmp };
431 bi_index dest = (component == 0) ? bi_dest_index(&instr->dest) : bi_temp(b->shader);
439 bi_index idx = bi_src_index(&instr->src[0]);
498 bi_index src0 = bi_null();
502 bi_index dest = (component == 0) ? bi_dest_index(&instr->dest) : bi_temp(b->shader);
550 bi_index idx = bi_src_index(offset);
557 bi_index idx_bytes = bi_lshift_or_i32(b, idx, bi_zero(), bi_imm_u8(4));
592 bi_make_vec16_to(bi_builder *b, bi_index dst, bi_index *src,
595 bi_index srcs[BI_MAX_VEC];
603 bi_index w0 = bi_extract(b, src[i], chan >> 1);
604 bi_index w1 = next ? bi_extract(b, src[i + 1], nextc >> 1) : bi_zero();
606 bi_index h0 = bi_half(w0, chan & 1);
607 bi_index h1 = bi_half(w1, nextc & 1);
621 bi_make_vec_to(bi_builder *b, bi_index dst,
622 bi_index *src,
628 bi_index srcs[BI_MAX_VEC];
646 bi_load_ubo_to(bi_builder *b, unsigned bitsize, bi_index dest0, bi_index src0,
647 bi_index src1)
663 bi_load_sysval_to(bi_builder *b, bi_index dest, int sysval,
688 static bi_index
692 bi_index tmp = bi_temp(b->shader);
698 bi_load_sample_id_to(bi_builder *b, bi_index dst)
708 static bi_index
711 bi_index sample_id = bi_temp(b->shader);
716 static bi_index
727 bi_index indices = bi_imm_u32(indices_u32);
749 bi_index srcs[] = {
758 bi_emit_blend_op(bi_builder *b, bi_index rgba, nir_alu_type T,
759 bi_index rgba2, nir_alu_type T2, unsigned rt)
823 bi_emit_atest(bi_builder *b, bi_index alpha)
851 bi_index src0 = bi_src_index(&instr->src[0]);
856 bi_index orig = bi_coverage(b);
857 bi_index msaa = bi_load_sysval(b, PAN_SYSVAL_MULTISAMPLED, 1, 0);
858 bi_index new = bi_lshift_and_i32(b, orig, bi_extract(b, src0, 0), bi_imm_u8(0));
873 bi_index rgba = bi_src_index(&instr->src[0]);
874 bi_index alpha =
887 bi_index z = bi_dontcare(b), s = bi_dontcare(b);
903 bi_index color = bi_src_index(&instr->src[0]);
904 bi_index color2 = dual ? bi_src_index(&instr->src[4]) : bi_null();
916 bi_index srcs[4] = { color, color, color, color };
1007 bi_index data = bi_src_index(&instr->src[0]);
1021 bi_index tmp = bi_temp(b->shader);
1035 bi_index a[4] = { bi_null() };
1048 bi_index index = bi_preload(b, 59);
1055 bi_index address = bi_lea_buf_imm(b, index);
1065 bi_index address = bi_lea_attr_imm(b,
1072 bi_index idx =
1077 bi_index address = bi_lea_attr(b,
1092 bi_index dyn_offset = bi_src_index(offset);
1117 bi_index channels[4] = { bi_null() };
1128 static bi_index
1136 bi_handle_segment(bi_builder *b, bi_index *addr_lo, bi_index *addr_hi, enum bi_seg seg, int16_t *offset)
1151 bi_index base_lo = bi_fau(fau, false);
1169 bi_index dest = bi_dest_index(&instr->dest);
1170 bi_index addr_lo = bi_extract(b, bi_src_index(&instr->src[0]), 0);
1171 bi_index addr_hi = bi_addr_high(b, &instr->src[0]);
1187 bi_index addr_lo = bi_extract(b, bi_src_index(&instr->src[1]), 0);
1188 bi_index addr_hi = bi_addr_high(b, &instr->src[1]);
1200 bi_emit_axchg_to(bi_builder *b, bi_index dst, bi_index addr, nir_src *arg, enum bi_seg seg)
1207 bi_index data = bi_src_index(arg);
1209 bi_index addr_hi = (seg == BI_SEG_WLS) ? bi_zero() : bi_extract(b, addr, 1);
1223 bi_emit_acmpxchg_to(bi_builder *b, bi_index dst, bi_index addr, nir_src *arg_1, nir_src *arg_2, enum bi_seg seg)
1228 bi_index src0 = bi_src_index(arg_2);
1229 bi_index src1 = bi_src_index(arg_1);
1234 bi_index data_words[] = {
1243 bi_index in = bi_temp(b->shader);
1245 bi_index addr_hi = (seg == BI_SEG_WLS) ? bi_zero() : bi_extract(b, addr, 1);
1252 bi_index out = bi_acmpxchg(b, sz, in, bi_extract(b, addr, 0), addr_hi, seg);
1255 bi_index inout_words[] = {
1317 bi_promote_atom_c1(enum bi_atom_opc op, bi_index arg, enum bi_atom_opc *out)
1354 static bi_index
1355 bi_emit_image_coord(bi_builder *b, bi_index coord, unsigned src_idx,
1380 static bi_index
1384 bi_index index = bi_src_index(&src);
1407 bi_index coords = bi_src_index(&instr->src[1]);
1408 bi_index xy = bi_emit_image_coord(b, coords, 0, coord_comps, array);
1409 bi_index zw = bi_emit_image_coord(b, coords, 1, coord_comps, array);
1410 bi_index dest = bi_dest_index(&instr->dest);
1433 static bi_index
1448 bi_index coords = bi_src_index(&instr->src[1]);
1449 bi_index xy = bi_emit_image_coord(b, coords, 0, coord_comps, array);
1450 bi_index zw = bi_emit_image_coord(b, coords, 1, coord_comps, array);
1451 bi_index dest = bi_temp(b->shader);
1477 bi_index a[4] = { bi_null() };
1486 bi_emit_atomic_i32_to(bi_builder *b, bi_index dst,
1487 bi_index addr, bi_index arg, nir_intrinsic_op intrinsic)
1495 bi_index tmp_dest = bifrost ? bi_temp(b->shader) : dst;
1522 bi_index src[4] = {};
1545 bi_index dest = bi_dest_index(&instr->dest);
1562 bi_index desc = b->shader->inputs->is_blend ?
1576 bi_index dst = nir_intrinsic_infos[instr->intrinsic].has_dest ?
1672 bi_index addr = bi_src_index(&instr->src[0]);
1673 bi_index addr_hi;
1869 bi_index first = bi_load_sysval(b,
1939 static bi_index
1947 /* the bi_index carries the 32-bit (word) offset separate from the
1964 bi_index idx = bi_extract(b, bi_src_index(&src.src), offset);
2000 static bi_index
2001 bi_fmul_f32(bi_builder *b, bi_index s0, bi_index s1)
2010 bi_lower_frcp_32(bi_builder *b, bi_index dst, bi_index s0)
2012 bi_index x1 = bi_frcp_approx_f32(b, s0);
2013 bi_index m = bi_frexpm_f32(b, s0, false, false);
2014 bi_index e = bi_frexpe_f32(b, bi_neg(s0), false, false);
2015 bi_index t1 = bi_fma_rscale_f32(b, m, bi_neg(x1), bi_imm_f32(1.0),
2021 bi_lower_frsq_32(bi_builder *b, bi_index dst, bi_index s0)
2023 bi_index x1 = bi_frsq_approx_f32(b, s0);
2024 bi_index m = bi_frexpm_f32(b, s0, false, true);
2025 bi_index e = bi_frexpe_f32(b, bi_neg(s0), false, true);
2026 bi_index t1 = bi_fmul_f32(b, x1, x1);
2027 bi_index t2 = bi_fma_rscale_f32(b, m, bi_neg(t1), bi_imm_f32(1.0),
2037 bi_lower_fexp2_32(bi_builder *b, bi_index dst, bi_index s0)
2039 bi_index t1 = bi_temp(b->shader);
2043 bi_index t2 = bi_fadd_f32(b, t1, bi_imm_u32(0xc9400000));
2048 bi_index a1t = bi_fexp_table_u4(b, t1, BI_ADJ_NONE);
2049 bi_index t3 = bi_isub_u32(b, t1, bi_imm_u32(0x49400000), false);
2050 bi_index a1i = bi_arshift_i32(b, t3, bi_null(), bi_imm_u8(4));
2051 bi_index p1 = bi_fma_f32(b, a2->dest[0], bi_imm_u32(0x3d635635),
2053 bi_index p2 = bi_fma_f32(b, p1, a2->dest[0], bi_imm_u32(0x3f317218));
2054 bi_index p3 = bi_fmul_f32(b, a2->dest[0], p2);
2064 bi_fexp_32(bi_builder *b, bi_index dst, bi_index s0, bi_index log2_base)
2068 bi_index scale = bi_fma_rscale_f32(b, s0, log2_base, bi_negzero(),
2079 bi_lower_flog2_32(bi_builder *b, bi_index dst, bi_index s0)
2082 bi_index a1 = bi_frexpm_f32(b, s0, true, false);
2083 bi_index ei = bi_frexpe_f32(b, s0, true, false);
2084 bi_index ef = bi_s32_to_f32(b, ei);
2087 bi_index r1 = bi_flog_table_f32(b, s0, BI_MODE_RED, BI_PRECISION_NONE);
2088 bi_index xt = bi_flog_table_f32(b, s0, BI_MODE_BASE2, BI_PRECISION_NONE);
2093 bi_index x1 = bi_fadd_f32(b, ef, xt);
2098 bi_index y = bi_fma_f32(b, a1, r1, bi_imm_f32(-1.0));
2103 bi_index loge = bi_fmul_f32(b, y,
2106 bi_index x2 = bi_fmul_f32(b, loge, bi_imm_f32(1.0 / logf(2.0)));
2113 bi_flog2_32(bi_builder *b, bi_index dst, bi_index s0)
2115 bi_index frexp = bi_frexpe_f32(b, s0, true, false);
2116 bi_index frexpi = bi_s32_to_f32(b, frexp);
2117 bi_index add = bi_fadd_lscale_f32(b, bi_imm_f32(-1.0f), s0);
2122 bi_lower_fpow_32(bi_builder *b, bi_index dst, bi_index base, bi_index exp)
2124 bi_index log2_base = bi_null();
2137 bi_fpow_32(bi_builder *b, bi_index dst, bi_index base, bi_index exp)
2139 bi_index log2_base = bi_null();
2166 bi_lower_fsincos_32(bi_builder *b, bi_index dst, bi_index s0, bool cos)
2169 bi_index x_u6 = bi_fma_f32(b, s0, TWO_OVER_PI, SINCOS_BIAS);
2172 bi_index e = bi_fma_f32(b, bi_fadd_f32(b, x_u6, bi_neg(SINCOS_BIAS)),
2176 bi_index sinx = bi_fsin_table_u6(b, x_u6, false);
2177 bi_index cosx = bi_fcos_table_u6(b, x_u6, false);
2180 bi_index e2_over_2 = bi_fma_rscale_f32(b, e, e, bi_negzero(),
2184 bi_index quadratic = bi_fma_f32(b, bi_neg(e2_over_2),
2203 static bi_index
2204 bi_clper_xor(bi_builder *b, bi_index s0, bi_index s1)
2212 bi_index lane_id = bi_fau(BIR_FAU_LANE_ID, false);
2213 bi_index lane = bi_lshift_xor_i32(b, lane_id, s1, bi_imm_u8(0));
2274 bi_index dst = bi_dest_index(&instr->dest.dest);
2299 bi_index unoffset_srcs[4] = {
2325 bi_index vec = bi_src_index(&instr->src[0].src);
2353 bi_index src = bi_src_index(&instr->src[0].src);
2362 bi_index src = bi_src_index(&instr->src[0].src);
2373 bi_index idx = bi_src_index(&instr->src[0].src);
2374 bi_index unoffset_srcs[4] = { idx, idx, idx, idx };
2391 bi_index idx = bi_src_index(&instr->src[0].src);
2392 bi_index unoffset_srcs[4] = { idx, idx, idx, idx };
2407 bi_index idx = bi_src_index(&instr->src[0].src);
2408 bi_index s0 = bi_extract(b, idx, instr->src[0].swizzle[0]);
2409 bi_index s1 = comps > 1 ?
2433 bi_index idx = bi_src_index(&instr->src[0].src);
2434 bi_index s0 = bi_extract(b, idx, instr->src[0].swizzle[0]);
2435 bi_index s1 = bi_extract(b, idx, instr->src[0].swizzle[1]);
2453 bi_index idx = bi_src_index(&src->src);
2454 bi_index s0 = bi_extract(b, idx, src->swizzle[0]);
2455 bi_index s1 = bi_extract(b, idx, src->swizzle[1]);
2457 bi_index t = (src->swizzle[0] == src->swizzle[1]) ?
2474 bi_index idx = bi_src_index(&instr->src[0].src);
2502 bi_index idx = bi_src_index(&instr->src[0].src);
2503 bi_index s0 = bi_extract(b, idx, instr->src[0].swizzle[0]);
2504 bi_index s1 = bi_alu_src_index(b, instr->src[1], comps);
2505 bi_index s2 = bi_alu_src_index(b, instr->src[2], comps);
2520 bi_index s0 = srcs > 0 ? bi_alu_src_index(b, instr->src[0], comps) : bi_null();
2521 bi_index s1 = srcs > 1 ? bi_alu_src_index(b, instr->src[1], comps) : bi_null();
2522 bi_index s2 = srcs > 2 ? bi_alu_src_index(b, instr->src[2], comps) : bi_null();
2656 bi_index bit = bi_imm_u32(instr->op == nir_op_fddx_must_abs_mali ? 1 : 2);
2657 bi_index adjacent = bi_clper_xor(b, s0, bit);
2684 bi_index lane1, lane2;
2708 bi_index left, right;
3008 bi_index clz = bi_clz(b, src_sz, s0, false);
3093 static bi_index
3094 bi_emit_texc_array_index(bi_builder *b, bi_index idx, nir_alu_type T)
3121 static bi_index
3122 bi_emit_texc_lod_88(bi_builder *b, bi_index lod, bool fp16)
3143 bi_index fmul = bi_fma_f32(b, fsat->dest[0], bi_imm_f32(max_lod * 256.0f),
3155 static bi_index
3156 bi_emit_texc_lod_cube(bi_builder *b, bi_index lod)
3167 static bi_index
3170 bi_index dest = bi_zero();
3177 bi_index idx = bi_src_index(&instr->src[offs_idx].src);
3203 static bi_index
3206 bi_index dest = bi_zero();
3217 bi_index idx = bi_src_index(&instr->src[offs_idx].src);
3223 bi_index z = (nr > 2) ?
3256 bi_emit_cube_coord(bi_builder *b, bi_index coord,
3257 bi_index *face, bi_index *s, bi_index *t)
3260 bi_index maxxyz = bi_temp(b->shader);
3263 bi_index cx = bi_extract(b, coord, 0),
3276 bi_index ssel = bi_cube_ssel(b, bi_extract(b, coord, 2), bi_extract(b, coord, 0), *face);
3277 bi_index tsel = bi_cube_tsel(b, bi_extract(b, coord, 1), bi_extract(b, coord, 2),
3293 bi_index rcp = bi_frcp_f32(b, maxxyz);
3296 bi_index fma1 = bi_fma_f32(b, rcp, bi_imm_f32(0.5f), bi_negzero());
3325 static bi_index
3326 bi_emit_texc_cube_coord(bi_builder *b, bi_index coord, bi_index *t)
3328 bi_index face, s;
3330 bi_index mask = bi_imm_u32(BITFIELD_MASK(29));
3411 bi_index dregs[BIFROST_TEX_DREG_COUNT] = { };
3412 bi_index cx = bi_null(), cy = bi_null();
3415 bi_index index = bi_src_index(&instr->src[i].src);
3568 bi_index sr = sr_count ? bi_temp(b->shader) : bi_null();
3569 bi_index dst = bi_temp(b->shader);
3582 bi_index w[4] = { bi_null(), bi_null(), bi_null(), bi_null() };
3615 bi_index sregs[VALHALL_TEX_SREG_COUNT] = { };
3617 bi_index sampler = bi_imm_u32(instr->sampler_index);
3618 bi_index texture = bi_imm_u32(instr->texture_index);
3622 bi_index index = bi_src_index(&instr->src[i].src);
3702 bi_index offsets = bi_emit_valhall_offsets(b, instr);
3717 bi_index idx = sr_count ? bi_temp(b->shader) : bi_null();
3722 bi_index image_src = bi_imm_u32(tables);
3730 bi_index dest = bi_temp(b->shader);
3756 bi_index w[4] = { bi_null(), bi_null(), bi_null(), bi_null() };
3771 bi_index coords = bi_src_index(&instr->src[coord_idx].src);
3774 bi_index face, s, t;