You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently have no mechanism, first-class or otherwise, for properly representing unsigned integers of varying widths (i8, i16, i32), which are demanded by various fields of OpenType.
The current approach taken is to mark a parsed unsigned-integer as being 'signed' by wrapping it in a variant, and using twos-complement implicitly to preserve the same bit-sequence as would be used for negative value-ranges, within the unsigned type.
To clarify, the most we need is a generic operator for casting a particular bit-width of unsigned integer to its signed analogue, e.g. Expr::ToSigned{8. 16, 32}(Box<Expr>) that maps U8 -> I8, U16 -> I16, and U32 -> I32 respectively, using the const methods available in Rust for such conversions.
The text was updated successfully, but these errors were encountered:
We currently have no mechanism, first-class or otherwise, for properly representing unsigned integers of varying widths (
i8
,i16
,i32
), which are demanded by various fields of OpenType.The current approach taken is to mark a parsed unsigned-integer as being 'signed' by wrapping it in a variant, and using twos-complement implicitly to preserve the same bit-sequence as would be used for negative value-ranges, within the unsigned type.
To clarify, the most we need is a generic operator for casting a particular bit-width of unsigned integer to its signed analogue, e.g.
Expr::ToSigned{8. 16, 32}(Box<Expr>)
that mapsU8 -> I8
,U16 -> I16
, andU32 -> I32
respectively, using the const methods available in Rust for such conversions.The text was updated successfully, but these errors were encountered: