basic_math_functions_f16.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /******************************************************************************
  2. * @file basic_math_functions_f16.h
  3. * @brief Public header file for CMSIS DSP Library
  4. * @version V1.9.0
  5. * @date 20. July 2020
  6. ******************************************************************************/
  7. /*
  8. * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved.
  9. *
  10. * SPDX-License-Identifier: Apache-2.0
  11. *
  12. * Licensed under the Apache License, Version 2.0 (the License); you may
  13. * not use this file except in compliance with the License.
  14. * You may obtain a copy of the License at
  15. *
  16. * www.apache.org/licenses/LICENSE-2.0
  17. *
  18. * Unless required by applicable law or agreed to in writing, software
  19. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  20. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. * See the License for the specific language governing permissions and
  22. * limitations under the License.
  23. */
  24. #ifndef _BASIC_MATH_FUNCTIONS_F16_H_
  25. #define _BASIC_MATH_FUNCTIONS_F16_H_
  26. #ifdef __cplusplus
  27. extern "C"
  28. {
  29. #endif
  30. #include "arm_math_types_f16.h"
  31. #include "arm_math_memory.h"
  32. #include "dsp/none.h"
  33. #include "dsp/utils.h"
  34. #if defined(ARM_FLOAT16_SUPPORTED)
  35. /**
  36. * @brief Floating-point vector addition.
  37. * @param[in] pSrcA points to the first input vector
  38. * @param[in] pSrcB points to the second input vector
  39. * @param[out] pDst points to the output vector
  40. * @param[in] blockSize number of samples in each vector
  41. */
  42. void arm_add_f16(
  43. const float16_t * pSrcA,
  44. const float16_t * pSrcB,
  45. float16_t * pDst,
  46. uint32_t blockSize);
  47. /**
  48. * @brief Floating-point vector subtraction.
  49. * @param[in] pSrcA points to the first input vector
  50. * @param[in] pSrcB points to the second input vector
  51. * @param[out] pDst points to the output vector
  52. * @param[in] blockSize number of samples in each vector
  53. */
  54. void arm_sub_f16(
  55. const float16_t * pSrcA,
  56. const float16_t * pSrcB,
  57. float16_t * pDst,
  58. uint32_t blockSize);
  59. /**
  60. * @brief Multiplies a floating-point vector by a scalar.
  61. * @param[in] pSrc points to the input vector
  62. * @param[in] scale scale factor to be applied
  63. * @param[out] pDst points to the output vector
  64. * @param[in] blockSize number of samples in the vector
  65. */
  66. void arm_scale_f16(
  67. const float16_t * pSrc,
  68. float16_t scale,
  69. float16_t * pDst,
  70. uint32_t blockSize);
  71. /**
  72. * @brief Floating-point vector absolute value.
  73. * @param[in] pSrc points to the input buffer
  74. * @param[out] pDst points to the output buffer
  75. * @param[in] blockSize number of samples in each vector
  76. */
  77. void arm_abs_f16(
  78. const float16_t * pSrc,
  79. float16_t * pDst,
  80. uint32_t blockSize);
  81. /**
  82. * @brief Adds a constant offset to a floating-point vector.
  83. * @param[in] pSrc points to the input vector
  84. * @param[in] offset is the offset to be added
  85. * @param[out] pDst points to the output vector
  86. * @param[in] blockSize number of samples in the vector
  87. */
  88. void arm_offset_f16(
  89. const float16_t * pSrc,
  90. float16_t offset,
  91. float16_t * pDst,
  92. uint32_t blockSize);
  93. /**
  94. * @brief Dot product of floating-point vectors.
  95. * @param[in] pSrcA points to the first input vector
  96. * @param[in] pSrcB points to the second input vector
  97. * @param[in] blockSize number of samples in each vector
  98. * @param[out] result output result returned here
  99. */
  100. void arm_dot_prod_f16(
  101. const float16_t * pSrcA,
  102. const float16_t * pSrcB,
  103. uint32_t blockSize,
  104. float16_t * result);
  105. /**
  106. * @brief Floating-point vector multiplication.
  107. * @param[in] pSrcA points to the first input vector
  108. * @param[in] pSrcB points to the second input vector
  109. * @param[out] pDst points to the output vector
  110. * @param[in] blockSize number of samples in each vector
  111. */
  112. void arm_mult_f16(
  113. const float16_t * pSrcA,
  114. const float16_t * pSrcB,
  115. float16_t * pDst,
  116. uint32_t blockSize);
  117. /**
  118. * @brief Negates the elements of a floating-point vector.
  119. * @param[in] pSrc points to the input vector
  120. * @param[out] pDst points to the output vector
  121. * @param[in] blockSize number of samples in the vector
  122. */
  123. void arm_negate_f16(
  124. const float16_t * pSrc,
  125. float16_t * pDst,
  126. uint32_t blockSize);
  127. #endif /* defined(ARM_FLOAT16_SUPPORTED)*/
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif /* ifndef _BASIC_MATH_FUNCTIONS_F16_H_ */