summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Pesavento <davidepesa@gmail.com>2012-06-13 22:44:43 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-06-19 07:41:50 (GMT)
commit29384815fb74ddfa90007f9ffede77be45e9a0fd (patch)
treecc23940c1f8d38191cb0afaea5cfdc862986212c
parentf3f695ebcffcb69c0ae643757382442730e8b9d2 (diff)
downloadQt-29384815fb74ddfa90007f9ffede77be45e9a0fd.zip
Qt-29384815fb74ddfa90007f9ffede77be45e9a0fd.tar.gz
Qt-29384815fb74ddfa90007f9ffede77be45e9a0fd.tar.bz2
Fix qatomic inline asm for x32 ABI.
Drop the 'q' suffix from x86_64 asm instructions. It's not needed, because the assembler can automatically determine the proper size based on the target, and it is in fact causing compilation failures on x32. Change-Id: Ie6ff3ddf352a63bc490acce97a3019ce2e48dc70 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/arch/qatomic_x86_64.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/arch/qatomic_x86_64.h b/src/corelib/arch/qatomic_x86_64.h
index c2627c8..dc78140 100644
--- a/src/corelib/arch/qatomic_x86_64.h
+++ b/src/corelib/arch/qatomic_x86_64.h
@@ -170,7 +170,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValu
{
unsigned char ret;
asm volatile("lock\n"
- "cmpxchgq %3,%2\n"
+ "cmpxchg %3,%2\n"
"sete %1\n"
: "=a" (newValue), "=qm" (ret), "+m" (_q_value)
: "r" (newValue), "0" (expectedValue)
@@ -181,7 +181,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValu
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
{
- asm volatile("xchgq %0,%1"
+ asm volatile("xchg %0,%1"
: "=r" (newValue), "+m" (_q_value)
: "0" (newValue)
: "memory");
@@ -192,7 +192,7 @@ template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
{
asm volatile("lock\n"
- "xaddq %0,%1"
+ "xadd %0,%1"
: "=r" (valueToAdd), "+m" (_q_value)
: "0" (valueToAdd * sizeof(T))
: "memory");