//@cond
void operator ()() const CDS_NOEXCEPT
{
-# ifdef CDS_backoff_pause_defined
- platform::backoff_pause();
+# ifdef CDS_backoff_hint_defined
+ platform::backoff_hint();
# endif
}
# include <cds/compiler/gcc/sparc/backoff.h>
# elif CDS_PROCESSOR_ARCH == CDS_PROCESSOR_PPC64
# include <cds/compiler/gcc/ppc64/backoff.h>
-//# elif CDS_PROCESSOR_ARCH == CDS_PROCESSOR_ARM7
-//# include <cds/compiler/gcc/arm7/backoff.h>
+# elif CDS_PROCESSOR_ARCH == CDS_PROCESSOR_ARM7
+# include <cds/compiler/gcc/arm7/backoff.h>
+# elif CDS_PROCESSOR_ARCH == CDS_PROCESSOR_ARM8
+# include <cds/compiler/gcc/arm8/backoff.h>
# endif
#else
# error "Undefined compiler"
#ifndef CDSLIB_COMPILER_CLANG_DEFS_H
#define CDSLIB_COMPILER_CLANG_DEFS_H
-/*
- Known issues:
- Error compiling 64bit boost.atomic on clang 3.4 - 3.5, see https://svn.boost.org/trac/boost/ticket/9610
- Solution: use boost 1.56 +
-*/
-
// Compiler version
#define CDS_COMPILER_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#define CDS_COMPILER__NAME ("clang " __clang_version__)
#define CDS_COMPILER__NICK "clang"
-#if CDS_COMPILER_VERSION < 30300
-# error "Compiler version error. Clang version 3.3.0 and above is supported"
+#if CDS_COMPILER_VERSION < 30600
+# error "Compiler version error. Clang version 3.6.0 and above is supported"
#endif
#if defined(_LIBCPP_VERSION) && !defined(CDS_USE_BOOST_ATOMIC) && CDS_COMPILER_VERSION < 30700
namespace cds { namespace backoff {
namespace gcc { namespace amd64 {
-# define CDS_backoff_pause_defined
- static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
- {
- asm volatile (
- "andl %[nLoop], %%ecx; \n\t"
- "cmovzl %[nLoop], %%ecx; \n\t"
- "rep; "
- "nop; \n\t"
- : /*no output*/
- : [nLoop] "r" (nLoop)
- : "ecx", "cc"
- );
- }
-
# define CDS_backoff_nop_defined
static inline void backoff_nop()
{
asm volatile ( "nop;" );
}
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
+ {
+ asm volatile ( "pause;" );
+ }
+
+
}} // namespace gcc::amd64
namespace platform {
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSLIB_COMPILER_GCC_ARM7_BACKOFF_H
+#define CDSLIB_COMPILER_GCC_ARM7_BACKOFF_H
+
+//@cond none
+
+namespace cds { namespace backoff {
+ namespace gcc { namespace arm7 {
+
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
+ {
+ asm volatile( "yield" ::: "memory" );
+ }
+ }} // namespace gcc::arm7
+
+ namespace platform {
+ using namespace gcc::arm7;
+ }
+}} // namespace cds::backoff
+
+//@endcond
+#endif // #ifndef CDSLIB_COMPILER_GCC_ARM7_BACKOFF_H
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSLIB_COMPILER_GCC_ARM8_BACKOFF_H
+#define CDSLIB_COMPILER_GCC_ARM8_BACKOFF_H
+
+//@cond none
+
+namespace cds { namespace backoff {
+ namespace gcc { namespace arm8 {
+
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
+ {
+ asm volatile( "yield" ::: "memory" );
+ }
+ }} // namespace gcc::arm8
+
+ namespace platform {
+ using namespace gcc::arm8;
+ }
+}} // namespace cds::backoff
+
+//@endcond
+#endif // #ifndef CDSLIB_COMPILER_GCC_ARM8_BACKOFF_H
namespace cds { namespace backoff {
namespace gcc { namespace ia64 {
-# define CDS_backoff_pause_defined
- static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
- {
- asm volatile ( "hint @pause" );
- }
-
# define CDS_backoff_hint_defined
static inline void backoff_hint()
{
namespace cds { namespace backoff {
namespace gcc { namespace ppc64 {
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
+ {
+ // Provide a hint that performance will probably be improved
+ // if shared resources dedicated to the executing processor are released for use by other processors
+ asm volatile( "or 27,27,27 # yield" );
+ }
}} // namespace gcc::ppc64
namespace platform {
namespace cds { namespace backoff {
namespace gcc { namespace Sparc {
-# define CDS_backoff_pause_defined
- static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
- {}
-
# define CDS_backoff_nop_defined
static inline void backoff_nop()
{
namespace cds { namespace backoff {
namespace gcc { namespace x86 {
-# define CDS_backoff_pause_defined
- static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
- {
- asm volatile (
- "andl %[nLoop], %%ecx; \n\t"
- "cmovzl %[nLoop], %%ecx; \n\t"
- "rep; "
- "nop; \n\t"
- : /*no output*/
- : [nLoop] "r" (nLoop)
- : "ecx", "cc"
- );
- }
-
# define CDS_backoff_nop_defined
static inline void backoff_nop()
{
asm volatile ( "nop;" );
}
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
+ {
+ asm volatile ( "pause;" );
+ }
+
+
}} // namespace gcc::x86
namespace platform {
#define CDSLIB_COMPILER_VC_AMD64_BACKOFF_H
//@cond none
+#include <intrin.h>
namespace cds { namespace backoff {
namespace vc { namespace amd64 {
-# define CDS_backoff_pause_defined
- static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
{
- for ( unsigned int i = 0; i < nLoop; i++ )
- __nop();
+ _mm_pause();
}
# define CDS_backoff_nop_defined
#define CDSLIB_COMPILER_VC_X86_BACKOFF_H
//@cond none
+#include <intrin.h>
namespace cds { namespace backoff {
namespace vc { namespace x86 {
-# define CDS_backoff_pause_defined
- static inline void backoff_pause( unsigned int nLoop = 0x000003FF )
+# define CDS_backoff_hint_defined
+ static inline void backoff_hint()
{
- __asm {
- and ecx, nLoop;
- cmovz ecx, nLoop;
- rep nop;
- }
+ _mm_pause();
}
# define CDS_backoff_nop_defined
<ClInclude Include="..\..\..\cds\compiler\cxx11_atomic.h" />\r
<ClInclude Include="..\..\..\cds\compiler\feature_tsan.h" />\r
<ClInclude Include="..\..\..\cds\compiler\gcc\amd64\cxx11_atomic.h" />\r
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm7\backoff.h" />\r
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm8\backoff.h" />\r
<ClInclude Include="..\..\..\cds\compiler\gcc\compiler_macro.h" />\r
<ClInclude Include="..\..\..\cds\compiler\gcc\ia64\cxx11_atomic.h" />\r
<ClInclude Include="..\..\..\cds\compiler\gcc\sparc\cxx11_atomic.h" />\r
<Filter Include="Header Files\cds\container\impl">\r
<UniqueIdentifier>{0a2328b4-ff6f-4afb-8de0-9884ae172fa9}</UniqueIdentifier>\r
</Filter>\r
+ <Filter Include="Header Files\cds\compiler\gcc\arm7">\r
+ <UniqueIdentifier>{8f1fe8df-3837-42fd-a2f7-581aaf653c53}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Header Files\cds\compiler\gcc\arm8">\r
+ <UniqueIdentifier>{fb32845c-1b47-49d0-8065-4a0aa4b55d6d}</UniqueIdentifier>\r
+ </Filter>\r
</ItemGroup>\r
<ItemGroup>\r
<ClCompile Include="..\..\..\src\dllmain.cpp">\r
<ClInclude Include="..\..\..\cds\details\throw_exception.h">\r
<Filter>Header Files\cds\details</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm7\backoff.h">\r
+ <Filter>Header Files\cds\compiler\gcc\arm7</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm8\backoff.h">\r
+ <Filter>Header Files\cds\compiler\gcc\arm8</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
<ClInclude Include="..\..\..\cds\compiler\cxx11_atomic.h" />
<ClInclude Include="..\..\..\cds\compiler\feature_tsan.h" />
<ClInclude Include="..\..\..\cds\compiler\gcc\amd64\cxx11_atomic.h" />
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm7\backoff.h" />
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm8\backoff.h" />
<ClInclude Include="..\..\..\cds\compiler\gcc\compiler_macro.h" />
<ClInclude Include="..\..\..\cds\compiler\gcc\ia64\cxx11_atomic.h" />
<ClInclude Include="..\..\..\cds\compiler\gcc\sparc\cxx11_atomic.h" />
<Filter Include="Header Files\cds\container\impl">
<UniqueIdentifier>{0a2328b4-ff6f-4afb-8de0-9884ae172fa9}</UniqueIdentifier>
</Filter>
+ <Filter Include="Header Files\cds\compiler\gcc\arm8">
+ <UniqueIdentifier>{151e21e7-1535-430a-a7d1-676b93d8162c}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files\cds\compiler\gcc\arm7">
+ <UniqueIdentifier>{754f330c-8443-4012-b05b-41b3eba647f9}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\dllmain.cpp">
<ClInclude Include="..\..\..\cds\details\throw_exception.h">
<Filter>Header Files\cds\details</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm8\backoff.h">
+ <Filter>Header Files\cds\compiler\gcc\arm8</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\cds\compiler\gcc\arm7\backoff.h">
+ <Filter>Header Files\cds\compiler\gcc\arm7</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file