aco: add comparison operators for PhysReg
authorDaniel Schürmann <daniel@schuermann.dev>
Thu, 27 Feb 2020 12:05:24 +0000 (13:05 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Fri, 3 Apr 2020 22:13:15 +0000 (23:13 +0100)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002>

src/amd/compiler/aco_ir.h

index 986b2d666beda97373cc73245f660413b803bc27..05a9754c6b19270c0e02a71002ea958fc32f11af 100644 (file)
@@ -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;
 };