diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-01-03 15:58:12 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-01-04 16:52:18 +0000 |
commit | 0fada59c49a06cec8bfca72eb86ad340967b6f26 (patch) | |
tree | 8c2feb0ea1f3e540aa5d98e2acff5c2434674b35 | |
parent | 4038160a32dcb51d843fb751a9a9340e7cc2bb63 (diff) |
Clarify JIT selection for 32-bit and 64-bit architectures
Instead of relying on the somewhat "cryptic" ILP32 macro on x86/x86-64,
we can also use the macro that the JIT generated code _really_ relies
on, which is the size of pointers. For x32 those will be 4 despite
Q_PROCESSOR_X86_64, and the JIT will end up disabled. For regular x86
and x86-64 it should get enabled.
The same logic is applied to ARM32/ARM64 to disable the JIT once
machines start showing up with ILP32 data model on ARM64.
Change-Id: Id8dfb203c9b75e8ed5a61dcae28482f8f99be75f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
-rw-r--r-- | src/qml/jsruntime/qv4global_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index c37ad1668d..1dbc538be2 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -97,19 +97,19 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } // // NOTE: This should match the logic in qv4targetplatform_p.h! -#if defined(Q_PROCESSOR_X86) && !defined(__ILP32__) \ +#if defined(Q_PROCESSOR_X86) && (QT_POINTER_SIZE == 4) \ && (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD)) # define V4_ENABLE_JIT -#elif defined(Q_PROCESSOR_X86_64) && !defined(__ILP32__) \ +#elif defined(Q_PROCESSOR_X86_64) && (QT_POINTER_SIZE == 8) \ && (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)) # define V4_ENABLE_JIT -#elif defined(Q_PROCESSOR_ARM_32) +#elif defined(Q_PROCESSOR_ARM_32) && (QT_POINTER_SIZE == 4) # if defined(thumb2) || defined(__thumb2__) || ((defined(__thumb) || defined(__thumb__)) && __TARGET_ARCH_THUMB-0 == 4) # define V4_ENABLE_JIT # elif defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2 // clang 3.5 and later will set this if the core supports the Thumb-2 ISA. # define V4_ENABLE_JIT # endif -#elif defined(Q_PROCESSOR_ARM_64) +#elif defined(Q_PROCESSOR_ARM_64) && (QT_POINTER_SIZE == 8) # if defined(Q_OS_LINUX) # define V4_ENABLE_JIT # endif |