From 13f08d70fd5ba237ae53aad1de8bb3d613010246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Sun, 29 Nov 2009 18:11:49 +0000 Subject: Enable strict aliasing optimizations for codecs on gcc versions >= 4.0, fix alising violations that this uncovered, gives small speedups for most codecs, FS#10801 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23784 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libspc/spc_codec.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'apps/codecs/libspc/spc_codec.h') diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h index 923645b..cf72f90 100644 --- a/apps/codecs/libspc/spc_codec.h +++ b/apps/codecs/libspc/spc_codec.h @@ -137,16 +137,15 @@ static inline void set_le16( void* p, unsigned n ) } #define GET_LE16( addr ) get_le16( addr ) +#define GET_LE16A( addr ) get_le16( addr ) #define SET_LE16( addr, data ) set_le16( addr, data ) #define INT16A( addr ) (*(uint16_t*) (addr)) #define INT16SA( addr ) (*(int16_t*) (addr)) #ifdef ROCKBOX_LITTLE_ENDIAN - #define GET_LE16A( addr ) (*(uint16_t*) (addr)) #define GET_LE16SA( addr ) (*( int16_t*) (addr)) #define SET_LE16A( addr, data ) (void) (*(uint16_t*) (addr) = (data)) #else - #define GET_LE16A( addr ) get_le16 ( addr ) #define GET_LE16SA( addr ) get_le16s( addr ) #define SET_LE16A( addr, data ) set_le16 ( addr, data ) #endif @@ -166,13 +165,22 @@ struct cpu_regs_t uint8_t sp; }; +struct src_dir +{ + uint16_t start; + uint16_t loop; +}; + struct cpu_ram_t { union { uint8_t padding1 [0x100]; uint16_t align; } padding1 [1]; - uint8_t ram [0x10000]; + union { + uint8_t ram [0x10000]; + struct src_dir sd [0x10000/sizeof(struct src_dir)]; + }; uint8_t padding2 [0x100]; }; @@ -339,12 +347,6 @@ struct Spc_Dsp #endif }; -struct src_dir -{ - char start [2]; - char loop [2]; -}; - void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR; void DSP_reset( struct Spc_Dsp* this ); -- cgit v1.1