mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
brw: Use brw_reg_is_arf in update_for_reads
brw_reg::nr encodes both which ARF it is and which instance of that ARF. In other words, nr for acc0 and acc2 have some bits that say BRW_ARF_ACCUMULATOR and some bits that say 0 vs 2. The previous test would only detect acc0. Fixes:0d144821f0("intel/brw: Add a new def analysis pass") Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit366410e913) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
parent
f21bc439a1
commit
815691378b
3 changed files with 28 additions and 4 deletions
|
|
@ -2954,7 +2954,7 @@
|
|||
"description": "brw: Use brw_reg_is_arf in update_for_reads",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0d144821f0f7647ab377e629599b17dd24a2fe13",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ brw_def_analysis::update_for_reads(const brw_idom_tree &idom,
|
|||
* and flags make the destination not a def, as we don't track those.
|
||||
*/
|
||||
if (inst->src[i].file == ARF &&
|
||||
(nr == BRW_ARF_ADDRESS ||
|
||||
nr == BRW_ARF_ACCUMULATOR ||
|
||||
nr == BRW_ARF_FLAG))
|
||||
(brw_reg_is_arf(inst->src[i], BRW_ARF_ADDRESS) ||
|
||||
brw_reg_is_arf(inst->src[i], BRW_ARF_ACCUMULATOR) ||
|
||||
brw_reg_is_arf(inst->src[i], BRW_ARF_FLAG)))
|
||||
mark_invalid(inst->dst);
|
||||
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -67,3 +67,27 @@ TEST_F(defs_test, dst_and_src_are_acc0)
|
|||
|
||||
EXPECT_EQ(inst, defs.get(dst0));
|
||||
}
|
||||
|
||||
TEST_F(defs_test, src_is_acc2)
|
||||
{
|
||||
set_gfx_verx10(125);
|
||||
|
||||
brw_builder bld = make_shader(MESA_SHADER_FRAGMENT, 16);
|
||||
|
||||
brw_reg dst0 = vgrf(bld, BRW_TYPE_F);
|
||||
brw_reg src0 = vgrf(bld, BRW_TYPE_F);
|
||||
brw_reg acc2 = retype(brw_acc_reg(16), BRW_TYPE_F);
|
||||
|
||||
acc2.nr = BRW_ARF_ACCUMULATOR + 2;
|
||||
|
||||
bld.MOV(src0, brw_imm_f(1.0));
|
||||
bld.MOV(acc2, brw_imm_f(2.0));
|
||||
bld.MUL(dst0, src0, acc2);
|
||||
|
||||
brw_calculate_cfg(*bld.shader);
|
||||
brw_validate(*bld.shader);
|
||||
|
||||
const brw_def_analysis &defs = bld.shader->def_analysis.require();
|
||||
|
||||
EXPECT_EQ(NULL, defs.get(dst0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue