-
Notifications
You must be signed in to change notification settings - Fork 29
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 and sign-extension.
The previous implementation using a bit-field leaves the exact representation implementation-defined, with some platforms storing bit-fields packed left-to-right, and the masked bits unspecified. This complicates serialization and vectorized conversions. With this change, we now explicitly store the value in a full `UnderlyingTy`, with appropriate sign extension bits. This guarantees the value is represented by the lowest 4 bits, and allows us to reinterpret values directly as `UnderlyingTy`. PiperOrigin-RevId: 577312207
- Loading branch information
Showing
1 changed file
with
60 additions
and
45 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