aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/NEON/NEFixedPoint.h
blob: fb712611cb53fb38e593d692c7f9abd147267b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
/*
 * Copyright (c) 2017 ARM Limited.
 *
 * SPDX-License-Identifier: MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#ifndef __ARM_COMPUTE_NEFIXEDPOINT_H__
#define __ARM_COMPUTE_NEFIXEDPOINT_H__

#include "arm_compute/core/FixedPoint.h"

#include <arm_neon.h>

namespace arm_compute
{
using qint8x8_t    = int8x8_t;    /**< 8 bit fixed point vector with 8 elements */
using qint8x8x2_t  = int8x8x2_t;  /**< 8 bit fixed point vector with 16 elements */
using qint8x8x3_t  = int8x8x3_t;  /**< 8 bit fixed point vector with 24 elements */
using qint8x8x4_t  = int8x8x4_t;  /**< 8 bit fixed point vector with 32 elements */
using qint8x16_t   = int8x16_t;   /**< 8 bit fixed point vector with 16 elements */
using qint8x16x2_t = int8x16x2_t; /**< 8 bit fixed point vector with 32 elements */
using qint8x16x3_t = int8x16x3_t; /**< 8 bit fixed point vector with 48 elements */
using qint8x16x4_t = int8x16x4_t; /**< 8 bit fixed point vector with 64 elements */
using qint16x4_t   = int16x4_t;   /**< 16 bit fixed point vector with 4 elements */
using qint16x4x2_t = int16x4x2_t; /**< 16 bit fixed point vector with 8 elements */
using qint16x4x3_t = int16x4x3_t; /**< 16 bit fixed point vector with 12 elements */
using qint16x4x4_t = int16x4x4_t; /**< 16 bit fixed point vector with 16 elements */
using qint16x8_t   = int16x8_t;   /**< 16 bit fixed point vector with 8 elements */
using qint16x8x2_t = int16x8x2_t; /**< 16 bit fixed point vector with 16 elements */
using qint16x8x3_t = int16x8x3_t; /**< 16 bit fixed point vector with 24 elements */
using qint16x8x4_t = int16x8x4_t; /**< 16 bit fixed point vector with 32 elements */

/** Get the lower half of a 16 elements vector
 *
 * @param[in] a vector of 16 elements
 *
 * @return 8 bit fixed point vector (8 elements)
 */
qint8x8_t vget_low_qs8(qint8x16_t a);

/** Get the higher half of a 16 elements vector
 *
 * @param[in] a vector of 16 elements
 *
 * @return 8 bit fixed point vector (8 elements)
 */
qint8x8_t vget_high_qs8(qint8x16_t a);

/** Load a single 8 bit fixed point vector from memory (8 elements)
 *
 * @param[in] addr Memory address of the 8 bit fixed point vector to load
 *
 * @return 8 bit fixed point vector (8 elements)
 */
qint8x8_t vld1_qs8(const qint8_t *addr);

/** Load a single 8 bit fixed point vector from memory (16 elements)
 *
 * @param[in] addr Memory address of the 8 bit fixed point vector to load
 *
 * @return 8 bit fixed point vector (16 elements)
 */
qint8x16_t vld1q_qs8(const qint8_t *addr);

/** Load a single 16 bit fixed point vector from memory (4 elements)
 *
 * @param[in] addr Memory address of the 16 bit fixed point vector to load
 *
 * @return 16 bit fixed point vector (4 elements)
 */
qint16x4_t vld1_qs16(const qint16_t *addr);

/** Load a single 16 bit fixed point vector from memory (8 elements)
 *
 * @param[in] addr Memory address of the 16 bit fixed point vector to load
 *
 * @return 16 bit fixed point vector (8 elements)
 */
qint16x8_t vld1q_qs16(const qint16_t *addr);

/** Load all lanes of 8 bit fixed point vector with same value from memory (8 elements)
 *
 * @param[in] addr Memory address of the 8 bit fixed point scalar value to load
 *
 * @return 8 bit fixed point vector (8 elements)
 */
qint8x8_t vld1_dup_qs8(const qint8_t *addr);

/** Load all lanes of 8 bit fixed point vector with same value from memory (16 elements)
 *
 * @param[in] addr Memory address of the 8 bit fixed point scalar value to load
 *
 * @return 8 bit fixed point vector (16 elements)
 */
qint8x16_t vld1q_dup_qs8(const qint8_t *addr);

/** Store a single 8 bit fixed point vector to memory (8 elements)
 *
 * @param[in] addr Memory address where the 8 bit fixed point vector should be stored
 * @param[in] b    8 bit fixed point vector to store
 *
 */
void vst1_qs8(qint8_t *addr, qint8x8_t b);

/** Store a single 8 bit fixed point vector to memory (16 elements)
 *
 * @param[in] addr Memory address where the 8 bit fixed point vector should be stored
 * @param[in] b    8 bit fixed point vector to store
 *
 */
void vst1q_qs8(qint8_t *addr, qint8x16_t b);

/** Store a single 16 bit fixed point vector to memory (4 elements)
 *
 * @param[in] addr Memory address where the 16 bit fixed point vector should be stored
 * @param[in] b    16 bit fixed point vector to store
 *
 */
void vst1_qs16(qint16_t *addr, qint16x4_t b);

/** Store a single 8 bit fixed point vector to memory (16 elements)
 *
 * @param[in] addr Memory address where the 16 bit fixed point vector should be stored
 * @param[in] b    16 bit fixed point vector to store
 *
 */
void vst1q_qs16(qint16_t *addr, qint16x8_t b);

/** 16 bit fixed point vector saturating narrow (8 elements)
 *
 * @param[in] a 16 bit fixed point vector to convert
 *
 * @return 8 bit fixed point vector
 */
qint8x8_t vqmovn_q16(qint16x8_t a);

/** 8 bit fixed point vector duplicate (8 elements)
 *
 * @param[in] a 8 bit fixed point to duplicate
 *
 * @return The result of the vector duplication
 */
qint8x8_t vdup_n_qs8(qint8_t a);

/** 8 bit fixed point vector duplicate (16 elements)
 *
 * @param[in] a 8 bit fixed point to duplicate
 *
 * @return The result of the vector duplication
 */
qint8x16_t vdupq_n_qs8(qint8_t a);

/** Duplicate a float and convert it to 8 bit fixed point vector (16 elements)
 *
 * @param[in] a                    8 bit fixed point to duplicate
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the vector duplication
 */
qint8x16_t vdupq_n_qs8_f32(float a, int fixed_point_position);

/** 16 bit fixed point vector duplicate (8 elements)
 *
 * @param[in] a 16 bit fixed point to duplicate
 *
 * @return The result of the vector duplication
 */
qint16x8_t vdupq_n_qs16(qint16x8_t a);

/** Absolute value of 8 bit fixed point vector (8 elements)
 *
 * @param[in] a 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector absolute value
 */
qint8x8_t vabs_qs8(qint8x8_t a);

/** Absolute value of 8 bit fixed point vector (16 elements)
 *
 * @param[in] a 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector absolute value
 */
qint8x16_t vabsq_qs8(qint8x16_t a);

/** Saturating absolute value of 8 bit fixed point vector (8 elements)
 *
 * @param[in] a 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector absolute value
 */
qint8x8_t vqabs_qs8(qint8x8_t a);

/** Saturating absolute value of 8 bit fixed point vector (16 elements)
 *
 * @param[in] a 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector absolute value
 */
qint8x16_t vqabsq_qs8(qint8x16_t a);

/** 8 bit fixed point vector max (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector max operation
 */
qint8x8_t vmax_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector max (16 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector max operation
 */
qint8x16_t vmaxq_qs8(qint8x16_t a, qint8x16_t b);

/** 8 bit fixed point vector pairwise max (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector pairwise max operation
 */
qint8x8_t vpmax_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector min (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector max operation
 */
qint8x8_t vmin_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector min (16 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector min operation
 */
qint8x16_t vminq_qs8(qint8x16_t a, qint8x16_t b);

/** 8 bit fixed point vector pairwise min (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector pairwise min operation
 */
qint8x8_t vpmin_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector add (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector addition
 */
qint8x8_t vadd_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector add (16 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector addition
 */
qint8x16_t vaddq_qs8(qint8x16_t a, qint8x16_t b);

/** 8 bit fixed point vector saturating add (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector addition. The result is saturated in case of overflow
 */
qint8x8_t vqadd_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector saturating add (16 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector addition. The result is saturated in case of overflow
 */
qint8x16_t vqaddq_qs8(qint8x16_t a, qint8x16_t b);

/** 16 bit fixed point vector saturating add (4 elements)
 *
 * @param[in] a First 16 bit fixed point input vector
 * @param[in] b Second 16 bit fixed point input vector
 *
 * @return The result of the 16 bit fixed point vector addition. The result is saturated in case of overflow
 */
qint16x4_t vqadd_qs16(qint16x4_t a, qint16x4_t b);

/** 16 bit fixed point vector saturating add (8 elements)
 *
 * @param[in] a First 16 bit fixed point input vector
 * @param[in] b Second 16 bit fixed point input vector
 *
 * @return The result of the 16 bit fixed point vector addition. The result is saturated in case of overflow
 */
qint16x8_t vqaddq_qs16(qint16x8_t a, qint16x8_t b);

/** 8 bit fixed point vector saturating pairwise add (8 elements)
 *
 * @param[in] a 8 bit fixed point input vector
 *
 * @return The result of the 16 bit fixed point vector addition. The result is saturated in case of overflow
 */
int16x4_t vpaddl_qs8(qint8x8_t a);

/** 8 bit fixed point vector subtraction (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector subtraction
 */
qint8x8_t vsub_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector subtraction (16 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector subtraction
 */
qint8x16_t vsubq_qs8(qint8x16_t a, qint8x16_t b);

/** 8 bit fixed point vector saturating subtraction (8 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector subtraction. The result is saturated in case of overflow
 */
qint8x8_t vqsub_qs8(qint8x8_t a, qint8x8_t b);

/** 8 bit fixed point vector saturating subtraction (16 elements)
 *
 * @param[in] a First 8 bit fixed point input vector
 * @param[in] b Second 8 bit fixed point input vector
 *
 * @return The result of the 8 bit fixed point vector subtraction. The result is saturated in case of overflow
 */
qint8x16_t vqsubq_qs8(qint8x16_t a, qint8x16_t b);

/** 8 bit fixed point vector multiply (8 elements)
 *
 * @param[in] a                    First 8 bit fixed point input vector
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiplication.
 */
qint8x8_t vmul_qs8(qint8x8_t a, qint8x8_t b, int fixed_point_position);

/** 8 bit fixed point vector multiply (16 elements)
 *
 * @param[in] a                    First 8 bit fixed point input vector
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiplication.
 */
qint8x16_t vmulq_qs8(qint8x16_t a, qint8x16_t b, int fixed_point_position);

/** 8 bit fixed point vector saturating multiply (8 elements)
 *
 * @param[in] a                    First 8 bit fixed point input vector
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiplication. The result is saturated in case of overflow
 */
qint8x8_t vqmul_qs8(qint8x8_t a, qint8x8_t b, int fixed_point_position);

/** 8 bit fixed point vector saturating multiply (16 elements)
 *
 * @param[in] a                    First 8 bit fixed point input vector
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiplication. The result is saturated in case of overflow
 */
qint8x16_t vqmulq_qs8(qint8x16_t a, qint8x16_t b, int fixed_point_position);

/** 8 bit fixed point vector long multiply (8 elements)
 *
 * @param[in] a                    First 8 bit fixed point input vector
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point long vector multiplication.
 */
qint16x8_t vmull_qs8(qint8x8_t a, qint8x8_t b, int fixed_point_position);

/** 8 bit fixed point vector multiply-accumulate (8 elements). This operation performs the product between @p b and @p c and add the result to @p a (a + b * c).
 *
 * @param[in] a                    First 8 bit fixed point input vector where the result of multiplication must be added to
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] c                    Third 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiply-accumulate
 */
qint8x8_t vmla_qs8(qint8x8_t a, qint8x8_t b, qint8x8_t c, int fixed_point_position);

/** 8 bit fixed point vector multiply-accumulate (16 elements). This operation performs the product between @p b and @p c and add the result to @p a (a + b * c).
 *
 * @param[in] a                    First 8 bit fixed point input vector where the result of multiplication must be added to
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] c                    Third 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiply-accumulate
 */
qint8x16_t vmlaq_qs8(qint8x16_t a, qint8x16_t b, qint8x16_t c, int fixed_point_position);

/** 8 bit fixed point vector saturating multiply-accumulate (8 elements). This operation performs the product between @p b and @p c and add the result to @p a (a + b * c).
 *
 * @param[in] a                    First 8 bit fixed point input vector where the result of multiplication must be added to
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] c                    Third 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiply-accumulate. The result is saturated in case of overflow
 */
qint8x8_t vqmla_qs8(qint8x8_t a, qint8x8_t b, qint8x8_t c, int fixed_point_position);

/** 8 bit fixed point vector saturating multiply-accumulate (16 elements). This operation performs the product between @p b and @p c and add the result to @p a (a + b * c).
 *
 * @param[in] a                    First 8 bit fixed point input vector where the result of multiplication must be added to
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] c                    Third 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiply-accumulate.The result is saturated in case of overflow
 */
qint8x16_t vqmlaq_qs8(qint8x16_t a, qint8x16_t b, qint8x16_t c, int fixed_point_position);

/** 8 bit fixed point vector multiply-accumulate long (8 elements).
 *  This operation performs the product between @p b and @p c and add the result to the 16 bit fixed point vector @p a (a + b * c). 8 elements
 *
 * @param[in] a                    First 16 bit fixed point input vector where the result of multiplication must be added to
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] c                    Third 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiply-accumulate long
 */
qint16x8_t vmlal_qs8(qint16x8_t a, qint8x8_t b, qint8x8_t c, int fixed_point_position);

/** 8 bit fixed point vector saturating multiply-accumulate long (8 elements). The saturation is performed on the 16 bit fixed point output vector.
 *  This operation performs the product between @p b and @p c and add the result to the 16 bit fixed point vector @p a (a + b * c). 8 elements
 *
 * @param[in] a                    First 16 bit fixed point input vector where the result of multiplication must be added to
 * @param[in] b                    Second 8 bit fixed point input vector
 * @param[in] c                    Third 8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8 bit fixed point vector multiply-accumulate long
 */
qint16x8_t vqmlal_qs8(qint16x8_t a, qint8x8_t b, qint8x8_t c, int fixed_point_position);

/** Convert a float vector with 4x2 elements to 8 bit fixed point vector with 8 elements
 *
 * @param[in] a                    Float input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the conversion float -> 8 bit fixed point
 */
qint8x8_t vcvt_qs8_f32(const float32x4x2_t &a, int fixed_point_position);

/** Convert a float vector with 4x4 elements to 8 bit fixed point vector with 16 elements
 *
 * @param[in] a                    Float input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the conversion float -> 8 bit fixed point
 */
qint8x16_t vcvtq_qs8_f32(const float32x4x4_t &a, int fixed_point_position);

/** Convert a 8 bit fixed point vector with 8 elements to a float vector with 4x2 elements
 *
 * @param[in] a                    8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the conversion 8 bit fixed point -> float32x2x4
 */
float32x4x2_t vcvt_f32_qs8(qint8x8_t a, int fixed_point_position);

/** Convert a 8 bit fixed point vector with 16 elements to a float vector with 4x4 elements
 *
 * @param[in] a                    8 bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the conversion 8 bit fixed point -> float32x4x4
 */
float32x4x4_t vcvtq_qs8_f32(qint8x16_t a, int fixed_point_position);

/** Calculate reciprocal of a fixed point 8bit number using the Newton-Raphson method. (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit reciprocal (1/a).
 */
qint8x8_t vrecip_qs8(qint8x8_t a, int fixed_point_position);

/** Calculate reciprocal of a fixed point 8bit number using the Newton-Raphson method. (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit reciprocal (1/a).
 */
qint8x16_t vrecipq_qs8(qint8x16_t a, int fixed_point_position);

/** Division fixed point 8bit (8 elements)
 *
 * @param[in] a                    First 8bit fixed point input vector
 * @param[in] b                    Second 8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The quotient and remainder number in fixed point format.
 */
qint8x8_t vdiv_qs8(qint8x8_t a, int8x8_t b, int fixed_point_position);

/** Division fixed point 8bit (16 elements)
 *
 * @param[in] a                    First 8bit fixed point input vector
 * @param[in] b                    Second 8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The quotient and remainder number in 8bit fixed point format.
 */
qint8x16_t vdivq_qs8(qint8x16_t a, int8x16_t b, int fixed_point_position);

/** Perform a 4th degree polynomial approximation. (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit taylor approximation.
 */
template <bool islog>
qint8x8_t vtaylor_poly_qs8(qint8x8_t a, int fixed_point_position);

/** Perform a 4th degree polynomial approximation. (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit taylor approximation.
 */
template <bool islog>
qint8x16_t vtaylor_polyq_qs8(qint8x16_t a, int fixed_point_position);

/** Calculate saturating exponential fixed point 8bit (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit saturating exponential
 */
qint8x8_t vqexp_qs8(qint8x8_t a, int fixed_point_position);

/** Calculate saturating exponential fixed point 8bit (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit saturating exponential
 */
qint8x16_t vqexpq_qs8(qint8x16_t a, int fixed_point_position);

/** Calculate logarithm fixed point 16bit (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit logarithm.
 */
qint8x8_t vlog_qs8(qint8x8_t a, int fixed_point_position);

/** Calculate logarithm fixed point 16bit (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit logarithm.
 */
qint8x16_t vlogq_qs8(qint8x16_t a, int fixed_point_position);

/** Calculate inverse square root for fixed point 8bit using Newton-Raphosn method (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit inverse sqrt.
 */
qint8x8_t vinvsqrt_qs8(qint8x8_t a, int fixed_point_position);

/** Calculate saturating inverse square root for fixed point 8bit using Newton-Raphosn method (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit inverse sqrt.
 */
qint8x8_t vqinvsqrt_qs8(qint8x8_t a, int fixed_point_position);

/** Calculate inverse square root for fixed point 8bit using Newton-Raphosn method (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit inverse sqrt.
 */
qint8x16_t vinvsqrtq_qs8(qint8x16_t a, int fixed_point_position);

/** Calculate saturating inverse square root for fixed point 8bit using Newton-Raphosn method (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit inverse sqrt.
 */
qint8x16_t vqinvsqrtq_qs8(qint8x16_t a, int fixed_point_position);

/** Calculate hyperbolic tangent for fixed point 8bit (8 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The calculated Hyperbolic Tangent.
 */
qint8x8_t vtanh_qs8(qint8x8_t a, int fixed_point_position);

/** Calculate hyperbolic tangent for fixed point 8bit (16 elements)
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The calculated Hyperbolic Tangent.
 */
qint8x16_t vtanhq_qs8(qint8x16_t a, int fixed_point_position);

/** Calculate saturating n power for fixed point 8bit (16 elements).
 *
 * pow(a,b) = e^(b*log(a))
 *
 * @param[in] a                    8bit fixed point input vector
 * @param[in] b                    8bit fixed point power vector
 * @param[in] fixed_point_position Fixed point position that expresses the number of bits for the fractional part of the number
 *
 * @return The result of the 8bit power.
 */
qint8x8_t vqpowq_qs8(qint8x8_t a, qint8x16_t b, int fixed_point_position);
}
#include "arm_compute/core/NEON/NEFixedPoint.inl"
#endif /* __ARM_COMPUTE_NEFIXEDPOINT_H__ */