aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2013-08-31 20:33:37 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2013-08-31 20:33:37 +0000
commite639f2570602ce452ae8a30cd634dc6a23bff1f1 (patch)
treeb185bfca3a7267405d36ba66236fe4404ce8017b /contrib/gcc
parentf27d53b8f2d953d8902eed32754f6493d58f16a2 (diff)
downloadsrc-e639f2570602ce452ae8a30cd634dc6a23bff1f1.tar.gz
src-e639f2570602ce452ae8a30cd634dc6a23bff1f1.zip
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
Notes
Notes: svn path=/head/; revision=255107
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/ChangeLog.gcc436
-rw-r--r--contrib/gcc/doc/extend.texi23
2 files changed, 29 insertions, 0 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43
index 3f893ac6bbc0..05f01073d945 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 d7a1494eebcc..d27af1083a41 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