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

@@ -5,5 +5,4 @@ The latest stable version of Teensy's core library is always available in the Te
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

@@ -108,8 +108,6 @@ public:
cpu_cycles = 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);
int processorUsage(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles); }
int processorUsageMax(void) { return CYCLE_COUNTER_APPROX_PERCENT(cpu_cycles_max); }

+ 17
- 14
teensy3/arm_math.h View File

@@ -5326,7 +5326,10 @@ extern "C"
#else

/* 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

@@ -5900,7 +5903,7 @@ extern "C"
/* Iniatilize output for below specified range as least output value of table */
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 */
y = pYData[S->nValues - 1];
@@ -5954,13 +5957,13 @@ extern "C"
/* Index value calculation */
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
{
@@ -6016,13 +6019,13 @@ extern "C"
/* Index value calculation */
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
{
@@ -6077,13 +6080,13 @@ extern "C"
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
{

Loading…
Cancel
Save