diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-01-18 15:38:16 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-24 01:08:31 +0100 |
commit | 835a2b9902346600cdc2d6b1f2dd2282e804bf4a (patch) | |
tree | 227a88f076a7f392349072ab2a721b85882a6368 /src/corelib/arch/qatomic_x86_64.h | |
parent | ba660ea7548d86147afe30f314f67527c22c267b (diff) |
Make clang compile the new i386 and x86_64 atomic code
The input type needs to match the output type, otherwise we get this
error:
src/corelib/arch/qatomic_x86_64.h:288:25: error: unsupported inline asm:
input with type '<dependent type>' matching output with type 'T':
"0" (valueToAdd * QAtomicAdditiveType<T>::AddScale)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: I26d4efdbcab089dea71ef08e3e65df5b7482865a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/arch/qatomic_x86_64.h')
-rw-r--r-- | src/corelib/arch/qatomic_x86_64.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/arch/qatomic_x86_64.h b/src/corelib/arch/qatomic_x86_64.h index 342cd12294..db334700b2 100644 --- a/src/corelib/arch/qatomic_x86_64.h +++ b/src/corelib/arch/qatomic_x86_64.h @@ -284,7 +284,7 @@ T QBasicAtomicOps<size>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiv asm volatile("lock\n" "xadd %0,%1" : "=r" (result), "+m" (_q_value) - : "0" (valueToAdd * QAtomicAdditiveType<T>::AddScale) + : "0" (T(valueToAdd * QAtomicAdditiveType<T>::AddScale)) : "memory"); return result; } @@ -296,7 +296,7 @@ T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy asm volatile("lock\n" "xadd %0,%1" : "=q" (result), "+m" (_q_value) - : "0" (valueToAdd * QAtomicAdditiveType<T>::AddScale) + : "0" (T(valueToAdd * QAtomicAdditiveType<T>::AddScale)) : "memory"); return result; } |