From e4e50e36f1451a7153de4192dadfddc80fdc4218 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 12 Aug 2025 09:04:58 -0400 Subject: [PATCH] rbcodec: Force use of -O2 for dsp code We already use targeted optimization for most codecs, and the DSP code is just as performance-sensitive. Improves mp3 decoding performance by a whopping 1% wwhen PBE is turned on. Change-Id: I801a6624c0f7068b6cd67961ad3b08f809b92fca --- lib/rbcodec/rbcodec.make | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rbcodec/rbcodec.make b/lib/rbcodec/rbcodec.make index f2a7c7e569..bc28d00bae 100644 --- a/lib/rbcodec/rbcodec.make +++ b/lib/rbcodec/rbcodec.make @@ -22,4 +22,9 @@ CORE_LIBS := $(RBCODECLIB) $(CORE_LIBS) $(RBCODECLIB): $(RBCODECLIB_OBJ) $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null +# Force use of -O2 for DSP code +ifneq ($(MEMORYSIZE),2) +$(BUILDDIR)/lib/rbcodec/dsp/%: CFLAGS += -O2 +endif + include $(RBCODECLIB_DIR)/codecs/codecs.make