RetroArch/Makefile.psp1
pstef 6bfb7862e7 Make -ffast-math exclusive to sinc_resampler.c
-ffast-math was added in ff14092d8d with a comment that it "helps SINC
resampler to auto-vectorize". The flag is an alias for "-fno-math-errno
-funsafe-math-optimizations -ffp-contract=fast -fno-honor-infinities
-fno-honor-nans". The last two of those cause compiler complaints
because while the flag was meant for this file, it's shared across the
codebase that includes statements that operate on infinities and NaNs.

GCC 13.3 with -fopt-info-vec reports 18 vectorizations for `-O3
-ffast-math`, 17 for `-O3 -fno-math-errno -funsafe-math-optimizations
-ffp-contract=fast` and also 17 for plain `-O3`. So using the subset of
-ffast-math without the offending flags buys nothing and loses 1
vectorization.

Both GCC and Clang provide the "fast-math" pragma directive, which I add
to this one file that benefits from it, under the condition that it's
supported. -ffast-math is removed from most of the makefiles.
2025-05-02 17:26:19 +00:00

101 lines
2.0 KiB
Makefile

BUILD_PRX ?= 0
PSP_LARGE_MEMORY ?= 1
DEBUG ?= 0
HAVE_KERNEL_PRX ?= 1
HAVE_THREADS ?= 1
BIG_STACK ?= 0
LOAD_WITHOUT_CORE_INFO ?= 0
HAVE_STATIC_DUMMY ?= 0
HAVE_XDELTA ?= 1
TARGET = retroarchpsp
ifeq ($(DEBUG), 1)
OPTIMIZE_LV := -O0 -g
else
OPTIMIZE_LV := -O3
endif
INCDIR = deps deps/stb deps/7zip libretro-common/include libretro-common/include/compat/zlib
CFLAGS = $(OPTIMIZE_LV) -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
RARCH_DEFINES = -DPSP \
-D_MIPS_ARCH_ALLEGREX \
-DHAVE_ZLIB \
-DHAVE_AUDIOMIXER \
-DHAVE_RWAV \
-DHAVE_RPNG \
-DHAVE_RJPEG \
-DHAVE_GRIFFIN=1 \
-DRARCH_INTERNAL \
-DHAVE_SCREENSHOTS \
-DHAVE_REWIND \
-DRARCH_CONSOLE \
-DHAVE_MENU \
-DHAVE_CONFIGFILE \
-DHAVE_PATCH \
-DHAVE_CHEATS \
-DHAVE_RGUI \
-DHAVE_FILTERS_BUILTIN \
-DHAVE_DSP_FILTER \
-DHAVE_VIDEO_FILTER \
-DHAVE_7ZIP \
-D_7ZIP_ST \
-DHAVE_CC_RESAMPLER \
-DHAVE_CORE_INFO_CACHE
LIBDIR =
LDFLAGS = -L$(shell psp-config --psp-prefix)
ifeq ($(HAVE_STATIC_DUMMY),1)
RARCH_DEFINES += -DHAVE_STATIC_DUMMY
else
LIBS += -lretro_psp1
endif
LIBS += -lstdc++ -lpspgu -lpspgum -lpspaudio -lpspfpu -lpsppower -lpsprtc -lpthread
ifeq ($(HAVE_THREADS), 1)
RARCH_DEFINES += -DHAVE_THREADS
endif
ifeq ($(HAVE_KERNEL_PRX), 1)
OBJS += bootstrap/psp1/kernel_functions.o
CFLAGS += -DHAVE_KERNEL_PRX
endif
ifeq ($(BIG_STACK), 1)
CFLAGS += -DBIG_STACK
endif
ifeq ($(LOAD_WITHOUT_CORE_INFO),1)
RARCH_DEFINES += -DLOAD_WITHOUT_CORE_INFO
endif
CFLAGS += $(RARCH_DEFINES)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = RetroArch PSP1
OBJS += griffin/griffin.o
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
pspsh-debug:
pspsh -e reset
read -p "Start debugger in VSCode and press any key to continue... \n" -n1 -s
pspsh -e debug ./retroarchpsp.prx
pspsh
pspsh-run:
pspsh -e reset
pspsh -e ./retroarchpsp.prx
pspsh
debug: clean all pspsh-debug
run: clean all pspsh-run
sim:
/Applications/PPSSPPSDL.app/Contents/MacOS/PPSSPPSDL $(shell pwd)/EBOOT.PBP