-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly enforce int4 bit representation with ignored high bits.
The previous implementation using a bit-field leaves the exact representation implementation-defined, with some platforms storing bit-fields packed left-to-right, others right-to-left, and the masked bits unspecified. This complicates serialization and vectorized conversions. With this change, we now explicitly store the value in the lower 4 bits, and leave the upper 4 bits unspecified. The type is constructed in such a way that correctness is preserved regardless of the upper bit values. PiperOrigin-RevId: 578735344
- Loading branch information
Showing
2 changed files
with
117 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters