arm_f16_to_f64.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* ----------------------------------------------------------------------
  2. * Project: CMSIS DSP Library
  3. * Title: arm_f16_to_f64.c
  4. * Description: Converts the elements of the floating-point 16 bit vector to floating-point 64 bit vector
  5. *
  6. * $Date: 18 August 2022
  7. * $Revision: V1.0.0
  8. *
  9. * Target Processor: Cortex-M and Cortex-A cores
  10. * -------------------------------------------------------------------- */
  11. /*
  12. * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved.
  13. *
  14. * SPDX-License-Identifier: Apache-2.0
  15. *
  16. * Licensed under the Apache License, Version 2.0 (the License); you may
  17. * not use this file except in compliance with the License.
  18. * You may obtain a copy of the License at
  19. *
  20. * www.apache.org/licenses/LICENSE-2.0
  21. *
  22. * Unless required by applicable law or agreed to in writing, software
  23. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  24. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  25. * See the License for the specific language governing permissions and
  26. * limitations under the License.
  27. */
  28. #include "dsp/support_functions_f16.h"
  29. #if defined(ARM_FLOAT16_SUPPORTED)
  30. /**
  31. @ingroup groupSupport
  32. */
  33. /**
  34. @addtogroup f16_to_x
  35. @{
  36. */
  37. /**
  38. @brief Converts the elements of the f16 vector to f64 vector.
  39. @param[in] pSrc points to the f16 input vector
  40. @param[out] pDst points to the f64 output vector
  41. @param[in] blockSize number of samples in each vector
  42. */
  43. void arm_f16_to_f64(
  44. const float16_t * pSrc,
  45. float64_t * pDst,
  46. uint32_t blockSize)
  47. {
  48. const float16_t *pIn = pSrc; /* Src pointer */
  49. uint32_t blkCnt; /* loop counter */
  50. /*
  51. * Loop over blockSize number of values
  52. */
  53. blkCnt = blockSize;
  54. while (blkCnt > 0U)
  55. {
  56. *pDst++ = (float64_t) * pIn++;
  57. /*
  58. * Decrement the loop counter
  59. */
  60. blkCnt--;
  61. }
  62. }
  63. /**
  64. @} end of f16_to_x group
  65. */
  66. #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */