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>
This commit is contained in:
Bradley T. Hughes 2012-01-18 15:38:16 +01:00 committed by Qt by Nokia
parent ba660ea754
commit 835a2b9902
2 changed files with 4 additions and 4 deletions

View File

@ -258,7 +258,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;
}
@ -270,7 +270,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;
}

View File

@ -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;
}