Lines Matching refs:src
179 * code generator: if src == dst and one instruction writes the
181 * src will have been clobbered.
196 * so we have a src/dst hazard if the first half of the instruction
198 * compressed instructions as having src/dst hazards, so the register
224 switch (src[arg].file) {
229 return 4 * type_sz(src[arg].type);
232 return exec_size * type_sz(src[arg].type);
263 if (src[i].file != BAD_FILE &&
264 brw_reg_type_is_unsigned_integer(src[i].type) && src[i].negate)
310 return dst.type == src[0].type &&
311 !src[0].abs && !src[0].negate && !saturate &&
314 dst.type == src[1].type &&
316 !src[1].abs && !src[1].negate));
419 inst->src[0].file == IMM &&
422 type_sz(inst->src[0].type) < 8 &&
423 (inst->src[0].type == inst->dst.type || inst->src[0].d == 0)) {
425 vf = brw_float_to_vf(inst->src[0].d);
429 vf = brw_float_to_vf(inst->src[0].f);
560 if (inst->src[i].file != VGRF &&
561 inst->src[i].file != ATTR &&
562 inst->src[i].file != UNIFORM)
566 brw_compose_swizzle(swizzle, inst->src[i].swizzle);
567 if (inst->src[i].swizzle != new_swizzle) {
568 inst->src[i].swizzle = new_swizzle;
592 if (inst->src[i].file != UNIFORM || inst->src[i].nr >= UBO_START)
595 assert(!inst->src[i].reladdr);
597 inst->src[i].nr += inst->src[i].offset / 16;
598 inst->src[i].offset %= 16;
623 if (inst->src[0].file != IMM)
634 if (inst->dst.type != inst->src[0].type &&
636 inst->src[0].type != BRW_REGISTER_TYPE_F)
639 if (brw_saturate_immediate(inst->src[0].type,
640 &inst->src[0].as_brw_reg())) {
648 if (inst->src[1].is_zero()) {
650 inst->src[1] = src_reg();
656 if (inst->src[0].file != UNIFORM) {
663 if (inst->src[1].is_zero()) {
665 inst->src[1] = src_reg();
671 if (inst->src[1].is_zero()) {
673 switch (inst->src[0].type) {
675 inst->src[0] = brw_imm_f(0.0f);
678 inst->src[0] = brw_imm_d(0);
681 inst->src[0] = brw_imm_ud(0u);
686 inst->src[1] = src_reg();
688 } else if (inst->src[1].is_one()) {
690 inst->src[1] = src_reg();
692 } else if (inst->src[1].is_negative_one()) {
694 inst->src[0].negate = !inst->src[0].negate;
695 inst->src[1] = src_reg();
700 if (is_uniform(inst->src[0]) ||
701 inst->src[1].is_zero()) {
703 inst->src[1] = src_reg();
732 if (IS_64BIT(inst->dst) || IS_64BIT(inst->src[0]) ||
733 IS_64BIT(inst->src[1]) || IS_64BIT(inst->src[2]))
797 int reg = inst->src[i].nr + inst->src[i].offset / REG_SIZE;
798 if (inst->src[i].file == VGRF) {
800 } else if (inst->src[i].file == FIXED_GRF) {
804 assert(inst->src[i].file != MRF);
884 if (src[i].is_accumulator())
908 if (src[i].file == BAD_FILE)
911 if (src[i].file == IMM) {
912 assert(src[i].type != BRW_REGISTER_TYPE_V &&
913 src[i].type != BRW_REGISTER_TYPE_UV);
916 if (src[i].type == BRW_REGISTER_TYPE_VF) {
918 (src[i].ud >> 0) & 0x0ff,
919 (src[i].ud >> 8) & 0x0ff,
920 (src[i].ud >> 16) & 0x0ff,
921 (src[i].ud >> 24) & 0x0ff,
924 src[i] = brw_imm_vf4(imm[BRW_GET_SWZ(swizzle, 0)],
933 src[i].swizzle = brw_compose_swizzle(swizzle, src[i].swizzle);
963 inst->src[0].file != VGRF ||
964 inst->dst.type != inst->src[0].type ||
965 inst->src[0].abs || inst->src[0].negate || inst->src[0].reladdr)
969 if (inst->dst.file == inst->src[0].file &&
970 inst->dst.nr == inst->src[0].nr &&
971 inst->dst.offset == inst->src[0].offset) {
978 if (BRW_GET_SWZ(inst->src[0].swizzle, c) != c) {
996 if (live.var_range_end(var_from_reg(alloc, dst_reg(inst->src[0])), 8) > ip)
1005 brw_apply_inv_swizzle_to_mask(inst->src[0].swizzle,
1018 if (regions_overlap(inst->src[0], inst->size_read(0),
1053 scan_inst->dst.type == scan_inst->src[0].type))
1060 if (type_sz(inst->src[0].type) != type_sz(scan_inst->src[0].type))
1072 inst->src[0].swizzle,
1083 scan_inst->dst.offset != inst->src[0].offset)
1101 if (regions_overlap(inst->src[0], inst->size_read(0),
1102 scan_inst->src[i], scan_inst->size_read(i)))
1131 scan_inst->src[i], scan_inst->size_read(i)))
1148 scan_inst->dst.nr == inst->src[0].nr &&
1149 scan_inst->dst.offset == inst->src[0].offset) {
1151 inst->src[0].swizzle);
1163 scan_inst->src[0].type = inst->src[0].type;
1214 inst->src[0] = brw_imm_d(0);
1265 if (inst->src[i].file == VGRF && regs_read(inst, i) > 1)
1266 split_grf[inst->src[i].nr] = false;
1294 if (inst->src[i].file == VGRF && split_grf[inst->src[i].nr] &&
1295 inst->src[i].offset / REG_SIZE != 0) {
1296 inst->src[i].nr = (new_virtual_grf[inst->src[i].nr] +
1297 inst->src[i].offset / REG_SIZE - 1);
1298 inst->src[i].offset %= REG_SIZE;
1397 if (inst->src[0].file != BAD_FILE)
1400 for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) {
1401 if (inst->src[i].negate)
1403 if (inst->src[i].abs)
1405 switch (inst->src[i].file) {
1407 fprintf(file, "vgrf%d", inst->src[i].nr);
1410 fprintf(file, "g%d.%d", inst->src[i].nr, inst->src[i].subnr);
1413 fprintf(file, "attr%d", inst->src[i].nr);
1416 fprintf(file, "u%d", inst->src[i].nr);
1419 switch (inst->src[i].type) {
1421 fprintf(file, "%fF", inst->src[i].f);
1424 fprintf(file, "%fDF", inst->src[i].df);
1427 fprintf(file, "%dD", inst->src[i].d);
1430 fprintf(file, "%uU", inst->src[i].ud);
1434 brw_vf_to_float((inst->src[i].ud >> 0) & 0xff),
1435 brw_vf_to_float((inst->src[i].ud >> 8) & 0xff),
1436 brw_vf_to_float((inst->src[i].ud >> 16) & 0xff),
1437 brw_vf_to_float((inst->src[i].ud >> 24) & 0xff));
1445 switch (inst->src[i].nr) {
1450 fprintf(file, "a0.%d", inst->src[i].subnr);
1453 fprintf(file, "acc%d", inst->src[i].subnr);
1456 fprintf(file, "f%d.%d", inst->src[i].nr & 0xf, inst->src[i].subnr);
1459 fprintf(file, "arf%d.%d", inst->src[i].nr & 0xf, inst->src[i].subnr);
1470 if (inst->src[i].offset ||
1471 (inst->src[i].file == VGRF &&
1472 alloc.sizes[inst->src[i].nr] * REG_SIZE != inst->size_read(i))) {
1473 const unsigned reg_size = (inst->src[i].file == UNIFORM ? 16 : REG_SIZE);
1474 fprintf(file, "+%d.%d", inst->src[i].offset / reg_size,
1475 inst->src[i].offset % reg_size);
1478 if (inst->src[i].file != IMM) {
1482 fprintf(file, "%s", chans[BRW_GET_SWZ(inst->src[i].swizzle, c)]);
1486 if (inst->src[i].abs)
1489 if (inst->src[i].file != IMM) {
1490 fprintf(file, ":%s", brw_reg_type_to_letters(inst->src[i].type));
1493 if (i < 2 && inst->src[i + 1].file != BAD_FILE)
1512 if (inst->src[i].file == ATTR) {
1513 assert(inst->src[i].offset % REG_SIZE == 0);
1514 int grf = payload_reg + inst->src[i].nr +
1515 inst->src[i].offset / REG_SIZE;
1518 reg.swizzle = inst->src[i].swizzle;
1519 reg.type = inst->src[i].type;
1520 reg.abs = inst->src[i].abs;
1521 reg.negate = inst->src[i].negate;
1522 inst->src[i] = reg;
1623 if (inst->src[1].type != BRW_REGISTER_TYPE_F ||
1624 (inst->src[1].file == IMM && !isnan(inst->src[1].f))) {
1625 ibld.CMP(ibld.null_reg_d(), inst->src[0], inst->src[1],
1628 ibld.CMPN(ibld.null_reg_d(), inst->src[0], inst->src[1],
1720 class src_reg &src = inst->src[i];
1722 switch (src.file) {
1724 reg = byte_offset(brw_vecn_grf(4, src.nr, 0), src.offset);
1725 reg.type = src.type;
1726 reg.abs = src.abs;
1727 reg.negate = src.negate;
1732 if (src.nr >= UBO_START) {
1735 ubo_push_start[src.nr - UBO_START] +
1736 src.offset / 32, 0),
1737 src.offset % 32);
1741 src.nr / 2, src.nr % 2 * 4),
1742 src.offset);
1745 reg.type = src.type;
1746 reg.abs = src.abs;
1747 reg.negate = src.negate;
1750 assert(!src.reladdr);
1755 if (type_sz(src.type) == 8) {
1756 reg = src.as_brw_reg();
1767 reg = retype(reg, src.type);
1776 src = reg;
1789 if (is_align1_df(inst) && (cvt(inst->exec_size) - 1) == src.width)
1790 src.vstride = src.width + src.hstride;
1794 /* 3-src instructions with scalar sources support arbitrary subnr,
1800 if (inst->src[i].vstride == BRW_VERTICAL_STRIDE_0 &&
1801 type_sz(inst->src[i].type) < 8) {
1802 assert(brw_is_single_value_swizzle(inst->src[i].swizzle));
1803 inst->src[i].subnr += 4 * BRW_GET_SWZ(inst->src[i].swizzle, 0);
1899 if (inst->src[i].file == BAD_FILE)
1908 if (inst->src[i].file == ATTR &&
1936 if (inst->src[i].file == BAD_FILE)
1939 if (inst->dst.file != inst->src[i].file ||
1940 inst->dst.nr != inst->src[i].nr)
1943 unsigned src_start = inst->src[i].offset;
1974 * to temporaries if there is an src/dst overlap and then move from the
1988 * new dst/src regions.
2015 if (linst->src[i].file == BAD_FILE)
2019 linst->src[i].file == ATTR &&
2023 if (!is_uniform(linst->src[i]) && !is_interleaved_attr)
2024 linst->src[i] = horiz_offset(linst->src[i], channel_offset);
2079 switch (inst->src[arg].swizzle) {
2109 const src_reg &src = inst->src[arg];
2110 assert(type_sz(src.type) == 8);
2118 if ((is_uniform(src) ||
2120 src.file == ATTR)) &&
2121 (brw_mask_for_swizzle(src.swizzle) & 12))
2124 switch (src.swizzle) {
2148 is_double = inst->src[arg].file != BAD_FILE &&
2149 type_sz(inst->src[arg].type) == 8;
2168 if (inst->src[i].file == BAD_FILE || type_sz(inst->src[i].type) < 8)
2186 unsigned swz = BRW_GET_SWZ(inst->src[i].swizzle, chan);
2187 scalar_inst->src[i].swizzle = BRW_SWIZZLE4(swz, swz, swz, swz);
2230 mul->src[0] = inst->src[1];
2231 mul->src[1] = inst->src[2];
2232 mul->src[2].file = BAD_FILE;
2236 add->src[0] = src_reg(mul_dst);
2237 add->src[1] = inst->src[0];
2238 add->src[2].file = BAD_FILE;
2269 src_reg reg = inst->src[arg];