Use sign bit of rbyd.trunk to indicate shrubness of rbyds

Shrubness should have always been a property of lfsr_rbyd_t.

You know you've made a good design decision when things just sort of
fall into place and the code somehow becomes cleaner.

The downside of this change is accessing rbyd trunks requires a mask,
which is annoying, but the upside is we don't need to signal shrubness
via extra booleans in internal functions anymore.

The funny thing is, the actual motivation for this change is was just to
free up a bit in our tag encoding. Simplifying some of the internal
functions was just a nice side effect.

            code          stack
  before:  33940           2928
  after:   33928 (-0.0%)   2912 (-0.5%)
This commit is contained in:
Christopher Haster
2024-01-21 00:06:36 -06:00
parent 4ce582bf9b
commit bea13dcf8e
6 changed files with 125 additions and 101 deletions

View File

@@ -378,6 +378,7 @@ class Rbyd:
# keep track of eoff for best matching trunk
if trunk and j_ + size > trunk:
trunkeoff = j_ + size
eoff = trunkeoff
cksum = cksum_
trunk_ = trunk__
weight = weight_