#include <cassert>
#include <cstdint>
Go to the source code of this file.
|
template<int N, typename T > |
using | V = T __attribute__((ext_vector_type(N))) |
|
using | Q15 = V< 8, uint16_t > |
|
using | I16 = V< 8, int16_t > |
|
using | U16 = V< 8, uint16_t > |
|
◆ I16
using I16 = V<8, int16_t> |
◆ Q15
using Q15 = V<8, uint16_t> |
◆ U16
using U16 = V<8, uint16_t> |
template<
int N, typename
T >
◆ constrained_add()
Definition at line 34 of file QMath.h.
34 {
35for (
size_t i = 0;
i < 8;
i++) {
36
37 assert(-
b[
i] <=
a[
i] &&
a[
i] <= UINT16_MAX -
b[
i]);
38}
40 return answer;
41}
◆ simulate_neon_vqrdmulhq_s16()
static Q15 simulate_neon_vqrdmulhq_s16 |
( |
Q15 |
a, |
|
|
Q15 |
b |
|
) |
| |
|
inlinestatic |
Definition at line 58 of file QMath.h.
58 {
60 const int esize = 16;
61 auto m = [](int16_t r, int16_t
s) {
62 const int64_t rounding = 1 << (esize - 1);
63 int64_t product = 2LL * (int64_t)r * (int64_t)
s + rounding;
64 int64_t
result = product >> esize;
65
66
67 if (int64_t limit = (1LL << (esize - 1)) - 1;
result > limit) {
result = limit; }
68 if (int64_t limit = -(1LL << (esize - 1)) ;
result < limit) {
result = limit; }
70 };
71 for (
int i = 0;
i < 8;
i++) {
73 }
75}
◆ simulate_ssse3_mm_mulhrs_epi16()
static I16 simulate_ssse3_mm_mulhrs_epi16 |
( |
I16 |
a, |
|
|
I16 |
b |
|
) |
| |
|
inlinestatic |
Definition at line 44 of file QMath.h.
44 {
46 auto m = [](int16_t r, int16_t
s) {
47 const int32_t rounding = 1 << 14;
48 int32_t temp = (int32_t)r * (int32_t)
s + rounding;
49 return (int16_t)(temp >> 15);
50 };
51 for (
int i = 0;
i < 8;
i++) {
53 }
55}