1
0
Fork 0
forked from len0rd/rockbox

Code cleaning - remove some unnecessary defined(SIMULATOR) checks

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13369 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2007-05-10 13:16:08 +00:00
parent 1fc2d91a83
commit f02cba8096
30 changed files with 59 additions and 63 deletions

View file

@ -19,7 +19,7 @@
#include "os_types.h"
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
/* attribute for 16-byte alignment */
#define LINE_ATTR __attribute__ ((aligned (16)))

View file

@ -197,7 +197,7 @@ static vorbis_look_floor *floor1_look(vorbis_dsp_state *vd,vorbis_info_mode *mi,
static int render_point(int x0,int x1,int y0,int y1,int x){
y0&=0x7fff; /* mask off flag */
y1&=0x7fff;
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
asm volatile ("sub.l %[x0],%[x];"
"sub.l %[y0],%[y1];"
"sub.l %[x0],%[x1];"

View file

@ -763,7 +763,7 @@ int ov_clear(OggVorbis_File *vf){
int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
ov_callbacks callbacks){
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
/* this seems to be the closest we get to an init function, let's init emac
here. rounding is disabled because of MULT31_SHIFT15, which will be
inaccurate with rounding in its current incarnation */

View file

@ -141,7 +141,7 @@ typedef int16_t quantizer_t;
#if 0
#define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30))
#define MUL_L(a,b) ((int)(((int64_t)(a) * (b) + (1 << 25)) >> 26))
#elif defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#elif defined(CPU_COLDFIRE)
/* loses 1 bit of accuracy */
#define MUL(a, b) \
({ \

View file

@ -58,7 +58,7 @@ a52_state_t * a52_init (uint32_t mm_accel)
a52_state_t * state;
int i;
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_ROUND | EMAC_SATURATE);
#endif
/*

View file

@ -95,7 +95,7 @@ NeAACDecHandle NEAACDECAPI NeAACDecOpen(void)
uint8_t i;
NeAACDecHandle hDecoder = NULL;
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE);
#endif

View file

@ -59,7 +59,7 @@ typedef int32_t real_t;
#define Q2_PRECISION (1 << Q2_BITS)
#define Q2_CONST(A) (((A) >= 0) ? ((real_t)((A)*(Q2_PRECISION)+0.5)) : ((real_t)((A)*(Q2_PRECISION)-0.5)))
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
static INLINE real_t MUL_F(real_t A, real_t B)
{

View file

@ -42,9 +42,9 @@
#include "decoder.h"
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
#include "coldfire.h"
#elif defined(CPU_ARM) && !defined(SIMULATOR)
#elif defined(CPU_ARM)
#include "arm.h"
#endif
@ -260,11 +260,11 @@ static int decode_subframe_lpc(FLACContext *s, int32_t* decoded, int pred_order)
return -8;
if ((s->bps + coeff_prec + av_log2(pred_order)) <= 32) {
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
(void)sum;
lpc_decode_emac(s->blocksize - pred_order, qlevel, pred_order,
decoded + pred_order, coeffs);
#elif defined(CPU_ARM) && !defined(SIMULATOR)
#elif defined(CPU_ARM)
(void)sum;
lpc_decode_arm(s->blocksize - pred_order, qlevel, pred_order,
decoded + pred_order, coeffs);
@ -278,7 +278,7 @@ static int decode_subframe_lpc(FLACContext *s, int32_t* decoded, int pred_order)
}
#endif
} else {
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
(void)wsum;
(void)j;
lpc_decode_emac_wide(s->blocksize - pred_order, qlevel, pred_order,

View file

@ -82,7 +82,7 @@ static unsigned int get_uint(ShortenContext *s, int k)
return get_ur_golomb_shorten(&s->gb, k);
}
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
static void coldfire_lshift_samples(int n, int shift, int32_t *samples) ICODE_ATTR_FLAC;
static void coldfire_lshift_samples(int n, int shift, int32_t *samples)
{
@ -132,7 +132,7 @@ static inline void fix_bitshift(ShortenContext *s, int32_t *samples)
/* Wrapped samples don't get bitshifted, so we'll do them during
the next iteration. */
if (s->bitshift != 0) {
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
coldfire_lshift_samples(s->blocksize, s->bitshift, samples - s->nwrap);
#else
for (i = -s->nwrap; i < (s->blocksize - s->nwrap); i++)
@ -349,7 +349,7 @@ int shorten_decode_frames(ShortenContext *s, int *nsamples,
/* Scale the samples for the pcmbuf */
int scale = SHN_OUTPUT_DEPTH - s->bits_per_sample;
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
coldfire_lshift_samples(*nsamples, scale, decoded0 + s->nwrap);
coldfire_lshift_samples(*nsamples, scale, decoded1 + s->nwrap);
#else

View file

@ -24,9 +24,9 @@
# ifndef LIBMAD_GLOBAL_H
# define LIBMAD_GLOBAL_H
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
#define FPM_COLDFIRE_EMAC
#elif defined(CPU_ARM) && !defined(SIMULATOR)
#elif defined(CPU_ARM)
#define FPM_ARM
#define ASO_IMDCT
#else

View file

@ -46,7 +46,7 @@
# include "layer3.h"
/* depending on the cpu "leftshift32" may be supported or not */
# if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
# if defined(CPU_COLDFIRE)
#define MAXLSHIFT 32
#else
#define MAXLSHIFT 31
@ -1569,7 +1569,7 @@ void III_aliasreduce(mad_fixed_t xr[576], int lines)
# if defined(ASO_ZEROCHECK)
if (a | b) {
# endif
# if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
# if defined(CPU_COLDFIRE)
(void)hi, (void)lo;
asm volatile ("mac.l %[a], %[csi], %%acc0\n\t"
"msac.l %[b], %[cai], %%acc0\n\t"
@ -1796,7 +1796,7 @@ void imdct36(mad_fixed_t const x[18], mad_fixed_t y[36])
* DESCRIPTION: perform X[18]->x[36] IMDCT
*/
# if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
# if defined(CPU_COLDFIRE)
/* emac optimized imdct36, it is very ugly and i hope to replace it soon.
* for now it is actually somewhat faster than the stock implementation.
*/
@ -2813,7 +2813,7 @@ void III_imdct_l(mad_fixed_t const X[18], mad_fixed_t z[36],
* DESCRIPTION: perform IMDCT and windowing for short blocks
*/
# if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
# if defined(CPU_COLDFIRE)
void III_imdct_s(mad_fixed_t const X[18], mad_fixed_t z[36]);
#else

View file

@ -42,7 +42,7 @@ void mad_synth_init(struct mad_synth *synth)
synth->pcm.samplerate = 0;
synth->pcm.channels = 0;
synth->pcm.length = 0;
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
/* init the emac unit here, since this function should always be called
before using libmad */
coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE | EMAC_ROUND);

View file

@ -68,7 +68,7 @@ typedef mpc_int64_t MPC_SAMPLE_FORMAT_MULTIPLY;
#define MAKE_MPC_SAMPLE(X) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((mpc_int64_t)1)<<MPC_FIXED_POINT_FRACTPART))
#define MAKE_MPC_SAMPLE_EX(X,Y) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((mpc_int64_t)1)<<(Y)))
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
#define MPC_MULTIPLY(X,Y) mpc_multiply((X), (Y))
#define MPC_MULTIPLY_EX(X,Y,Z) mpc_multiply_ex((X), (Y), (Z))
@ -158,7 +158,7 @@ static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY_EX(MPC_SAMPLE_FORMAT item1,MPC_SAMP
#ifdef MPC_HAVE_MULHIGH
#define MPC_MULTIPLY_FRACT(X,Y) _MulHigh(X,Y)
#else
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
/* loses one bit of accuracy.
the rest of the macros won't be as easy as this... */
#define MPC_MULTIPLY_FRACT(X,Y) \

View file

@ -1492,7 +1492,7 @@ void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
d->Y_L = Y_L;
d->Y_R = Y_R;
#if defined(CPU_COLDFIRE)&& !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE);
#endif
}

View file

@ -343,7 +343,7 @@ static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPL
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
for ( k = 0; k < 32; k++, D += 16, V++ ) {
asm volatile (
"movem.l (%[D]), %%d0-%%d3 \n\t"
@ -372,7 +372,7 @@ static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPL
: [Data] "+a" (Data)
: [V] "a" (V), [D] "a" (D)
: "d0", "d1", "d2", "d3", "a5");
#elif defined(CPU_ARM) && !defined(SIMULATOR)
#elif defined(CPU_ARM)
for ( k = 0; k < 32; k++, V++ ) {
asm volatile (
"ldmia %[D]!, { r0-r3 } \n\t"

View file

@ -7,7 +7,7 @@
/* #undef ARM4_ASM */
/* Make use of ARM5E assembly optimizations */
#if defined(CPU_ARM) && !defined(SIMULATOR)
#if defined(CPU_ARM)
#define ARM4_ASM
#endif

View file

@ -286,9 +286,9 @@ int read_config_info (WavpackContext *wpc, WavpackMetadata *wpmd)
// samples unpacked, which can be less than the number requested if an error
// occurs or the end of the block is reached.
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
extern void decorr_stereo_pass_cont_mcf5249 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
#elif defined(CPU_ARM) && !defined(SIMULATOR)
#elif defined(CPU_ARM)
extern void decorr_stereo_pass_cont_arm (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
extern void decorr_stereo_pass_cont_arml (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
#else
@ -351,9 +351,9 @@ int32_t unpack_samples (WavpackContext *wpc, int32_t *buffer, uint32_t sample_co
else
for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
decorr_stereo_pass (dpp, buffer, 8);
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
#if defined(CPU_COLDFIRE)
decorr_stereo_pass_cont_mcf5249 (dpp, buffer + 16, sample_count - 8);
#elif defined(CPU_ARM) && !defined(SIMULATOR)
#elif defined(CPU_ARM)
if (((flags & MAG_MASK) >> MAG_LSB) > 15)
decorr_stereo_pass_cont_arml (dpp, buffer + 16, sample_count - 8);
else
@ -525,7 +525,7 @@ static void decorr_stereo_pass (struct decorr_pass *dpp, int32_t *buffer, int32_
dpp->weight_B = weight_B;
}
#if (!defined(CPU_COLDFIRE) && !defined(CPU_ARM)) || defined(SIMULATOR)
#if (!defined(CPU_COLDFIRE) && !defined(CPU_ARM))
static void decorr_stereo_pass_cont (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
{