summaryrefslogtreecommitdiff
path: root/apps/codecs/libspc/spc_codec.h
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-15 16:08:50 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-05-15 16:08:50 +0000
commit46507d29b4bc0f4fe491aadae8d3a474be7cec39 (patch)
tree7a467903a805e13b32217c119260f75ceb69b0fa /apps/codecs/libspc/spc_codec.h
parent41723bc14b41498206afc6693c6c8e5b1b0c77de (diff)
downloadrockbox-46507d29b4bc0f4fe491aadae8d3a474be7cec39.zip
rockbox-46507d29b4bc0f4fe491aadae8d3a474be7cec39.tar.gz
rockbox-46507d29b4bc0f4fe491aadae8d3a474be7cec39.tar.bz2
rockbox-46507d29b4bc0f4fe491aadae8d3a474be7cec39.tar.xz
FS#12113: Optimize IRAM configuration for SPC. Performance increases by 5-6% on PP5022, PP5024 and S5L870x. No change of performance on Coldfire, PP5002 and PP5020.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29887 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspc/spc_codec.h')
-rw-r--r--apps/codecs/libspc/spc_codec.h64
1 files changed, 42 insertions, 22 deletions
diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h
index f4f69dd..391540c 100644
--- a/apps/codecs/libspc/spc_codec.h
+++ b/apps/codecs/libspc/spc_codec.h
@@ -89,20 +89,41 @@
#define SPC_NOECHO 1
#endif
-#ifdef CPU_ARM
+#if (CONFIG_CPU == MCF5250)
+#define IBSS_ATTR_SPC IBSS_ATTR
+#define ICODE_ATTR_SPC ICODE_ATTR
+#define ICONST_ATTR_SPC ICONST_ATTR
+/* Not enough IRAM available to move further data to it. */
+#define IBSS_ATTR_SPC_LARGE_IRAM
+
+#elif (CONFIG_CPU == PP5020)
+/* spc is slower on PP5020 when moving data to IRAM. */
+#define IBSS_ATTR_SPC
+#define ICODE_ATTR_SPC
+#define ICONST_ATTR_SPC
+/* Not enough IRAM available to move further data to it. */
+#define IBSS_ATTR_SPC_LARGE_IRAM
+
+#elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
+#define IBSS_ATTR_SPC IBSS_ATTR
+#define ICODE_ATTR_SPC ICODE_ATTR
+#define ICONST_ATTR_SPC ICONST_ATTR
+/* Not enough IRAM available to move further data to it. */
+#define IBSS_ATTR_SPC_LARGE_IRAM
+
+#elif defined(CPU_S5L870X)
+#define IBSS_ATTR_SPC IBSS_ATTR
+#define ICODE_ATTR_SPC ICODE_ATTR
+#define ICONST_ATTR_SPC ICONST_ATTR
+/* Very large IRAM. Move even more data to it. */
+#define IBSS_ATTR_SPC_LARGE_IRAM IBSS_ATTR
-#if CONFIG_CPU != PP5002
- #undef ICODE_ATTR
- #define ICODE_ATTR
-
- #undef IDATA_ATTR
- #define IDATA_ATTR
-
- #undef ICONST_ATTR
- #define ICONST_ATTR
-
- #undef IBSS_ATTR
- #define IBSS_ATTR
+#else
+#define IBSS_ATTR_SPC IBSS_ATTR
+#define ICODE_ATTR_SPC ICODE_ATTR
+#define ICONST_ATTR_SPC ICONST_ATTR
+/* Not enough IRAM available to move further data to it. */
+#define IBSS_ATTR_SPC_LARGE_IRAM
#endif
#if SPC_DUAL_CORE
@@ -111,7 +132,6 @@
#undef SHAREDDATA_ATTR
#define SHAREDDATA_ATTR __attribute__((section(".idata")))
#endif
-#endif
/* Samples per channel per iteration */
#if defined(CPU_PP) && NUM_CORES == 1
@@ -192,7 +212,7 @@ struct cpu_ram_t
#define RAM ram.ram
extern struct cpu_ram_t ram;
-long CPU_run( THIS, long start_time ) ICODE_ATTR;
+long CPU_run( THIS, long start_time ) ICODE_ATTR_SPC;
void CPU_Init( THIS );
/* The DSP portion (awe!) */
@@ -375,7 +395,7 @@ struct Spc_Dsp
#endif
};
-void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR;
+void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR_SPC;
void DSP_reset( struct Spc_Dsp* this );
static inline void DSP_run( struct Spc_Dsp* this, long count, int32_t* out )
@@ -412,7 +432,7 @@ struct Timer
int counter;
};
-void Timer_run_( struct Timer* t, long time ) ICODE_ATTR;
+void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC;
static inline void Timer_run( struct Timer* t, long time )
{
@@ -461,7 +481,7 @@ void SPC_Init( THIS );
int SPC_load_spc( THIS, const void* data, long size );
/**************** DSP interaction ****************/
-void DSP_write( struct Spc_Dsp* this, int i, int data ) ICODE_ATTR;
+void DSP_write( struct Spc_Dsp* this, int i, int data ) ICODE_ATTR_SPC;
static inline int DSP_read( struct Spc_Dsp* this, int i )
{
@@ -469,7 +489,7 @@ static inline int DSP_read( struct Spc_Dsp* this, int i )
return this->r.reg [i];
}
-void SPC_run_dsp_( THIS, long time ) ICODE_ATTR;
+void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC;
static inline void SPC_run_dsp( THIS, long time )
{
@@ -477,10 +497,10 @@ static inline void SPC_run_dsp( THIS, long time )
SPC_run_dsp_( this, time );
}
-int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR;
-void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR;
+int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR_SPC;
+void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR_SPC;
/**************** Sample generation ****************/
-int SPC_play( THIS, long count, int32_t* out ) ICODE_ATTR;
+int SPC_play( THIS, long count, int32_t* out ) ICODE_ATTR_SPC;
#endif /* _SPC_CODEC_H_ */