From 733b5d5ae2c5d625211e2985ac25728ac3f54883 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 21 Mar 2016 15:45:20 +0900 Subject: Imported Upstream version 1.58.0 Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak --- boost/atomic/detail/ops_gcc_x86_dcas.hpp | 40 +++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'boost/atomic/detail/ops_gcc_x86_dcas.hpp') diff --git a/boost/atomic/detail/ops_gcc_x86_dcas.hpp b/boost/atomic/detail/ops_gcc_x86_dcas.hpp index 5e005359b5..a6109f926c 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 -- cgit v1.2.3