unsigned char LongFractWidth, LongFractAlign;
// If true, unsigned fixed point types have the same number of fractional bits
- // as their signed counterparts. Otherwise, unsigned fixed point types have
+ // as their signed counterparts, forcing the unsigned types to have one extra
+ // bit of padding. Otherwise, unsigned fixed point types have
// one more fractional bit than its corresponding signed type. This is false
// by default.
- bool SameFBits;
+ bool PaddingOnUnsignedFixedPoint;
// Fixed point integral and fractional bit sizes
// Saturated types share the same integral/fractional bits as their
// For simplicity, the fractional bits in a _Fract type will be one less the
// width of that _Fract type. This leaves all signed _Fract types having no
// padding and unsigned _Fract types will only have 1 bit of padding after the
- // sign if SameFBits is set.
+ // sign if PaddingOnUnsignedFixedPoint is set.
unsigned char ShortAccumScale;
unsigned char AccumScale;
unsigned char LongAccumScale;
/// getUnsignedShortAccumScale/IBits - Return the number of
/// fractional/integral bits in a 'unsigned short _Accum' type.
unsigned getUnsignedShortAccumScale() const {
- return SameFBits ? ShortAccumScale : ShortAccumScale + 1;
+ return PaddingOnUnsignedFixedPoint ? ShortAccumScale : ShortAccumScale + 1;
}
unsigned getUnsignedShortAccumIBits() const {
- return SameFBits ? getShortAccumIBits()
- : ShortAccumWidth - getUnsignedShortAccumScale();
+ return PaddingOnUnsignedFixedPoint
+ ? getShortAccumIBits()
+ : ShortAccumWidth - getUnsignedShortAccumScale();
}
/// getUnsignedAccumScale/IBits - Return the number of fractional/integral
/// bits in a 'unsigned _Accum' type.
unsigned getUnsignedAccumScale() const {
- return SameFBits ? AccumScale : AccumScale + 1;
+ return PaddingOnUnsignedFixedPoint ? AccumScale : AccumScale + 1;
}
unsigned getUnsignedAccumIBits() const {
- return SameFBits ? getAccumIBits() : AccumWidth - getUnsignedAccumScale();
+ return PaddingOnUnsignedFixedPoint ? getAccumIBits()
+ : AccumWidth - getUnsignedAccumScale();
}
/// getUnsignedLongAccumScale/IBits - Return the number of fractional/integral
/// bits in a 'unsigned long _Accum' type.
unsigned getUnsignedLongAccumScale() const {
- return SameFBits ? LongAccumScale : LongAccumScale + 1;
+ return PaddingOnUnsignedFixedPoint ? LongAccumScale : LongAccumScale + 1;
}
unsigned getUnsignedLongAccumIBits() const {
- return SameFBits ? getLongAccumIBits()
- : LongAccumWidth - getUnsignedLongAccumScale();
+ return PaddingOnUnsignedFixedPoint
+ ? getLongAccumIBits()
+ : LongAccumWidth - getUnsignedLongAccumScale();
}
/// getShortFractScale - Return the number of fractional bits
/// getUnsignedShortFractScale - Return the number of fractional bits
/// in a 'unsigned short _Fract' type.
unsigned getUnsignedShortFractScale() const {
- return SameFBits ? getShortFractScale() : getShortFractScale() + 1;
+ return PaddingOnUnsignedFixedPoint ? getShortFractScale()
+ : getShortFractScale() + 1;
}
/// getUnsignedFractScale - Return the number of fractional bits
/// in a 'unsigned _Fract' type.
unsigned getUnsignedFractScale() const {
- return SameFBits ? getFractScale() : getFractScale() + 1;
+ return PaddingOnUnsignedFixedPoint ? getFractScale() : getFractScale() + 1;
}
/// getUnsignedLongFractScale - Return the number of fractional bits
/// in a 'unsigned long _Fract' type.
unsigned getUnsignedLongFractScale() const {
- return SameFBits ? getLongFractScale() : getLongFractScale() + 1;
+ return PaddingOnUnsignedFixedPoint ? getLongFractScale()
+ : getLongFractScale() + 1;
}
/// Determine whether the __int128 type is supported on this target.