From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html (limited to 'libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html') diff --git a/libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html b/libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html new file mode 100644 index 000000000..4350e20b1 --- /dev/null +++ b/libstdc++-v3/doc/html/manual/bk01pt03ch28s02.html @@ -0,0 +1,41 @@ + + +Implementation

The functions for atomic operations described above are either +implemented via compiler intrinsics (if the underlying host is +capable) or by library fallbacks.

Compiler intrinsics (builtins) are always preferred. However, as +the compiler builtins for atomics are not universally implemented, +using them directly is problematic, and can result in undefined +function calls. (An example of an undefined symbol from the use +of __sync_fetch_and_add on an unsupported host is a +missing reference to __sync_fetch_and_add_4.) +

In addition, on some hosts the compiler intrinsics are enabled +conditionally, via the -march command line flag. This makes +usage vary depending on the target hardware and the flags used during +compile. +

+If builtins are possible for bool-sized integral types, +_GLIBCXX_ATOMIC_BUILTINS_1 will be defined. +If builtins are possible for int-sized integral types, +_GLIBCXX_ATOMIC_BUILTINS_4 will be defined. +

For the following hosts, intrinsics are enabled by default. +

For others, some form of -march may work. On +non-ancient x86 hardware, -march=native usually does the +trick.

For hosts without compiler intrinsics, but with capable +hardware, hand-crafted assembly is selected. This is the case for the following hosts: +

And for the rest, a simulated atomic lock via pthreads. +

Detailed information about compiler intrinsics for atomic operations can be found in the GCC documentation. +

More details on the library fallbacks from the porting section. +

-- cgit v1.2.3