Skip to content

Commit

Permalink
CMSIS-DSP: Correction for issue ARM-software#1130
Browse files Browse the repository at this point in the history
Better control of the f16 build.
  • Loading branch information
christophe0606 committed Feb 19, 2021
1 parent d08d049 commit 9f52415
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion CMSIS/DSP/Include/arm_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@
* - DISABLEFLOAT16:
*
* Disable float16 algorithms when __fp16 is not supported for a
* specific compiler / core configuration
* specific compiler / core configuration.
* This is only valid for scalar. When vector architecture is
* supporting f16 then it can't be disabled.
*
* <hr>
* \section pack CMSIS-DSP in ARM::CMSIS Pack
Expand Down
14 changes: 7 additions & 7 deletions CMSIS/DSP/Include/arm_math_types_f16.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ won't be built.
*/
#if !(__ARM_FEATURE_MVE & 2)
#if defined(__ARM_FP16_FORMAT_IEEE) || defined(__ARM_FP16_FORMAT_ALTERNATIVE)
typedef __fp16 float16_t;
#define ARM_FLOAT16_SUPPORTED
#endif
#else
/* HW Float16 not yet well supported on some configs */
#if !defined(DISABLEFLOAT16)
#define ARM_FLOAT16_SUPPORTED
#if defined(__ARM_FP16_FORMAT_IEEE) || defined(__ARM_FP16_FORMAT_ALTERNATIVE)
typedef __fp16 float16_t;
#define ARM_FLOAT16_SUPPORTED
#endif
#endif
#else
/* When Vector float16, this flag is always defined and can't be disabled */
#define ARM_FLOAT16_SUPPORTED
#endif

#if defined(ARM_MATH_NEON) || (defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)) /* floating point vector*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
This Function also initializes Twiddle factor table pointer and Bit reversal table pointer.
*/

#if defined(ARM_FLOAT16_SUPPORTED)

arm_status arm_cfft_radix2_init_f16(
arm_cfft_radix2_instance_f16 * S,
uint16_t fftLen,
Expand Down Expand Up @@ -203,6 +205,7 @@ arm_status arm_cfft_radix2_init_f16(
return (status);
}

#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */
/**
@} end of ComplexFFT group
*/
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
This Function also initializes Twiddle factor table pointer and Bit reversal table pointer.
*/

#if defined(ARM_FLOAT16_SUPPORTED)

arm_status arm_cfft_radix4_init_f16(
arm_cfft_radix4_instance_f16 * S,
uint16_t fftLen,
Expand Down Expand Up @@ -163,7 +165,7 @@ arm_status arm_cfft_radix4_init_f16(
#endif
return (status);
}

#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */
/**
@} end of ComplexFFT group
*/

0 comments on commit 9f52415

Please sign in to comment.