mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
aco: use RegisterDemand::operator[] more
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39690>
This commit is contained in:
parent
176b075129
commit
bddd8b36a6
1 changed files with 3 additions and 15 deletions
|
|
@ -1042,13 +1042,7 @@ private:
|
|||
struct RegisterDemand {
|
||||
constexpr RegisterDemand() = default;
|
||||
constexpr RegisterDemand(const int16_t v, const int16_t s) noexcept : vgpr{v}, sgpr{s} {}
|
||||
constexpr RegisterDemand(Temp t) noexcept
|
||||
{
|
||||
if (t.regClass().type() == RegType::sgpr)
|
||||
sgpr = t.size();
|
||||
else
|
||||
vgpr = t.size();
|
||||
}
|
||||
constexpr RegisterDemand(Temp t) noexcept { (*this)[t.type()] = t.size(); }
|
||||
int16_t vgpr = 0;
|
||||
int16_t sgpr = 0;
|
||||
|
||||
|
|
@ -1113,19 +1107,13 @@ struct RegisterDemand {
|
|||
|
||||
constexpr RegisterDemand& operator+=(const Temp t) noexcept
|
||||
{
|
||||
if (t.type() == RegType::sgpr)
|
||||
sgpr += t.size();
|
||||
else
|
||||
vgpr += t.size();
|
||||
(*this)[t.type()] += t.size();
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr RegisterDemand& operator-=(const Temp t) noexcept
|
||||
{
|
||||
if (t.type() == RegType::sgpr)
|
||||
sgpr -= t.size();
|
||||
else
|
||||
vgpr -= t.size();
|
||||
(*this)[t.type()] -= t.size();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue