diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir/reg.h')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/reg.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/reg.h b/src/shader_recompiler/frontend/ir/reg.h index 771094eb9..8fea05f7b 100644 --- a/src/shader_recompiler/frontend/ir/reg.h +++ b/src/shader_recompiler/frontend/ir/reg.h | |||
| @@ -293,6 +293,17 @@ constexpr size_t NUM_REGS = 256; | |||
| 293 | return reg + (-num); | 293 | return reg + (-num); |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | [[nodiscard]] constexpr Reg operator++(Reg& reg) { | ||
| 297 | reg = reg + 1; | ||
| 298 | return reg; | ||
| 299 | } | ||
| 300 | |||
| 301 | [[nodiscard]] constexpr Reg operator++(Reg& reg, int) { | ||
| 302 | const Reg copy{reg}; | ||
| 303 | reg = reg + 1; | ||
| 304 | return copy; | ||
| 305 | } | ||
| 306 | |||
| 296 | [[nodiscard]] constexpr size_t RegIndex(Reg reg) noexcept { | 307 | [[nodiscard]] constexpr size_t RegIndex(Reg reg) noexcept { |
| 297 | return static_cast<size_t>(reg); | 308 | return static_cast<size_t>(reg); |
| 298 | } | 309 | } |