Marat Dukhan | 6adff4e | 2019-10-14 18:32:07 -0700 | [diff] [blame] | 1 | // Copyright 2019 Google LLC |
| 2 | // |
| 3 | // This source code is licensed under the BSD-style license found in the |
| 4 | // LICENSE file in the root directory of this source tree. |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | #include <stddef.h> |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | typedef void (*xnn_f32_unary_math_function)( |
| 16 | size_t n, |
| 17 | const float* input, |
| 18 | float* output); |
| 19 | |
Marat Dukhan | 98ba441 | 2019-10-23 02:14:28 -0700 | [diff] [blame] | 20 | typedef void (*xnn_f32_ext_unary_math_function)( |
| 21 | size_t n, |
| 22 | const float* input, |
| 23 | float* output_mantissa, |
| 24 | float* output_exponent); |
| 25 | |
Marat Dukhan | 6adff4e | 2019-10-14 18:32:07 -0700 | [diff] [blame] | 26 | #define DECLARE_F32_UNARY_MATH_FUNCTION(fn_name) \ |
| 27 | void fn_name( \ |
| 28 | size_t n, \ |
| 29 | const float* input, \ |
| 30 | float* output); |
| 31 | |
Marat Dukhan | 98ba441 | 2019-10-23 02:14:28 -0700 | [diff] [blame] | 32 | #define DECLARE_F32_EXT_UNARY_MATH_FUNCTION(fn_name) \ |
| 33 | void fn_name( \ |
| 34 | size_t n, \ |
| 35 | const float* input, \ |
| 36 | float* output_mantissa, \ |
| 37 | float* output_exponent); |
| 38 | |
Marat Dukhan | 075088a | 2020-05-12 19:42:12 -0700 | [diff] [blame] | 39 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__neon_addsub) |
Marat Dukhan | 8853b82 | 2020-05-07 12:19:01 -0700 | [diff] [blame] | 40 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__neonv8) |
Marat Dukhan | 075088a | 2020-05-12 19:42:12 -0700 | [diff] [blame] | 41 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__sse_addsub) |
| 42 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__sse2_cvt) |
Marat Dukhan | 8853b82 | 2020-05-07 12:19:01 -0700 | [diff] [blame] | 43 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__sse41) |
Marat Dukhan | 075088a | 2020-05-12 19:42:12 -0700 | [diff] [blame] | 44 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__psimd_addsub) |
| 45 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__scalar_addsub) |
Marat Dukhan | ffbf96a | 2020-05-14 02:59:08 -0700 | [diff] [blame] | 46 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__scalar_nearbyint) |
| 47 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundne__scalar_rint) |
Marat Dukhan | 8853b82 | 2020-05-07 12:19:01 -0700 | [diff] [blame] | 48 | |
Marat Dukhan | c9852ba | 2020-05-13 17:21:29 -0700 | [diff] [blame] | 49 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__neon_addsub) |
| 50 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__neon_cvt) |
| 51 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__neonv8) |
| 52 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__sse_addsub) |
| 53 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__sse2_cvt) |
| 54 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__sse41) |
| 55 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__psimd_addsub) |
| 56 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__scalar_addsub) |
| 57 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__scalar_cvt) |
Marat Dukhan | ffbf96a | 2020-05-14 02:59:08 -0700 | [diff] [blame] | 58 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundd__scalar_floor) |
Marat Dukhan | c9852ba | 2020-05-13 17:21:29 -0700 | [diff] [blame] | 59 | |
| 60 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__neon_addsub) |
| 61 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__neon_cvt) |
| 62 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__neonv8) |
| 63 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__sse_addsub) |
| 64 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__sse2_cvt) |
| 65 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__sse41) |
| 66 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__psimd_addsub) |
| 67 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__scalar_addsub) |
Marat Dukhan | ffbf96a | 2020-05-14 02:59:08 -0700 | [diff] [blame] | 68 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__scalar_ceil) |
Marat Dukhan | c9852ba | 2020-05-13 17:21:29 -0700 | [diff] [blame] | 69 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundu__scalar_cvt) |
| 70 | |
Marat Dukhan | 2dbb944 | 2020-05-12 20:43:43 -0700 | [diff] [blame] | 71 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__neon_addsub) |
| 72 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__neon_cvt) |
| 73 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__neonv8) |
| 74 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__sse_addsub) |
| 75 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__sse2_cvt) |
| 76 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__sse41) |
| 77 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__psimd_addsub) |
| 78 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__scalar_addsub) |
| 79 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__scalar_cvt) |
Marat Dukhan | ffbf96a | 2020-05-14 02:59:08 -0700 | [diff] [blame] | 80 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_roundz__scalar_trunc) |
Marat Dukhan | 2dbb944 | 2020-05-12 20:43:43 -0700 | [diff] [blame] | 81 | |
Marat Dukhan | 797a8fe | 2019-11-14 20:21:57 -0800 | [diff] [blame] | 82 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__neonfma_lut64_p2) |
| 83 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__neonfma_p5) |
Marat Dukhan | ffd6840 | 2019-11-15 15:19:11 -0800 | [diff] [blame] | 84 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__sse2_p5) |
Marat Dukhan | 6adff4e | 2019-10-14 18:32:07 -0700 | [diff] [blame] | 85 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx2_p5) |
| 86 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx2_perm_p3) |
| 87 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx2_perm_p4) |
| 88 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx512f_p5) |
| 89 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx512f_p5_scalef) |
| 90 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx512f_perm_p3) |
Marat Dukhan | feb4923 | 2019-10-28 11:03:31 -0700 | [diff] [blame] | 91 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_exp__avx512f_perm2_p2) |
Marat Dukhan | 6adff4e | 2019-10-14 18:32:07 -0700 | [diff] [blame] | 92 | |
Marat Dukhan | 346a9e5 | 2019-11-15 09:06:30 -0800 | [diff] [blame] | 93 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__neonfma_p5) |
Marat Dukhan | 189ae80 | 2019-11-26 11:28:44 -0800 | [diff] [blame] | 94 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__neonfma_lut64_p2) |
| 95 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__neonfma_lut2048_p1) |
Marat Dukhan | 5e9a91e | 2019-12-22 19:13:03 -0800 | [diff] [blame] | 96 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__sse2_p5) |
| 97 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__avx2_p5) |
| 98 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__scalar_p5) |
| 99 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__scalar_lut64_p2) |
| 100 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_expminus__scalar_lut2048_p1) |
Marat Dukhan | 515c977 | 2019-10-17 18:07:57 -0700 | [diff] [blame] | 101 | |
Marat Dukhan | 98ba441 | 2019-10-23 02:14:28 -0700 | [diff] [blame] | 102 | DECLARE_F32_EXT_UNARY_MATH_FUNCTION(xnn_math_f32_extexp__avx2_p5) |
| 103 | DECLARE_F32_EXT_UNARY_MATH_FUNCTION(xnn_math_f32_extexp__avx512f_p5) |
| 104 | |
Marat Dukhan | 68b3b45 | 2020-01-02 10:11:15 -0800 | [diff] [blame] | 105 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_frac_p9_p10_nr1recps) |
Marat Dukhan | 77221d3 | 2020-01-06 10:04:39 -0800 | [diff] [blame] | 106 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_rr1_lut2048_p1_nr2recps) |
| 107 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut2048_p1_nr2recps) |
| 108 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut2048_p1_nr1recps1fma) |
| 109 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut2048_p1_nr2fma) |
| 110 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut2048_p1_div) |
| 111 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_rr2_lut2048_p1_nr2recps) |
| 112 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut2048_p1_nr2recps) |
| 113 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut2048_p1_nr1recps1fma) |
| 114 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut2048_p1_nr2fma) |
| 115 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut2048_p1_div) |
| 116 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_rr1_lut64_p2_nr2recps) |
| 117 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut64_p2_nr2recps) |
| 118 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut64_p2_nr1recps1fma) |
| 119 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut64_p2_nr2fma) |
| 120 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_lut64_p2_div) |
| 121 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_rr2_lut64_p2_nr2recps) |
| 122 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut64_p2_nr2recps) |
| 123 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut64_p2_nr1recps1fma) |
| 124 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut64_p2_nr2fma) |
| 125 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_lut64_p2_div) |
| 126 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_rr1_p5_nr2recps) |
| 127 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_p5_nr2recps) |
| 128 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_p5_nr1recps1fma) |
| 129 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_p5_nr2fma) |
| 130 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr1_p5_div) |
| 131 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neon_rr2_p5_nr2recps) |
| 132 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_p5_nr2recps) |
| 133 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_p5_nr1recps1fma) |
| 134 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_p5_nr2fma) |
| 135 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__neonfma_rr2_p5_div) |
Marat Dukhan | 80bafd2 | 2019-11-18 10:16:01 -0800 | [diff] [blame] | 136 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__sse2_p5_div) |
Marat Dukhan | 7241600 | 2020-01-05 21:53:19 -0800 | [diff] [blame] | 137 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__avx2_rr2_p5_div) |
| 138 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__avx2_rr2_p5_nr2fma) |
| 139 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__avx2_rr2_p5_nr1fma) |
| 140 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__avx2_rr1_p5_div) |
| 141 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__avx2_rr1_p5_nr2fma) |
| 142 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__avx2_rr1_p5_nr1fma) |
Marat Dukhan | 8d3c07e | 2020-01-02 01:20:59 -0800 | [diff] [blame] | 143 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__psimd_p5_div) |
Marat Dukhan | 5739f70 | 2019-12-22 19:45:09 -0800 | [diff] [blame] | 144 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__scalar_p5_div) |
| 145 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__scalar_lut64_p2_div) |
| 146 | DECLARE_F32_UNARY_MATH_FUNCTION(xnn_math_f32_sigmoid__scalar_lut2048_p1_div) |
Marat Dukhan | 346a9e5 | 2019-11-15 09:06:30 -0800 | [diff] [blame] | 147 | |
Marat Dukhan | 6adff4e | 2019-10-14 18:32:07 -0700 | [diff] [blame] | 148 | #ifdef __cplusplus |
| 149 | } /* extern "C" */ |
| 150 | #endif |