diff options
| author | Nils Wallménius <nils@rockbox.org> | 2009-11-29 18:11:49 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2009-11-29 18:11:49 +0000 |
| commit | 13f08d70fd5ba237ae53aad1de8bb3d613010246 (patch) | |
| tree | ab159172b0c4a8cf13f07f16e28008da4d732dfc /apps/codecs/libspc/spc_codec.h | |
| parent | 685ca2672e5842fe185c8f12da6bf108fd8f074f (diff) | |
| download | rockbox-13f08d70fd5ba237ae53aad1de8bb3d613010246.zip rockbox-13f08d70fd5ba237ae53aad1de8bb3d613010246.tar.gz rockbox-13f08d70fd5ba237ae53aad1de8bb3d613010246.tar.bz2 rockbox-13f08d70fd5ba237ae53aad1de8bb3d613010246.tar.xz | |
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
Diffstat (limited to 'apps/codecs/libspc/spc_codec.h')
| -rw-r--r-- | apps/codecs/libspc/spc_codec.h | 20 |
1 files changed, 11 insertions, 9 deletions
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 ); |