From cef87e9262aa48428071d46570e6d9f04ccb228f Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 15 Sep 2022 21:48:14 +0300 Subject: [PATCH] try to enable gpu_neon on x86 --- Makefile.libretro | 5 ++++- jni/Android.mk | 25 +++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index f40f816c..ab62f224 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -65,6 +65,9 @@ ifneq ($(findstring __thumb__,$(shell $(CC) -E -dD $(CFLAGS) include/arm_feature CFLAGS += -marm endif endif +ifneq (,$(findstring $(ARCH_DETECTED),x86_64 aarch64)) + BUILTIN_GPU = neon +endif # ODROIDN2 else ifneq (,$(findstring CortexA73_G12B,$(platform))) @@ -179,7 +182,7 @@ endif IOSSDK := $(shell xcodebuild -version -sdk appletvos Path) endif - CFLAGS += -DIOS -DTVOS -marm + CFLAGS += -DIOS -DTVOS CC = cc -arch arm64 -isysroot $(IOSSDK) CXX = c++ -arch arm64 -isysroot $(IOSSDK) ARCH := arm64 diff --git a/jni/Android.mk b/jni/Android.mk index 682e407b..501b0671 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -113,16 +113,21 @@ endif HAVE_ARI64=0 HAVE_LIGHTREC=0 LIGHTREC_CUSTOM_MAP=0 +HAVE_GPU_NEON=0 ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) HAVE_ARI64=1 + HAVE_GPU_NEON=1 else ifeq ($(TARGET_ARCH_ABI),armeabi) HAVE_ARI64=1 else ifeq ($(TARGET_ARCH_ABI),arm64-v8a) HAVE_ARI64=1 + HAVE_GPU_NEON=1 else ifeq ($(TARGET_ARCH_ABI),x86_64) HAVE_LIGHTREC=1 + HAVE_GPU_NEON=1 else ifeq ($(TARGET_ARCH_ABI),x86) HAVE_LIGHTREC=1 + HAVE_GPU_NEON=1 else COREFLAGS += -DDRC_DISABLE endif @@ -172,12 +177,17 @@ endif endif -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) +ifeq ($(HAVE_GPU_NEON),1) COREFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP -DGPU_NEON - COREFLAGS += -DHAVE_bgr555_to_rgb565 -DHAVE_bgr888_to_x - SOURCES_ASM += $(CORE_DIR)/gte_neon.S \ - $(NEON_DIR)/psx_gpu/psx_gpu_arm_neon.S \ - $(FRONTEND_DIR)/cspace_neon.S + ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) + COREFLAGS += -DHAVE_bgr555_to_rgb565 -DHAVE_bgr888_to_x + SOURCES_ASM += $(CORE_DIR)/gte_neon.S \ + $(NEON_DIR)/psx_gpu/psx_gpu_arm_neon.S \ + $(FRONTEND_DIR)/cspace_neon.S + else + COREFLAGS += -DSIMD_BUILD + SOURCES_C += $(NEON_DIR)/psx_gpu/psx_gpu_simd.c + endif SOURCES_C += $(NEON_DIR)/psx_gpu_if.c else ifeq ($(TARGET_ARCH_ABI),armeabi) COREFLAGS += -DUSE_GPULIB=1 -DGPU_UNAI @@ -185,11 +195,6 @@ else ifeq ($(TARGET_ARCH_ABI),armeabi) SOURCES_ASM += $(UNAI_DIR)/gpu_arm.S \ $(FRONTEND_DIR)/cspace_arm.S SOURCES_C += $(UNAI_DIR)/gpulib_if.cpp -else ifeq ($(TARGET_ARCH_ABI),arm64-v8a) - COREFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP - COREFLAGS += -DGPU_NEON -DSIMD_BUILD - SOURCES_C += $(NEON_DIR)/psx_gpu_if.c \ - $(NEON_DIR)/psx_gpu/psx_gpu_simd.c else COREFLAGS += -fno-strict-aliasing -DGPU_PEOPS SOURCES_C += $(PEOPS_DIR)/gpulib_if.c -- 2.39.5