Browse Source

Fix arm_math.h warnings

teensy4-core
PaulStoffregen 11 years ago
parent
commit
c12ece0e4c
3 changed files with 17 additions and 17 deletions
  1. +0
    -1
      README.md
  2. +0
    -2
      teensy3/AudioStream.h
  3. +17
    -14
      teensy3/arm_math.h

+ 0
- 1
README.md View File

http://www.pjrc.com/teensy/td_download.html http://www.pjrc.com/teensy/td_download.html




This github repository contains work-in-progress code, which may not be stable. It is not recommended for use in actual projects.



+ 0
- 2
teensy3/AudioStream.h View File

cpu_cycles = 0; cpu_cycles = 0;
cpu_cycles_max = 0; cpu_cycles_max = 0;
} }
void connect(AudioStream &dest, unsigned char dest_index = 0, unsigned int src_index = 0);
void disconnect(void);
static void initialize_memory(audio_block_t *data, unsigned int num); static void initialize_memory(audio_block_t *data, unsigned int num);
int processorUsage(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles); } int processorUsage(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles); }
int processorUsageMax(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles_max); } int processorUsageMax(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles_max); }

+ 17
- 14
teensy3/arm_math.h View File

#else #else


/* acc += A1 * x[n-1] + A2 * x[n-2] */ /* acc += A1 * x[n-1] + A2 * x[n-2] */
acc = __SMLALD(S->A1, (q31_t) __SIMD32(S->state), acc);
// TODO: this single-instruction version causes a gcc strict-aliasing warning
//acc = __SMLALD(S->A1, (q31_t) __SIMD32(S->state), acc);
uint32_t state = (uint32_t)S->state[0] | ((uint32_t)S->state[1] << 16);
acc = __SMLALD(S->A1, state, acc);


#endif #endif


/* Iniatilize output for below specified range as least output value of table */ /* Iniatilize output for below specified range as least output value of table */
y = pYData[0]; y = pYData[0];
} }
else if(i >= S->nValues)
else if((uint32_t)i >= S->nValues)
{ {
/* Iniatilize output for above specified range as last output value of table */ /* Iniatilize output for above specified range as last output value of table */
y = pYData[S->nValues - 1]; y = pYData[S->nValues - 1];
/* Index value calculation */ /* Index value calculation */
index = ((x & 0xFFF00000) >> 20); index = ((x & 0xFFF00000) >> 20);


if(index >= (nValues - 1))
if(index < 0)
{ {
return (pYData[nValues - 1]);
return (pYData[0]);
} }
else if(index < 0)
else if((uint32_t)index >= (nValues - 1))
{ {
return (pYData[0]);
return (pYData[nValues - 1]);
} }
else else
{ {
/* Index value calculation */ /* Index value calculation */
index = ((x & 0xFFF00000) >> 20u); index = ((x & 0xFFF00000) >> 20u);


if(index >= (nValues - 1))
if(index < 0)
{ {
return (pYData[nValues - 1]);
return (pYData[0]);
} }
else if(index < 0)
else if((uint32_t)index >= (nValues - 1))
{ {
return (pYData[0]);
return (pYData[nValues - 1]);
} }
else else
{ {
index = ((x & 0xFFF00000) >> 20u); index = ((x & 0xFFF00000) >> 20u);




if(index >= (nValues - 1))
if(index < 0)
{ {
return (pYData[nValues - 1]);
return (pYData[0]);
} }
else if(index < 0)
else if((uint32_t)index >= (nValues - 1))
{ {
return (pYData[0]);
return (pYData[nValues - 1]);
} }
else else
{ {

Loading…
Cancel
Save