| 1 |
From 29384815fb74ddfa90007f9ffede77be45e9a0fd Mon Sep 17 00:00:00 2001
|
| 2 |
From: Davide Pesavento <davidepesa@gmail.com>
|
| 3 |
Date: Thu, 14 Jun 2012 00:44:43 +0200
|
| 4 |
Subject: [PATCH] Fix qatomic inline asm for x32 ABI.
|
| 5 |
|
| 6 |
Drop the 'q' suffix from x86_64 asm instructions. It's not needed,
|
| 7 |
because the assembler can automatically determine the proper size
|
| 8 |
based on the target, and it is in fact causing compilation failures
|
| 9 |
on x32.
|
| 10 |
|
| 11 |
Change-Id: Ie6ff3ddf352a63bc490acce97a3019ce2e48dc70
|
| 12 |
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| 13 |
---
|
| 14 |
src/corelib/arch/qatomic_x86_64.h | 6 +++---
|
| 15 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
| 16 |
|
| 17 |
diff --git a/src/corelib/arch/qatomic_x86_64.h b/src/corelib/arch/qatomic_x86_64.h
|
| 18 |
index c2627c8..dc78140 100644
|
| 19 |
--- a/src/corelib/arch/qatomic_x86_64.h
|
| 20 |
+++ b/src/corelib/arch/qatomic_x86_64.h
|
| 21 |
@@ -170,7 +170,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValu
|
| 22 |
{
|
| 23 |
unsigned char ret;
|
| 24 |
asm volatile("lock\n"
|
| 25 |
- "cmpxchgq %3,%2\n"
|
| 26 |
+ "cmpxchg %3,%2\n"
|
| 27 |
"sete %1\n"
|
| 28 |
: "=a" (newValue), "=qm" (ret), "+m" (_q_value)
|
| 29 |
: "r" (newValue), "0" (expectedValue)
|
| 30 |
@@ -181,7 +181,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValu
|
| 31 |
template <typename T>
|
| 32 |
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
|
| 33 |
{
|
| 34 |
- asm volatile("xchgq %0,%1"
|
| 35 |
+ asm volatile("xchg %0,%1"
|
| 36 |
: "=r" (newValue), "+m" (_q_value)
|
| 37 |
: "0" (newValue)
|
| 38 |
: "memory");
|
| 39 |
@@ -192,7 +192,7 @@ template <typename T>
|
| 40 |
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
|
| 41 |
{
|
| 42 |
asm volatile("lock\n"
|
| 43 |
- "xaddq %0,%1"
|
| 44 |
+ "xadd %0,%1"
|
| 45 |
: "=r" (valueToAdd), "+m" (_q_value)
|
| 46 |
: "0" (valueToAdd * sizeof(T))
|
| 47 |
: "memory");
|
| 48 |
--
|
| 49 |
1.7.10
|
| 50 |
|