diff options
-rw-r--r-- | src/corelib/arch/arch.pri | 2 | ||||
-rw-r--r-- | src/corelib/arch/qatomic_power.h (renamed from src/corelib/arch/qatomic_powerpc.h) | 16 | ||||
-rw-r--r-- | src/corelib/arch/qatomic_vxworks.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 21 | ||||
-rw-r--r-- | src/corelib/global/qprocessordetection.h | 16 | ||||
-rw-r--r-- | src/corelib/thread/qbasicatomic.h | 4 |
6 files changed, 36 insertions, 25 deletions
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri index c64bbe2821..c611087043 100644 --- a/src/corelib/arch/arch.pri +++ b/src/corelib/arch/arch.pri @@ -12,7 +12,7 @@ HEADERS += \ arch/qatomic_i386.h \ arch/qatomic_ia64.h \ arch/qatomic_mips.h \ - arch/qatomic_powerpc.h \ + arch/qatomic_power.h \ arch/qatomic_s390.h \ arch/qatomic_sh4a.h \ arch/qatomic_sparc.h \ diff --git a/src/corelib/arch/qatomic_powerpc.h b/src/corelib/arch/qatomic_power.h index 10f6e4c488..a531dfedc8 100644 --- a/src/corelib/arch/qatomic_powerpc.h +++ b/src/corelib/arch/qatomic_power.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QATOMIC_POWERPC_H -#define QATOMIC_POWERPC_H +#ifndef QATOMIC_POWER_H +#define QATOMIC_POWER_H #include <QtCore/qoldbasicatomic.h> @@ -105,13 +105,11 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree() #if defined(Q_CC_GNU) -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2) \ - || (!defined(__64BIT__) && !defined(__powerpc64__) && !defined(__ppc64__)) +#ifdef Q_PROCESSOR_POWER_32 # define _Q_VALUE "0, %[_q_value]" # define _Q_VALUE_MEMORY_OPERAND "+m" (_q_value) # define _Q_VALUE_REGISTER_OPERAND [_q_value] "r" (&_q_value), -#else -// On 64-bit with gcc >= 4.2 +#else // Q_PROCESSOR_POWER_64 # define _Q_VALUE "%y[_q_value]" # define _Q_VALUE_MEMORY_OPERAND [_q_value] "+Z" (_q_value) # define _Q_VALUE_REGISTER_OPERAND @@ -301,7 +299,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) return originalValue; } -#if defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__) +#ifdef Q_PROCESSOR_POWER_64 # define LPARX "ldarx" # define STPCX "stdcx." #else @@ -475,7 +473,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueTo #undef _Q_VALUE_REGISTER_OPERAND #else -# error "This compiler for PowerPC is not supported" +# error "This compiler for Power/PowerPC is not supported" #endif inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) @@ -515,4 +513,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QATOMIC_POWERPC_H +#endif // QATOMIC_POWER_H diff --git a/src/corelib/arch/qatomic_vxworks.h b/src/corelib/arch/qatomic_vxworks.h index dbec16a540..564a07f3ea 100644 --- a/src/corelib/arch/qatomic_vxworks.h +++ b/src/corelib/arch/qatomic_vxworks.h @@ -45,7 +45,7 @@ QT_BEGIN_HEADER #if defined(__ppc) -# include <QtCore/qatomic_powerpc.h> +# include <QtCore/qatomic_power.h> #else // generic implementation with taskLock() #include <QtCore/qoldbasicatomic.h> diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 44d44b2cdb..eea4397dcd 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1489,18 +1489,27 @@ bool qSharedBuild() */ /*! - \macro Q_PROCESSOR_POWERPC + \macro Q_PROCESSOR_POWER \relates <QtGlobal> - Defined if the application is compiled for PowerPC processors. Qt currently - supports one optional PowerPC variant: \l Q_PROCESSOR_POWERPC_64. + Defined if the application is compiled for POWER processors. Qt currently + supports two Power variants: \l Q_PROCESSOR_POWER_32 and \l + Q_PROCESSOR_POWER_64. */ /*! - \macro Q_PROCESSOR_POWERPC_64 + \macro Q_PROCESSOR_POWER_32 \relates <QtGlobal> - Defined if the application is compiled for 64-bit PowerPC processors. The - \l Q_PROCESSOR_POWERPC macro is also defined when Q_PROCESSOR_POWERPC_64 is + Defined if the application is compiled for 32-bit Power processors. The \l + Q_PROCESSOR_POWER macro is also defined when Q_PROCESSOR_POWER_32 is + defined. +*/ +/*! + \macro Q_PROCESSOR_POWER_64 + \relates <QtGlobal> + + Defined if the application is compiled for 64-bit Power processors. The \l + Q_PROCESSOR_POWER macro is also defined when Q_PROCESSOR_POWER_64 is defined. */ diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index 69815ba199..fd02f0e4c5 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -145,17 +145,21 @@ # endif /* - POWER family, optional variant: 64-bit + Power family, known variants: 32- and 64-bit There are many more known variants/revisions that we do not handle/detect. See http://en.wikipedia.org/wiki/Power_Architecture and http://en.wikipedia.org/wiki/File:PowerISA-evolution.svg */ -// #elif defined(__powerpc__) || defined(__ppc__) || defined(_M_MPPC) || defined(_M_PPC) -// # define Q_PROCESSOR_POWERPC -// # if defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__) -// # define Q_PROCESSOR_POWERPC_64 -// # endif +#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \ + || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \ + || defined(_M_MPPC) || defined(_M_PPC) +# define Q_PROCESSOR_POWER +# if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__) +# define Q_PROCESSOR_POWER_64 +# else +# define Q_PROCESSOR_POWER_32 +# endif /* S390 family, known variant: S390X (64-bit) diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index 363a4da338..96338c62dc 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -72,8 +72,8 @@ # include "QtCore/qatomic_ia64.h" #elif defined(Q_PROCESSOR_MIPS) # include "QtCore/qatomic_mips.h" -#elif defined(Q_PROCESSOR_POWERPC) -# include "QtCore/qatomic_powerpc.h" +#elif defined(Q_PROCESSOR_POWER) +# include "QtCore/qatomic_power.h" #elif defined(Q_PROCESSOR_S390) # include "QtCore/qatomic_s390.h" #elif defined(Q_PROCESSOR_SH4A) |