aco/ra: fix sub-dword get_reg_specified in some cases
For example, v6b MIMG can have sdw_def_info={4, 6}. This now has similar
behaviour as the DefInfo constructor.
fossil-db (navi31):
Totals from 5 (0.01% of 79395) affected shaders:
CodeSize: 29460 -> 29408 (-0.18%); split: -0.29%, +0.11%
Latency: 22133 -> 21934 (-0.90%); split: -2.51%, +1.61%
InvThroughput: 2953 -> 2963 (+0.34%); split: -0.03%, +0.37%
Copies: 410 -> 409 (-0.24%); split: -1.95%, +1.71%
VALU: 3242 -> 3241 (-0.03%); split: -0.25%, +0.22%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 56345b8c61
("aco: allow reading/writing upper halves/bytes when possible")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30761>
This commit is contained in:
@@ -1407,8 +1407,9 @@ get_reg_specified(ra_ctx& ctx, const RegisterFile& reg_file, RegClass rc,
|
||||
return false;
|
||||
|
||||
if (rc.is_subdword()) {
|
||||
PhysReg test_reg;
|
||||
test_reg.reg_b = reg.reg_b & ~(sdw_def_info.second - 1);
|
||||
PhysReg test_reg = reg;
|
||||
if (sdw_def_info.second > rc.bytes())
|
||||
test_reg.reg_b &= ~(align(sdw_def_info.first, sdw_def_info.second) - 1);
|
||||
if (reg_file.test(test_reg, sdw_def_info.second))
|
||||
return false;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user