Modification to arm_math.h

Remove redefinition of __CLZ and __SSAT.
pull/5342/head
Bartek Szatkowski 2017-10-20 13:51:20 -05:00
parent c5a5438256
commit 6e11dc2c4a
2 changed files with 0 additions and 108 deletions

View File

@ -572,32 +572,6 @@ extern "C"
(((q63_t) (x >> 32) * y))); (((q63_t) (x >> 32) * y)));
} }
/*
#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM )
#define __CLZ __clz
#endif
*/
/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */
#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) )
CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ(
q31_t data);
CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ(
q31_t data)
{
uint32_t count = 0;
uint32_t mask = 0x80000000;
while ((data & mask) == 0)
{
count += 1u;
mask = mask >> 1u;
}
return (count);
}
#endif
/** /**
* @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type.
*/ */
@ -700,47 +674,6 @@ extern "C"
return (signBits + 1); return (signBits + 1);
} }
/*
* @brief C custom defined intrinisic function for only M0 processors
*/
#if defined(ARM_MATH_CM0_FAMILY)
CMSIS_INLINE __STATIC_INLINE q31_t __SSAT(
q31_t x,
uint32_t y)
{
int32_t posMax, negMin;
uint32_t i;
posMax = 1;
for (i = 0; i < (y - 1); i++)
{
posMax = posMax * 2;
}
if (x > 0)
{
posMax = (posMax - 1);
if (x > posMax)
{
x = posMax;
}
}
else
{
negMin = -posMax;
if (x < negMin)
{
x = negMin;
}
}
return (x);
}
#endif /* end of ARM_MATH_CM0_FAMILY */
/* /*
* @brief C custom defined intrinsic function for M3 and M0 processors * @brief C custom defined intrinsic function for M3 and M0 processors
*/ */

View File

@ -659,47 +659,6 @@ extern "C"
return (signBits + 1); return (signBits + 1);
} }
/*
* @brief C custom defined intrinisic function for only M0 processors
*/
#if defined(ARM_MATH_CM0_FAMILY)
static __INLINE q31_t __SSAT(
q31_t x,
uint32_t y)
{
int32_t posMax, negMin;
uint32_t i;
posMax = 1;
for (i = 0; i < (y - 1); i++)
{
posMax = posMax * 2;
}
if(x > 0)
{
posMax = (posMax - 1);
if(x > posMax)
{
x = posMax;
}
}
else
{
negMin = -posMax;
if(x < negMin)
{
x = negMin;
}
}
return (x);
}
#endif /* end of ARM_MATH_CM0_FAMILY */
/* /*
* @brief C custom defined intrinsic function for M3 and M0 processors * @brief C custom defined intrinsic function for M3 and M0 processors
*/ */