2 ms·
I’m unsure why this is so determined to use Nan tagging with a 32bit float. It’s not going to provide a performance win, it increases complexity, etc. The reas
by olliej 4y ago
I’m unsure why this is so determined to use Nan tagging with a 32bit float. It’s not going to provide a performance win, it increases complexity, etc.
The reason we use tagged nans in high perf cases is that we’ve got 64bits burned by having to hold a float, but the total bit size for the alternative types is <= the significand bits.
Here we’re using nans to hold the tags, but all that’s doing is pushing the tag bits around: we haven’t reduced the value size, the access complexity, or provided any support for additional values.
- sparkie 4y agoI believe this is meant to be used in combination with a low-bits pointer tagging scheme. One of the low-bits tags represents a float value, and you insert this tag into the NaN-space of a IEEE-754 single-precision float in the full lower 32-bits. The upper 32-bits contains the single-precision float you are interested in. The optimization is only for single-precision floats. Other types just follow the low-bits tagging scheme.