Module: Mesa Branch: master Commit: 187b185502737e72dfc4a87842ef327231403846 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=187b185502737e72dfc4a87842ef327231403846
Author: Tony Wasserka <[email protected]> Date: Tue Nov 17 19:15:48 2020 +0100 aco/ra: Add some documentation This should make these somewhat tricky bits easier to follow. Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7461> --- src/amd/compiler/aco_register_allocation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index d5a921eece7..dd59239e29b 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -192,6 +192,8 @@ public: } bool is_empty_or_blocked(PhysReg start) { + /* Empty is 0, blocked is 0xFFFFFFFF, so to check both we compare the + * incremented value to 1 */ if (regs[start] == 0xF0000000) { return subdword_regs[start][start.byte()] + 1 <= 1; } @@ -994,7 +996,9 @@ std::pair<PhysReg, bool> get_reg_impl(ra_ctx& ctx, unsigned reg_lo = lb; unsigned reg_hi = lb + size - 1; for (reg_lo = lb, reg_hi = lb + size - 1; reg_hi < ub; reg_lo += stride, reg_hi += stride) { - /* first check the edges: this is what we have to fix to allow for num_moves > size */ + /* first check if the register window starts in the middle of an + * allocated variable: this is what we have to fix to allow for + * num_moves > size */ if (reg_lo > lb && !tmp_file.is_empty_or_blocked(PhysReg(reg_lo)) && tmp_file.get_id(PhysReg(reg_lo)) == tmp_file.get_id(PhysReg(reg_lo).advance(-1))) continue; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
