mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-09 03:29:43 -10:00
ozone: keep the sidebar and header draw phases out of line
Same treatment as rgui_render, and for the same reason: ozone_frame()
is factored into named phases, but the single-call-site ones are
inlined back into it at -O3, so branches that are not taken on a given
frame still occupy the fall-through path in L1i.
ozone_frame .text 19855 -> 17018 (-14%)
spills 641 -> 674
broken out ozone_draw_sidebar 6976
ozone_draw_header 3170
Total .text for the TU goes down as well, 104723 -> 104515.
Only these two are annotated. The set was chosen by measuring each
phase individually rather than annotating all of them, because the
effect is not monotonic -- outlining one phase changes the inliner's
budget for the others. Outlining ozone_draw_thumbnail_bar makes
ozone_frame *larger* (20191, +336) and costs 736 bytes of TU size, and
ozone_draw_backdrop is only worth 128 bytes. Both are left inline.
Note the spill count for ozone_frame itself goes slightly up. That is
the usual accounting artefact of moving code across a call boundary and
is not a regression in memory traffic; the win here is the I-cache
footprint of the fall-through path.
This commit is contained in:
1 parent
899cd1ae56
commit
a5217ab0d1
1 file changed
+22
-2
+22
-2
@@ -60,6 +60,26 @@
|
||||
#include "../../cheevos/cheevos_menu.h"
|
||||
#endif
|
||||
|
||||
/* Force a render phase out of line even though it has a single call
|
||||
* site. Follows the RXML_NOINLINE precedent in
|
||||
* libretro-common/formats/xml/rxml.c.
|
||||
*
|
||||
* ozone_frame() is already factored into named phases, but at -O3 the
|
||||
* ones called exactly once are inlined straight back into it, so
|
||||
* branches that are not taken on a given frame still occupy the
|
||||
* fall-through path in L1i. Under -Os the compiler already optimises
|
||||
* for size and the forced outlining only adds call overhead, so it is
|
||||
* disabled there. */
|
||||
#if defined(__OPTIMIZE_SIZE__)
|
||||
#define OZONE_NOINLINE
|
||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
#define OZONE_NOINLINE __attribute__((noinline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define OZONE_NOINLINE __declspec(noinline)
|
||||
#else
|
||||
#define OZONE_NOINLINE
|
||||
#endif
|
||||
|
||||
#define ANIMATION_PUSH_ENTRY_DURATION (166.66667f)
|
||||
#define ANIMATION_CURSOR_DURATION (ANIMATION_PUSH_ENTRY_DURATION)
|
||||
#define ANIMATION_CURSOR_PULSE (ANIMATION_PUSH_ENTRY_DURATION * 3)
|
||||
@@ -3407,7 +3427,7 @@ static INLINE void ozone_text_color_hp(uint32_t rgba, float alpha,
|
||||
out[3] = alpha < 0.0f ? 0.0f : (alpha > 1.0f ? 1.0f : alpha);
|
||||
}
|
||||
|
||||
static void ozone_draw_sidebar(
|
||||
OZONE_NOINLINE static void ozone_draw_sidebar(
|
||||
ozone_handle_t *ozone,
|
||||
const uintptr_t *icons_tex,
|
||||
const uintptr_t *tab_tex,
|
||||
@@ -11020,7 +11040,7 @@ static void ozone_render(void *data,
|
||||
GFX_ANIMATION_CLEAR_ACTIVE(p_anim);
|
||||
}
|
||||
|
||||
static void ozone_draw_header(
|
||||
OZONE_NOINLINE static void ozone_draw_header(
|
||||
ozone_handle_t *ozone,
|
||||
const uintptr_t *icons_tex,
|
||||
const uintptr_t *ozone_tex,
|
||||
|
||||
Reference in new issue
Block a user