From 00312f3c95d9ef2f545a8479d6ad289bc791974b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 27 Feb 2020 13:05:24 +0100 Subject: [PATCH] aco: add comparison operators for PhysReg MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Rhys Perry Reviewed-By: Timur Kristóf Part-of: --- src/amd/compiler/aco_ir.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 986b2d666be..05a9754c6b1 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -271,6 +271,9 @@ struct PhysReg { constexpr unsigned reg() const { return reg_b >> 2; } constexpr unsigned byte() const { return reg_b & 0x3; } constexpr operator unsigned() const { return reg(); } + constexpr bool operator==(PhysReg other) const { return reg_b == other.reg_b; } + constexpr bool operator!=(PhysReg other) const { return reg_b != other.reg_b; } + constexpr bool operator <(PhysReg other) const { return reg_b < other.reg_b; } uint16_t reg_b = 0; }; -- 2.30.2