diff --git a/.pick_status.json b/.pick_status.json index 57b253a4694..7c59df6a146 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -684,7 +684,7 @@ "description": "aco/ra: fix sub-dword get_reg_specified in some cases", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "56345b8c610e06b2c6ccb0d0975e62f9a008e34e", "notes": null diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 867d8c6aff6..87a121ee32c 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -1403,8 +1403,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 {