Next: Named Address Spaces, Previous: Hex Floats, Up: C Extensions [Contents][Index]
As an extension, GNU C supports fixed-point types as defined in the N1169 draft of ISO/IEC DTR 18037. Support for fixed-point types in GCC will evolve as the draft technical report changes. Calling conventions for any target might also change. Not all targets support fixed-point types.
The fixed-point types are short _Fract, _Fract, long _Fract, long long _Fract, unsigned short _Fract, unsigned _Fract, unsigned long _Fract, unsigned long long _Fract, _Sat short _Fract, _Sat _Fract, _Sat long _Fract, _Sat long long _Fract, _Sat unsigned short _Fract, _Sat unsigned _Fract, _Sat unsigned long _Fract, _Sat unsigned long long _Fract, short _Accum, _Accum, long _Accum, long long _Accum, unsigned short _Accum, unsigned _Accum, unsigned long _Accum, unsigned long long _Accum, _Sat short _Accum, _Sat _Accum, _Sat long _Accum, _Sat long long _Accum, _Sat unsigned short _Accum, _Sat unsigned _Accum, _Sat
unsigned long _Accum, _Sat unsigned long long _Accum.
Fixed-point data values contain fractional and optional integral parts. The format of fixed-point data varies and depends on the target machine.
Support for fixed-point types includes:
++, --)+, -, !)+, -, *, /)<<, >>)<, <=, >=, >)==, !=)+=, -=, *=, /=, <<=, >>=)Use a suffix in a fixed-point literal constant:
short _Fract and _Sat short _Fract_Fract and _Sat _Fractlong _Fract and _Sat long _Fractlong long _Fract and _Sat long long _Fractunsigned short _Fract and _Sat unsigned short _Fractunsigned _Fract and _Sat unsigned _Fractunsigned long _Fract and _Sat unsigned long _Fractunsigned long long _Fract and _Sat unsigned long long _Fractshort _Accum and _Sat short _Accum_Accum and _Sat _Accumlong _Accum and _Sat long _Accumlong long _Accum and _Sat long long _Accumunsigned short _Accum and _Sat unsigned short _Accumunsigned _Accum and _Sat unsigned _Accumunsigned long _Accum and _Sat unsigned long _Accumunsigned long long _Accum and _Sat unsigned long long _AccumGCC support of fixed-point types as specified by the draft technical report is incomplete:
Fixed-point types are supported by the DWARF debug information format.
Next: Named Address Spaces, Previous: Hex Floats, Up: C Extensions [Contents][Index]