Skip to content

Commit

Permalink
registers: Document non-explicitness of PushPopList
Browse files Browse the repository at this point in the history
  • Loading branch information
lioncash committed Jan 13, 2024
1 parent 817c8b5 commit 7ab3c89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/biscuit/registers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ class PushPopList final {
GPR end;
};

// Deliberately non-explicit to allow for convenient instantiation at usage sites.
// e.g. Rather than CM.POP(PushPopList{ra, {s0, s2}}, 16), we can just have the
// usage be transparent like CM.POP({ra, {s0, 2}}, 16). Nice and compact!
constexpr PushPopList(GPR ra_reg, const Range& range = {}) noexcept
: m_bitmask{BuildBitmask(range)} {
BISCUIT_ASSERT(ra_reg == ra);
Expand Down

0 comments on commit 7ab3c89

Please sign in to comment.