Linux Ports (All): Update Autotools and Meson scripts to add JIT support for ARM targets.
- Also fixes build errors related to explicitly building SIMD files for colorspacehandler. Don't do it! The proper way is to simply include "colorspacehandler.cpp" alone and let the compiler's preprocessor macros determine which SIMD file to use.
This commit is contained in:
parent
2e01c0a840
commit
c75c1ce2c3
|
@ -141,24 +141,13 @@ libdesmume_a_SOURCES = \
|
||||||
libretro-common/rthreads/rsemaphore.c \
|
libretro-common/rthreads/rsemaphore.c \
|
||||||
libretro-common/rthreads/rthreads.c
|
libretro-common/rthreads/rthreads.c
|
||||||
|
|
||||||
if SUPPORT_SSE2
|
|
||||||
libdesmume_a_SOURCES += \
|
|
||||||
utils/colorspacehandler/colorspacehandler_SSE2.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
if SUPPORT_AVX2
|
|
||||||
libdesmume_a_SOURCES += \
|
|
||||||
utils/colorspacehandler/colorspacehandler_AVX2.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
if SUPPORT_ALTIVEC
|
|
||||||
libdesmume_a_SOURCES += \
|
|
||||||
utils/colorspacehandler/colorspacehandler_AltiVec.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_JIT
|
if HAVE_JIT
|
||||||
libdesmume_a_SOURCES += \
|
libdesmume_a_SOURCES += \
|
||||||
arm_jit.cpp arm_jit.h instruction_attributes.h \
|
arm_jit.h instruction_attributes.h
|
||||||
|
|
||||||
|
if HOST_CPU_KIND_X86
|
||||||
|
libdesmume_a_SOURCES += \
|
||||||
|
arm_jit.cpp \
|
||||||
utils/AsmJit/AsmJit.h \
|
utils/AsmJit/AsmJit.h \
|
||||||
utils/AsmJit/Config.h \
|
utils/AsmJit/Config.h \
|
||||||
utils/AsmJit/core.h \
|
utils/AsmJit/core.h \
|
||||||
|
@ -227,6 +216,13 @@ libdesmume_a_SOURCES += \
|
||||||
utils/AsmJit/x86/x86operand.h \
|
utils/AsmJit/x86/x86operand.h \
|
||||||
utils/AsmJit/x86/x86util.cpp \
|
utils/AsmJit/x86/x86util.cpp \
|
||||||
utils/AsmJit/x86/x86util.h
|
utils/AsmJit/x86/x86util.h
|
||||||
|
else
|
||||||
|
if HOST_CPU_KIND_ARM
|
||||||
|
libdesmume_a_SOURCES += \
|
||||||
|
utils/arm_jit/arm_jit_arm.cpp
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_OPENGL_ES
|
if ENABLE_OPENGL_ES
|
||||||
|
|
|
@ -120,24 +120,13 @@ libdesmume_a_SOURCES = \
|
||||||
../../libretro-common/rthreads/rthreads.c \
|
../../libretro-common/rthreads/rthreads.c \
|
||||||
../../libretro-common/encodings/encoding_utf.c
|
../../libretro-common/encodings/encoding_utf.c
|
||||||
|
|
||||||
if SUPPORT_SSE2
|
|
||||||
libdesmume_a_SOURCES += \
|
|
||||||
../../utils/colorspacehandler/colorspacehandler_SSE2.cpp ../../utils/colorspacehandler/colorspacehandler_SSE2.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
if SUPPORT_AVX2
|
|
||||||
libdesmume_a_SOURCES += \
|
|
||||||
../../utils/colorspacehandler/colorspacehandler_AVX2.cpp ../../utils/colorspacehandler/colorspacehandler_AVX2.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
if SUPPORT_ALTIVEC
|
|
||||||
libdesmume_a_SOURCES += \
|
|
||||||
../../utils/colorspacehandler/colorspacehandler_AltiVec.cpp ../../utils/colorspacehandler/colorspacehandler_AltiVec.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_JIT
|
if HAVE_JIT
|
||||||
libdesmume_a_SOURCES += \
|
libdesmume_a_SOURCES += \
|
||||||
../../arm_jit.cpp ../../arm_jit.h ../../instruction_attributes.h \
|
../../arm_jit.h ../../instruction_attributes.h
|
||||||
|
|
||||||
|
if HOST_CPU_KIND_X86
|
||||||
|
libdesmume_a_SOURCES += \
|
||||||
|
../../arm_jit.cpp \
|
||||||
../../utils/AsmJit/AsmJit.h \
|
../../utils/AsmJit/AsmJit.h \
|
||||||
../../utils/AsmJit/Config.h \
|
../../utils/AsmJit/Config.h \
|
||||||
../../utils/AsmJit/core.h \
|
../../utils/AsmJit/core.h \
|
||||||
|
@ -206,6 +195,13 @@ libdesmume_a_SOURCES += \
|
||||||
../../utils/AsmJit/x86/x86operand.h \
|
../../utils/AsmJit/x86/x86operand.h \
|
||||||
../../utils/AsmJit/x86/x86util.cpp \
|
../../utils/AsmJit/x86/x86util.cpp \
|
||||||
../../utils/AsmJit/x86/x86util.h
|
../../utils/AsmJit/x86/x86util.h
|
||||||
|
else
|
||||||
|
if HOST_CPU_KIND_ARM
|
||||||
|
libdesmume_a_SOURCES += \
|
||||||
|
../../utils/arm_jit/arm_jit_arm.cpp
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libdesmume_a_SOURCES += shared/desmume_config.cpp shared/desmume_config.h
|
libdesmume_a_SOURCES += shared/desmume_config.cpp shared/desmume_config.h
|
||||||
|
|
|
@ -338,7 +338,7 @@ fi
|
||||||
|
|
||||||
dnl - jit support
|
dnl - jit support
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
x86|x86_64|i386|i486|i586|i686)
|
x86|x86_64|i386|i486|i586|i686|arm|arm64|aarch64)
|
||||||
HAVE_JIT=yes
|
HAVE_JIT=yes
|
||||||
AC_DEFINE(HAVE_JIT)
|
AC_DEFINE(HAVE_JIT)
|
||||||
;;
|
;;
|
||||||
|
@ -384,17 +384,35 @@ AS_CASE([$host],
|
||||||
AS_CASE([$host_cpu],
|
AS_CASE([$host_cpu],
|
||||||
[x86_64], [AC_DEFINE(HOST_64)],
|
[x86_64], [AC_DEFINE(HOST_64)],
|
||||||
[amd64], [AC_DEFINE(HOST_64)],
|
[amd64], [AC_DEFINE(HOST_64)],
|
||||||
|
[aarch64], [AC_DEFINE(HOST_64)],
|
||||||
|
[arm64], [AC_DEFINE(HOST_64)],
|
||||||
|
[ppc64], [AC_DEFINE(HOST_64)],
|
||||||
[AC_DEFINE(HOST_32)]
|
[AC_DEFINE(HOST_32)]
|
||||||
)
|
)
|
||||||
|
|
||||||
AC_CHECK_DECL([__SSE2__])
|
host_cpu_kind_x86=no
|
||||||
AM_CONDITIONAL([SUPPORT_SSE2], [test "x$ac_cv_have_decl___SSE2__" = xyes])
|
host_cpu_kind_arm=no
|
||||||
|
host_cpu_kind_powerpc=no
|
||||||
|
host_cpu_kind_unknown=no
|
||||||
|
AS_CASE([$host_cpu],
|
||||||
|
[x86_64], [host_cpu_kind_x86=yes],
|
||||||
|
[amd64], [host_cpu_kind_x86=yes],
|
||||||
|
[x86], [host_cpu_kind_x86=yes],
|
||||||
|
[i686], [host_cpu_kind_x86=yes],
|
||||||
|
[i586], [host_cpu_kind_x86=yes],
|
||||||
|
[i486], [host_cpu_kind_x86=yes],
|
||||||
|
[i386], [host_cpu_kind_x86=yes],
|
||||||
|
[aarch64], [host_cpu_kind_arm=yes],
|
||||||
|
[arm64], [host_cpu_kind_arm=yes],
|
||||||
|
[arm], [host_cpu_kind_arm=yes],
|
||||||
|
[ppc64], [host_cpu_kind_powerpc=yes],
|
||||||
|
[powerpc], [host_cpu_kind_powerpc=yes],
|
||||||
|
[host_cpu_kind_unknown=yes]
|
||||||
|
)
|
||||||
|
|
||||||
AC_CHECK_DECL([__AVX2__])
|
AM_CONDITIONAL([HOST_CPU_KIND_X86], [test x$host_cpu_kind_x86 = xyes])
|
||||||
AM_CONDITIONAL([SUPPORT_AVX2], [test "x$ac_cv_have_decl___AVX2__" = xyes])
|
AM_CONDITIONAL([HOST_CPU_KIND_ARM], [test x$host_cpu_kind_arm = xyes])
|
||||||
|
AM_CONDITIONAL([HOST_CPU_KIND_PPC], [test x$host_cpu_kind_powerpc = xyes])
|
||||||
AC_CHECK_DECL([__ALTIVEC__])
|
|
||||||
AM_CONDITIONAL([SUPPORT_ALTIVEC], [test "x$ac_cv_have_decl___ALTIVEC__" = xyes])
|
|
||||||
|
|
||||||
AC_SUBST(UI_DIR)
|
AC_SUBST(UI_DIR)
|
||||||
AC_SUBST(PO_DIR)
|
AC_SUBST(PO_DIR)
|
||||||
|
|
|
@ -34,14 +34,48 @@ endif
|
||||||
|
|
||||||
dependencies = [dep_glib2, dep_sdl, dep_pcap, dep_zlib, dep_threads]
|
dependencies = [dep_glib2, dep_sdl, dep_pcap, dep_zlib, dep_threads]
|
||||||
|
|
||||||
if target_machine.cpu() == 'x86_64'
|
# Determine the CPU architecture of the target.
|
||||||
add_global_arguments('-DHAVE_JIT', language: ['c', 'cpp'])
|
target_cpu_64bit = false
|
||||||
|
target_cpu_kind_x86 = false
|
||||||
|
target_cpu_kind_arm = false
|
||||||
|
target_cpu_kind_powerpc = false
|
||||||
|
target_cpu_kind_unknown = false
|
||||||
|
|
||||||
|
if target_machine.cpu() == 'x86_64' or \
|
||||||
|
target_machine.cpu() == 'amd64'
|
||||||
|
target_cpu_kind_x86 = true
|
||||||
|
target_cpu_64bit = true
|
||||||
|
elif target_machine.cpu() == 'x86' or \
|
||||||
|
target_machine.cpu() == 'i686' or \
|
||||||
|
target_machine.cpu() == 'i586' or \
|
||||||
|
target_machine.cpu() == 'i486' or \
|
||||||
|
target_machine.cpu() == 'i386'
|
||||||
|
target_cpu_kind_x86 = true
|
||||||
|
elif target_machine.cpu() == 'aarch64' or \
|
||||||
|
target_machine.cpu() == 'arm64'
|
||||||
|
target_cpu_kind_arm = true
|
||||||
|
target_cpu_64bit = true
|
||||||
|
elif target_machine.cpu() == 'arm'
|
||||||
|
target_cpu_kind_arm = true
|
||||||
|
elif target_machine.cpu() == 'ppc64'
|
||||||
|
target_cpu_kind_powerpc = true
|
||||||
|
target_cpu_64bit = true
|
||||||
|
elif target_machine.cpu() == 'powerpc'
|
||||||
|
target_cpu_kind_powerpc = true
|
||||||
|
else
|
||||||
|
target_cpu_kind_unknown = true
|
||||||
|
endif
|
||||||
|
|
||||||
|
if target_cpu_64bit
|
||||||
add_global_arguments('-DHOST_64', language: ['c', 'cpp'])
|
add_global_arguments('-DHOST_64', language: ['c', 'cpp'])
|
||||||
have_jit = true
|
else
|
||||||
elif target_machine.cpu() == 'i686'
|
|
||||||
add_global_arguments('-DHAVE_JIT', language: ['c', 'cpp'])
|
|
||||||
add_global_arguments('-DHOST_32', language: ['c', 'cpp'])
|
add_global_arguments('-DHOST_32', language: ['c', 'cpp'])
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Enable JIT for supported architectures.
|
||||||
|
if target_cpu_kind_x86 or target_cpu_kind_arm
|
||||||
have_jit = true
|
have_jit = true
|
||||||
|
add_global_arguments('-DHAVE_JIT', language: ['c', 'cpp'])
|
||||||
else
|
else
|
||||||
have_jit = false
|
have_jit = false
|
||||||
endif
|
endif
|
||||||
|
@ -133,6 +167,7 @@ libdesmume_src = [
|
||||||
]
|
]
|
||||||
|
|
||||||
if have_jit
|
if have_jit
|
||||||
|
if target_cpu_kind_x86
|
||||||
libdesmume_src += [
|
libdesmume_src += [
|
||||||
'../../arm_jit.cpp',
|
'../../arm_jit.cpp',
|
||||||
'../../utils/AsmJit/core/assembler.cpp',
|
'../../utils/AsmJit/core/assembler.cpp',
|
||||||
|
@ -165,6 +200,11 @@ if have_jit
|
||||||
'../../utils/AsmJit/x86/x86operand.cpp',
|
'../../utils/AsmJit/x86/x86operand.cpp',
|
||||||
'../../utils/AsmJit/x86/x86util.cpp',
|
'../../utils/AsmJit/x86/x86util.cpp',
|
||||||
]
|
]
|
||||||
|
elif target_cpu_kind_arm
|
||||||
|
libdesmume_src += [
|
||||||
|
'../../utils/arm_jit/arm_jit_arm.cpp',
|
||||||
|
]
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libdesmume_src += [
|
libdesmume_src += [
|
||||||
|
@ -285,25 +325,10 @@ if get_option('gdb-stub')
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
simd = import('unstable-simd')
|
|
||||||
cxx = meson.get_compiler('cpp')
|
|
||||||
rval = simd.check('colorspacehandler',
|
|
||||||
sse2: '../../utils/colorspacehandler/colorspacehandler_SSE2.cpp',
|
|
||||||
# TODO: add these two even in generic builds.
|
|
||||||
#avx2: '../../utils/colorspacehandler/colorspacehandler_AVX2.cpp',
|
|
||||||
#avx512: '../../utils/colorspacehandler/colorspacehandler_AVX512.cpp',
|
|
||||||
# TODO: add support for this in meson.
|
|
||||||
#altivec: '../../utils/colorspacehandler/colorspacehandler_AltiVec.cpp',
|
|
||||||
compiler: cxx,
|
|
||||||
include_directories: includes,
|
|
||||||
)
|
|
||||||
colorspacehandler_simd = rval[0]
|
|
||||||
|
|
||||||
libdesmume = static_library('desmume',
|
libdesmume = static_library('desmume',
|
||||||
libdesmume_src,
|
libdesmume_src,
|
||||||
dependencies: dependencies,
|
dependencies: dependencies,
|
||||||
include_directories: includes,
|
include_directories: includes,
|
||||||
link_with: colorspacehandler_simd,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if get_option('frontend-cli')
|
if get_option('frontend-cli')
|
||||||
|
|
Loading…
Reference in New Issue