diff options
author | pfg <pfg@FreeBSD.org> | 2013-08-31 20:33:37 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-08-31 20:33:37 +0000 |
commit | f95e394e35406c2782ecb7801ea1535558f8c464 (patch) | |
tree | b185bfca3a7267405d36ba66236fe4404ce8017b /contrib/gcc | |
parent | 2dccc06e8ea8317ec73c70e6062b6efb70dbbbc5 (diff) | |
download | FreeBSD-src-f95e394e35406c2782ecb7801ea1535558f8c464.zip FreeBSD-src-f95e394e35406c2782ecb7801ea1535558f8c464.tar.gz |
Add support for the GCC binary integer constants extension.
This is required to build the i965 backend with newer versions of mesa.
Original patch from Joerg Wunsch in GCC Bug 23479, under the GPLv2;
also taken from there in OpenBSD.
Obtained from: gcc 4.3 (rev. 125346; GPLv2)
MFC after: 5 days
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/ChangeLog.gcc43 | 6 | ||||
-rw-r--r-- | contrib/gcc/doc/extend.texi | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43 index 3f893ac..05f0107 100644 --- a/contrib/gcc/ChangeLog.gcc43 +++ b/contrib/gcc/ChangeLog.gcc43 @@ -1,3 +1,9 @@ +2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> (r23479) + + PR preprocessor/23479 + * doc/extend.texi: Document the 0b-prefixed binary integer + constant extension. + 2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r124341) * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of diff --git a/contrib/gcc/doc/extend.texi b/contrib/gcc/doc/extend.texi index d7a1494..d27af10 100644 --- a/contrib/gcc/doc/extend.texi +++ b/contrib/gcc/doc/extend.texi @@ -81,6 +81,7 @@ extensions, accepted by GCC in C89 mode and in C++. * Pragmas:: Pragmas accepted by GCC. * Unnamed Fields:: Unnamed struct/union fields within structs/unions. * Thread-Local:: Per-thread variables. +* Binary constants:: Binary constants using the @samp{0b} prefix. @end menu @node Statement Exprs @@ -10424,6 +10425,28 @@ Non-@code{static} members shall not be @code{__thread}. @end quotation @end itemize +@node Binary constants +@section Binary constants using the @samp{0b} prefix +@cindex Binary constants using the @samp{0b} prefix + +Integer constants can be written as binary constants, consisting of a +sequence of @samp{0} and @samp{1} digits, prefixed by @samp{0b} or +@samp{0B}. This is particularly useful in environments that operate a +lot on the bit-level (like microcontrollers). + +The following statements are identical: + +@smallexample +i = 42; +i = 0x2a; +i = 052; +i = 0b101010; +@end smallexample + +The type of these constants follows the same rules as for octal or +hexadecimal integer constants, so suffixes like @samp{L} or @samp{UL} +can be applied. + @node C++ Extensions @chapter Extensions to the C++ Language @cindex extensions, C++ language |