Lines Matching refs:sel
332 static int is_lds_read(int sel)
334 return sel == EG_V_SQ_ALU_SRC_LDS_OQ_A_POP || sel == EG_V_SQ_ALU_SRC_LDS_OQ_B_POP;
343 if (is_lds_read(alu->src[src].sel)) {
458 static int reserve_gpr(struct alu_bank_swizzle *bs, unsigned sel, unsigned chan, unsigned cycle)
461 bs->hw_gpr[cycle][chan] = sel;
462 else if (bs->hw_gpr[cycle][chan] != (int)sel) {
470 struct alu_bank_swizzle *bs, unsigned sel, unsigned chan)
479 bs->hw_cfile_addr[res] = sel;
482 } else if (bs->hw_cfile_addr[res] == sel &&
490 static int is_gpr(unsigned sel)
492 return (sel <= 127);
498 static int is_kcache(unsigned sel)
500 return (sel > 511 && sel < 4607) || /* Kcache before translation. */
501 (sel > 127 && sel < 192) || /* Kcache 0 & 1 after translation. */
502 (sel > 256 && sel < 320); /* Kcache 2 & 3 after translation (EG). */
505 static int is_const(int sel)
507 return is_kcache(sel) ||
508 (sel >= V_SQ_ALU_SRC_0 &&
509 sel <= V_SQ_ALU_SRC_LITERAL);
515 int r, src, num_src, sel, elem, cycle;
519 sel = alu->src[src].sel;
521 if (is_gpr(sel)) {
523 if (src == 1 && sel == alu->src[0].sel && elem == alu->src[0].chan)
528 r = reserve_gpr(bs, sel, elem, cycle);
532 } else if (is_kcache(sel)) {
533 r = reserve_cfile(bc, bs, (alu->src[src].kc_bank<<16) + sel, elem);
545 int r, src, num_src, const_count, sel, elem, cycle;
549 sel = alu->src[src].sel;
551 if (is_const(sel)) { /* Any constant, including literal and inline constants. */
559 if (is_kcache(sel)) {
560 r = reserve_cfile(bc, bs, (alu->src[src].kc_bank<<16) + sel, elem);
566 sel = alu->src[src].sel;
568 if (is_gpr(sel)) {
574 r = reserve_gpr(bs, sel, elem, cycle);
579 if (const_count && (sel == 254 || sel == 255)) {
688 gpr[i] = prev[i]->dst.sel;
707 if (!is_gpr(alu->src[src].sel) || alu->src[src].rel)
711 if (alu->src[src].sel == gpr[4] &&
714 alu->src[src].sel = V_SQ_ALU_SRC_PS;
721 if (alu->src[src].sel == gpr[j] &&
724 alu->src[src].sel = V_SQ_ALU_SRC_PV;
735 void r600_bytecode_special_constants(uint32_t value, unsigned *sel)
739 *sel = V_SQ_ALU_SRC_0;
742 *sel = V_SQ_ALU_SRC_1_INT;
745 *sel = V_SQ_ALU_SRC_M_1_INT;
748 *sel = V_SQ_ALU_SRC_1;
751 *sel = V_SQ_ALU_SRC_0_5;
754 *sel = V_SQ_ALU_SRC_LITERAL;
767 if (alu->src[i].sel == V_SQ_ALU_SRC_LITERAL) {
793 if (alu->src[i].sel == V_SQ_ALU_SRC_LITERAL) {
898 if (slots[i]->dst.sel == prev[i]->dst.sel &&
913 slots[i]->dst.sel == prev[4]->dst.sel &&
952 if (!is_gpr(alu->src[src].sel))
961 (prev[j]->dst.sel == alu->src[src].sel ||
1079 unsigned bank, line, sel = alu->src[i].sel, index_mode;
1081 if (sel < 512)
1086 line = (sel-512)>>4;
1104 unsigned int line, sel = alu->src[i].sel, found = 0;
1106 if (sel < 512)
1109 sel -= 512;
1110 line = sel>>4;
1122 alu->src[i].sel = sel - (kcache[j].addr<<4);
1123 alu->src[i].sel += base[j];
1217 alu.src[0].sel = bc->ar_reg;
1248 alu.src[0].sel = bc->ar_reg;
1330 if (nalu->src[i].sel >= bc->ngpr && nalu->src[i].sel < 128) {
1331 bc->ngpr = nalu->src[i].sel + 1;
1333 if (nalu->src[i].sel == V_SQ_ALU_SRC_LITERAL)
1335 &nalu->src[i].sel);
1337 if (nalu->dst.write && nalu->dst.sel >= bc->ngpr) {
1338 bc->ngpr = nalu->dst.sel + 1;
1710 bc->bytecode[id++] = S_SQ_ALU_WORD0_SRC0_SEL(alu->src[0].sel) |
1714 S_SQ_ALU_WORD0_SRC1_SEL(alu->src[1].sel) |
1724 bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) |
1728 S_SQ_ALU_WORD1_OP3_SRC2_SEL(alu->src[2].sel) |
1735 bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) |
1992 static int print_sel(unsigned sel, unsigned rel, unsigned index_mode,
1996 if (rel && index_mode >= 5 && sel < 128)
2001 o += fprintf(stderr, "%d", sel);
2017 unsigned sel = alu->dst.sel;
2019 if (sel > 128 - 4) { /* clause temporary gpr */
2020 sel -= 128 - 4;
2026 o += print_sel(alu->dst.sel, alu->dst.rel, alu->index_mode, 0);
2039 unsigned sel = src->sel, need_sel = 1, need_chan = 1, need_brackets = 0;
2046 if (sel < 128 - 4) {
2048 } else if (sel < 128) {
2050 sel -= 128 - 4;
2051 } else if (sel < 160) {
2054 sel -= 128;
2055 } else if (sel < 192) {
2058 sel -= 160;
2059 } else if (sel >= 512) {
2062 sel -= 512;
2063 } else if (sel >= 448) {
2065 sel -= 448;
2067 } else if (sel >= 288) {
2070 sel -= 288;
2071 } else if (sel >= 256) {
2074 sel -= 256;
2078 switch (sel) {
2142 o += fprintf(stderr, "??IMM_%d", sel);
2148 o += print_sel(sel, src->rel, alu->index_mode, need_brackets);
2749 alu.src[0].sel = 0;
2751 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
2753 alu.dst.sel = i + 1;
2766 alu.src[0].sel = 0;
2768 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
2770 alu.dst.sel = i + 1;
2882 alu->src[0].sel = G_SQ_ALU_WORD0_SRC0_SEL(word0);
2886 alu->src[1].sel = G_SQ_ALU_WORD0_SRC1_SEL(word0);
2898 alu->dst.sel = G_SQ_ALU_WORD1_DST_GPR(word1);
2905 alu->src[2].sel = G_SQ_ALU_WORD1_OP3_SRC2_SEL(word1);