forked from len0rd/rockbox
SPC Codec: Refactor for CPU and clean up some things.
CPU optimization gets its own files in which to fill-in optimizable routines. Some pointless #if 0's for profiling need removal. Those macros are empty if not profiling. Force some functions that are undesirable to be force-inlined by the compiler to be not inlined. Change-Id: Ia7b7e45380d7efb20c9b1a4d52e05db3ef6bbaab
This commit is contained in:
parent
a17d6de5bc
commit
87021f7c0a
12 changed files with 1693 additions and 1298 deletions
|
@ -32,8 +32,8 @@ struct cpu_ram_t ram IBSS_ATTR_SPC_LARGE_IRAM CACHEALIGN_ATTR;
|
|||
|
||||
/**************** Timers ****************/
|
||||
|
||||
static void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC;
|
||||
static void Timer_run_( struct Timer* t, long time )
|
||||
static void NO_INLINE ICODE_ATTR_SPC
|
||||
Timer_run_( struct Timer* t, long time )
|
||||
{
|
||||
/* when disabled, next_tick should always be in the future */
|
||||
assert( t->enabled );
|
||||
|
@ -60,7 +60,7 @@ static inline void Timer_run( struct Timer* t, long time )
|
|||
/**************** SPC emulator ****************/
|
||||
/* 1.024 MHz clock / 32000 samples per second */
|
||||
|
||||
static void SPC_enable_rom( THIS, int enable )
|
||||
static void NO_INLINE SPC_enable_rom( THIS, int enable )
|
||||
{
|
||||
if ( this->rom_enabled != enable )
|
||||
{
|
||||
|
@ -186,8 +186,8 @@ int SPC_load_spc( THIS, const void* data, long size )
|
|||
}
|
||||
|
||||
/**************** DSP interaction ****************/
|
||||
static void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC;
|
||||
static void SPC_run_dsp_( THIS, long time )
|
||||
static void NO_INLINE ICODE_ATTR_SPC
|
||||
SPC_run_dsp_( THIS, long time )
|
||||
{
|
||||
/* divide by CLOCKS_PER_SAMPLE */
|
||||
int count = ((time - this->next_dsp) >> 5) + 1;
|
||||
|
@ -383,13 +383,10 @@ int SPC_play( THIS, long count, int32_t* out )
|
|||
}
|
||||
|
||||
/* Catch DSP up to present */
|
||||
#if 0
|
||||
ENTER_TIMER(cpu);
|
||||
#endif
|
||||
SPC_run_dsp( this, -EXTRA_CLOCKS );
|
||||
#if 0
|
||||
EXIT_TIMER(cpu);
|
||||
#endif
|
||||
|
||||
assert( this->next_dsp == CLOCKS_PER_SAMPLE - EXTRA_CLOCKS );
|
||||
assert( this->sample_buf - out == count );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue