summaryrefslogtreecommitdiff
path: root/boost/atomic/detail
diff options
context:
space:
mode:
Diffstat (limited to 'boost/atomic/detail')
-rw-r--r--boost/atomic/detail/config.hpp15
-rw-r--r--boost/atomic/detail/ops_gcc_alpha.hpp48
-rw-r--r--boost/atomic/detail/ops_gcc_arm.hpp48
-rw-r--r--boost/atomic/detail/ops_gcc_ppc.hpp36
-rw-r--r--boost/atomic/detail/ops_gcc_x86.hpp24
-rw-r--r--boost/atomic/detail/ops_gcc_x86_dcas.hpp40
6 files changed, 125 insertions, 86 deletions
diff --git a/boost/atomic/detail/config.hpp b/boost/atomic/detail/config.hpp
index d03ec6a..6b0e418 100644
--- a/boost/atomic/detail/config.hpp
+++ b/boost/atomic/detail/config.hpp
@@ -21,4 +21,19 @@
#pragma once
#endif
+#if defined(__CUDACC__)
+// nvcc does not support alternatives in asm statement constraints
+#define BOOST_ATOMIC_DETAIL_NO_ASM_CONSTRAINT_ALTERNATIVES
+// nvcc does not support condition code register ("cc") clobber in asm statements
+#define BOOST_ATOMIC_DETAIL_NO_ASM_CLOBBER_CC
+#endif
+
+#if !defined(BOOST_ATOMIC_DETAIL_NO_ASM_CLOBBER_CC)
+#define BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC "cc"
+#define BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "cc",
+#else
+#define BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
+#define BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA
+#endif
+
#endif // BOOST_ATOMIC_DETAIL_CONFIG_HPP_INCLUDED_
diff --git a/boost/atomic/detail/ops_gcc_alpha.hpp b/boost/atomic/detail/ops_gcc_alpha.hpp
index d17c61d..6978c7f 100644
--- a/boost/atomic/detail/ops_gcc_alpha.hpp
+++ b/boost/atomic/detail/ops_gcc_alpha.hpp
@@ -123,7 +123,7 @@ struct operations< 4u, Signed > :
"=&r" (tmp) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -150,7 +150,7 @@ struct operations< 4u, Signed > :
"=&r" (current), // %2
"=&r" (success) // %3
: "m" (storage) // %4
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
if (success)
fence_after(success_order);
@@ -188,7 +188,7 @@ struct operations< 4u, Signed > :
"=&r" (success) // %3
: "m" (storage), // %4
"r" (desired) // %5
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
if (success)
fence_after(success_order);
@@ -217,7 +217,7 @@ struct operations< 4u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -243,7 +243,7 @@ struct operations< 4u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -269,7 +269,7 @@ struct operations< 4u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -295,7 +295,7 @@ struct operations< 4u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -321,7 +321,7 @@ struct operations< 4u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -372,7 +372,7 @@ struct operations< 1u, false > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -399,7 +399,7 @@ struct operations< 1u, false > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -434,7 +434,7 @@ struct operations< 1u, true > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -461,7 +461,7 @@ struct operations< 1u, true > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -497,7 +497,7 @@ struct operations< 2u, false > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -524,7 +524,7 @@ struct operations< 2u, false > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -559,7 +559,7 @@ struct operations< 2u, true > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -586,7 +586,7 @@ struct operations< 2u, true > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -634,7 +634,7 @@ struct operations< 8u, Signed > :
"=&r" (tmp) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -661,7 +661,7 @@ struct operations< 8u, Signed > :
"=&r" (current), // %2
"=&r" (success) // %3
: "m" (storage) // %4
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
if (success)
fence_after(success_order);
@@ -699,7 +699,7 @@ struct operations< 8u, Signed > :
"=&r" (success) // %3
: "m" (storage), // %4
"r" (desired) // %5
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
if (success)
fence_after(success_order);
@@ -728,7 +728,7 @@ struct operations< 8u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -754,7 +754,7 @@ struct operations< 8u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -780,7 +780,7 @@ struct operations< 8u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -806,7 +806,7 @@ struct operations< 8u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -832,7 +832,7 @@ struct operations< 8u, Signed > :
"=&r" (modified) // %1
: "m" (storage), // %2
"r" (v) // %3
- :
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
diff --git a/boost/atomic/detail/ops_gcc_arm.hpp b/boost/atomic/detail/ops_gcc_arm.hpp
index 29e1e5a..a28da69 100644
--- a/boost/atomic/detail/ops_gcc_arm.hpp
+++ b/boost/atomic/detail/ops_gcc_arm.hpp
@@ -187,7 +187,7 @@ struct operations< 4u, Signed > :
BOOST_ATOMIC_DETAIL_ARM_ASM_END(%[tmp])
: [tmp] "=&l" (tmp), [original] "=&r" (original), [storage] "+Q" (storage)
: [value] "r" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -216,7 +216,7 @@ struct operations< 4u, Signed > :
[storage] "+Q" (storage) // %3
: [expected] "r" (expected), // %4
[desired] "r" (desired) // %5
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
if (success)
fence_after(success_order);
@@ -252,7 +252,7 @@ struct operations< 4u, Signed > :
[storage] "+Q" (storage) // %3
: [expected] "r" (expected), // %4
[desired] "r" (desired) // %5
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
if (success)
fence_after(success_order);
@@ -282,7 +282,7 @@ struct operations< 4u, Signed > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -308,7 +308,7 @@ struct operations< 4u, Signed > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -334,7 +334,7 @@ struct operations< 4u, Signed > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -360,7 +360,7 @@ struct operations< 4u, Signed > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -386,7 +386,7 @@ struct operations< 4u, Signed > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -437,7 +437,7 @@ struct operations< 1u, false > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -464,7 +464,7 @@ struct operations< 1u, false > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -499,7 +499,7 @@ struct operations< 1u, true > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -526,7 +526,7 @@ struct operations< 1u, true > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -562,7 +562,7 @@ struct operations< 2u, false > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -589,7 +589,7 @@ struct operations< 2u, false > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -624,7 +624,7 @@ struct operations< 2u, true > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -651,7 +651,7 @@ struct operations< 2u, true > :
[tmp] "=&l" (tmp), // %2
[storage] "+Q" (storage) // %3
: [value] "r" (v) // %4
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -718,7 +718,7 @@ struct operations< 8u, Signed > :
"=&r" (original) // %1
: "r" (v), // %2
"r" (&storage) // %3
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
fence_after(order);
return original;
@@ -748,7 +748,7 @@ struct operations< 8u, Signed > :
"+r" (old_val) // %2
: "r" (&storage), // %3
"r" (desired) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
const uint32_t success = (uint32_t)old_val;
if (success)
@@ -787,7 +787,7 @@ struct operations< 8u, Signed > :
"+r" (old_val) // %2
: "r" (&storage), // %3
"r" (desired) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
const uint32_t success = (uint32_t)old_val;
if (success)
@@ -819,7 +819,7 @@ struct operations< 8u, Signed > :
"=&r" (result) // %2
: "r" (&storage), // %3
"r" (v) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
fence_after(order);
return original;
@@ -846,7 +846,7 @@ struct operations< 8u, Signed > :
"=&r" (result) // %2
: "r" (&storage), // %3
"r" (v) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
fence_after(order);
return original;
@@ -873,7 +873,7 @@ struct operations< 8u, Signed > :
"=&r" (result) // %2
: "r" (&storage), // %3
"r" (v) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
fence_after(order);
return original;
@@ -900,7 +900,7 @@ struct operations< 8u, Signed > :
"=&r" (result) // %2
: "r" (&storage), // %3
"r" (v) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
fence_after(order);
return original;
@@ -927,7 +927,7 @@ struct operations< 8u, Signed > :
"=&r" (result) // %2
: "r" (&storage), // %3
"r" (v) // %4
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
fence_after(order);
return original;
diff --git a/boost/atomic/detail/ops_gcc_ppc.hpp b/boost/atomic/detail/ops_gcc_ppc.hpp
index 1a1fbb7..8698ee8 100644
--- a/boost/atomic/detail/ops_gcc_ppc.hpp
+++ b/boost/atomic/detail/ops_gcc_ppc.hpp
@@ -227,7 +227,7 @@ struct operations< 4u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -246,7 +246,7 @@ struct operations< 4u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -265,7 +265,7 @@ struct operations< 4u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -284,7 +284,7 @@ struct operations< 4u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -303,7 +303,7 @@ struct operations< 4u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -347,7 +347,7 @@ struct operations< 1u, false > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -367,7 +367,7 @@ struct operations< 1u, false > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -395,7 +395,7 @@ struct operations< 1u, true > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -415,7 +415,7 @@ struct operations< 1u, true > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -444,7 +444,7 @@ struct operations< 2u, false > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -464,7 +464,7 @@ struct operations< 2u, false > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -492,7 +492,7 @@ struct operations< 2u, true > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -512,7 +512,7 @@ struct operations< 2u, true > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -640,7 +640,7 @@ struct operations< 8u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -659,7 +659,7 @@ struct operations< 8u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -678,7 +678,7 @@ struct operations< 8u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -697,7 +697,7 @@ struct operations< 8u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
@@ -716,7 +716,7 @@ struct operations< 8u, Signed > :
"bne- 1b\n"
: "=&b" (original), "=&b" (tmp), "+Z" (storage)
: "b" (v)
- : "cc"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC
);
fence_after(order);
return original;
diff --git a/boost/atomic/detail/ops_gcc_x86.hpp b/boost/atomic/detail/ops_gcc_x86.hpp
index f18227f..6e60045 100644
--- a/boost/atomic/detail/ops_gcc_x86.hpp
+++ b/boost/atomic/detail/ops_gcc_x86.hpp
@@ -123,7 +123,7 @@ struct operations< 1u, Signed > :
"lock; xaddb %0, %1"
: "+q" (v), "+m" (storage)
:
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return v;
}
@@ -151,7 +151,7 @@ struct operations< 1u, Signed > :
"sete %2"
: "+a" (previous), "+m" (storage), "=q" (success)
: "q" (desired)
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
expected = previous;
return success;
@@ -168,7 +168,7 @@ struct operations< 1u, Signed > :
"jne 1b"\
: [res] "+a" (result), [storage] "+m" (storage)\
: [arg] "q" (argument)\
- : "cc", BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
)
static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
@@ -209,7 +209,7 @@ struct operations< 2u, Signed > :
"lock; xaddw %0, %1"
: "+q" (v), "+m" (storage)
:
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return v;
}
@@ -237,7 +237,7 @@ struct operations< 2u, Signed > :
"sete %2"
: "+a" (previous), "+m" (storage), "=q" (success)
: "q" (desired)
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
expected = previous;
return success;
@@ -254,7 +254,7 @@ struct operations< 2u, Signed > :
"jne 1b"\
: [res] "+a" (result), [storage] "+m" (storage)\
: [arg] "q" (argument)\
- : "cc", BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
)
static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
@@ -295,7 +295,7 @@ struct operations< 4u, Signed > :
"lock; xaddl %0, %1"
: "+r" (v), "+m" (storage)
:
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return v;
}
@@ -323,7 +323,7 @@ struct operations< 4u, Signed > :
"sete %2"
: "+a" (previous), "+m" (storage), "=q" (success)
: "r" (desired)
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
expected = previous;
return success;
@@ -340,7 +340,7 @@ struct operations< 4u, Signed > :
"jne 1b"\
: [res] "+a" (result), [storage] "+m" (storage)\
: [arg] "r" (argument)\
- : "cc", BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
)
static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
@@ -391,7 +391,7 @@ struct operations< 8u, Signed > :
"lock; xaddq %0, %1"
: "+r" (v), "+m" (storage)
:
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return v;
}
@@ -419,7 +419,7 @@ struct operations< 8u, Signed > :
"sete %2"
: "+a" (previous), "+m" (storage), "=q" (success)
: "r" (desired)
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
expected = previous;
return success;
@@ -436,7 +436,7 @@ struct operations< 8u, Signed > :
"jne 1b"\
: [res] "+a" (result), [storage] "+m" (storage)\
: [arg] "r" (argument)\
- : "cc", BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA BOOST_ATOMIC_DETAIL_TEMP_CAS_REGISTER, "memory"\
)
static BOOST_FORCEINLINE storage_type fetch_and(storage_type volatile& storage, storage_type v, memory_order) BOOST_NOEXCEPT
diff --git a/boost/atomic/detail/ops_gcc_x86_dcas.hpp b/boost/atomic/detail/ops_gcc_x86_dcas.hpp
index 5e00535..a6109f9 100644
--- a/boost/atomic/detail/ops_gcc_x86_dcas.hpp
+++ b/boost/atomic/detail/ops_gcc_x86_dcas.hpp
@@ -80,9 +80,14 @@ struct gcc_dcas_x86
"1: lock; cmpxchg8b 0(%[dest])\n\t"
"jne 1b\n\t"
"movl %[scratch], %%ebx"
+#if !defined(BOOST_ATOMIC_DETAIL_NO_ASM_CONSTRAINT_ALTERNATIVES)
: [scratch] "=m,m" (scratch)
: [value_lo] "a,a" ((uint32_t)v), "c,c" ((uint32_t)(v >> 32)), [dest] "D,S" (&storage)
- : "cc", "edx", "memory"
+#else
+ : [scratch] "=m" (scratch)
+ : [value_lo] "a" ((uint32_t)v), "c" ((uint32_t)(v >> 32)), [dest] "D" (&storage)
+#endif
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "edx", "memory"
);
#else
__asm__ __volatile__
@@ -93,8 +98,12 @@ struct gcc_dcas_x86
"1: lock; cmpxchg8b 0(%[dest])\n\t"
"jne 1b\n\t"
:
+#if !defined(BOOST_ATOMIC_DETAIL_NO_ASM_CONSTRAINT_ALTERNATIVES)
: [value_lo] "b,b" ((uint32_t)v), "c,c" ((uint32_t)(v >> 32)), [dest] "D,S" (&storage)
- : "cc", "eax", "edx", "memory"
+#else
+ : [value_lo] "b" ((uint32_t)v), "c" ((uint32_t)(v >> 32)), [dest] "D" (&storage)
+#endif
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "eax", "edx", "memory"
);
#endif
}
@@ -146,7 +155,7 @@ struct gcc_dcas_x86
"lock; cmpxchg8b %[storage]"
: "=&A" (value)
: [storage] "m" (storage)
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
#endif
}
@@ -183,9 +192,14 @@ struct gcc_dcas_x86
"lock; cmpxchg8b %[dest]\n\t"
"movl %[scratch], %%ebx\n\t"
"sete %[success]"
+#if !defined(BOOST_ATOMIC_DETAIL_NO_ASM_CONSTRAINT_ALTERNATIVES)
: "+A,A,A,A,A,A" (expected), [dest] "+m,m,m,m,m,m" (storage), [scratch] "=m,m,m,m,m,m" (scratch), [success] "=q,m,q,m,q,m" (success)
: [desired_lo] "S,S,D,D,m,m" ((uint32_t)desired), "c,c,c,c,c,c" ((uint32_t)(desired >> 32))
- : "cc", "memory"
+#else
+ : "+A" (expected), [dest] "+m" (storage), [scratch] "=m" (scratch), [success] "=q" (success)
+ : [desired_lo] "S" ((uint32_t)desired), "c" ((uint32_t)(desired >> 32))
+#endif
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return success;
#else
@@ -194,9 +208,14 @@ struct gcc_dcas_x86
(
"lock; cmpxchg8b %[dest]\n\t"
"sete %[success]"
+#if !defined(BOOST_ATOMIC_DETAIL_NO_ASM_CONSTRAINT_ALTERNATIVES)
: "+A,A" (expected), [dest] "+m,m" (storage), [success] "=q,m" (success)
: "b,b" ((uint32_t)desired), "c,c" ((uint32_t)(desired >> 32))
- : "cc", "memory"
+#else
+ : "+A" (expected), [dest] "+m" (storage), [success] "=q" (success)
+ : "b" ((uint32_t)desired), "c" ((uint32_t)(desired >> 32))
+#endif
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return success;
#endif
@@ -235,7 +254,7 @@ struct gcc_dcas_x86_64
"jne 1b"
:
: "b" (p_value[0]), "c" (p_value[1]), [dest] "r" (&storage)
- : "cc", "rax", "rdx", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "rax", "rdx", "memory"
);
}
@@ -257,7 +276,7 @@ struct gcc_dcas_x86_64
"lock; cmpxchg16b %[storage]"
: "=&A" (value)
: [storage] "m" (storage)
- : "cc", "memory"
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return value;
@@ -279,9 +298,14 @@ struct gcc_dcas_x86_64
(
"lock; cmpxchg16b %[dest]\n\t"
"sete %[success]"
+#if !defined(BOOST_ATOMIC_DETAIL_NO_ASM_CONSTRAINT_ALTERNATIVES)
: "+A,A" (expected), [dest] "+m,m" (storage), [success] "=q,m" (success)
: "b,b" (p_desired[0]), "c,c" (p_desired[1])
- : "cc", "memory"
+#else
+ : "+A" (expected), [dest] "+m" (storage), [success] "=q" (success)
+ : "b" (p_desired[0]), "c" (p_desired[1])
+#endif
+ : BOOST_ATOMIC_DETAIL_ASM_CLOBBER_CC_COMMA "memory"
);
return success;
#endif