summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/random.h
diff options
context:
space:
mode:
authordrepper <drepper@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-26 13:10:26 +0000
committerdrepper <drepper@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-26 13:10:26 +0000
commit57cfd4fb9a049e97dae1f4a4f690a9b420c7a690 (patch)
treed5c233ccf0c5f5286596adc884901cd6d3f6a413 /libstdc++-v3/include/bits/random.h
parent3f4257112ebaa98abb97d3170ad95eafd8998261 (diff)
downloadppe42-gcc-57cfd4fb9a049e97dae1f4a4f690a9b420c7a690.tar.gz
ppe42-gcc-57cfd4fb9a049e97dae1f4a4f690a9b420c7a690.zip
2012-09-26 Ulrich Drepper <drepper@gmail.com>
Optimize bulk mode for normal_distribution<double> for SSE3. * configure.host: Define cpu_opt_bits_random. * configure.ac: Substitute CPU_OPT_BITS_RANDOM. * include/Makefile.am (bits_headers): Add ${bits_host_headers}. (bits_host_headers): Define. * include/bits/random.tcc: Move __details::_Power_of_2 to... * include/bits/random.h: ...here. * include/std/random: Include <bits/opt_random.h>. * config/cpu/i486/opt/bits/opt_random.h: New file. * config/cpu/generic/opt/bits/opt_random.h: New file. * configure: Regenerated. * Makefile.in: Regenerated. * aclocal.m4: Regenerated. * doc/Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * libsupc++/Makefile.in: Regenerated. * po/Makefile.in: Regenerated. * python/Makefile.in: Regenerated. * src/Makefile.in: Regenerated. * src/c++11/Makefile.in: Regenerated. * src/c++98/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * config/cpu/generic/opt/ext/opt_random.h: Fix comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191758 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/random.h')
-rw-r--r--libstdc++-v3/include/bits/random.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index e9b99718f97..3db6916ad96 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -149,6 +149,14 @@ _GLIBCXX_END_NAMESPACE_VERSION
__mod(_Tp __x)
{ return _Mod<_Tp, __m, __a, __c>::__calc(__x); }
+ /* Determine whether number is a power of 2. */
+ template<typename _Tp>
+ inline bool
+ _Power_of_2(_Tp __x)
+ {
+ return ((__x - 1) & __x) == 0;
+ };
+
/*
* An adaptor class for converting the output of any Generator into
* the input for a specific Distribution.
OpenPOWER on IntegriCloud