| 1 |
#include <complex.h> |
| 2 |
|
| 3 |
void fma0 (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 4 |
_Complex TYPE c[restrict N]) |
| 5 |
{ |
| 6 |
for (int i=0; i < N; i++) |
| 7 |
c[i] += a[i] * b[i]; |
| 8 |
} |
| 9 |
|
| 10 |
void fma90snd (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 11 |
_Complex TYPE c[restrict N]) |
| 12 |
{ |
| 13 |
for (int i=0; i < N; i++) |
| 14 |
c[i] += a[i] * (b[i] * I); |
| 15 |
} |
| 16 |
|
| 17 |
void fma180snd (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 18 |
_Complex TYPE c[restrict N]) |
| 19 |
{ |
| 20 |
for (int i=0; i < N; i++) |
| 21 |
c[i] += a[i] * (b[i] * I * I); |
| 22 |
} |
| 23 |
|
| 24 |
void fma270snd (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 25 |
_Complex TYPE c[restrict N]) |
| 26 |
{ |
| 27 |
for (int i=0; i < N; i++) |
| 28 |
c[i] += a[i] * (b[i] * I * I * I); |
| 29 |
} |
| 30 |
|
| 31 |
void fma90fst (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 32 |
_Complex TYPE c[restrict N]) |
| 33 |
{ |
| 34 |
for (int i=0; i < N; i++) |
| 35 |
c[i] += (a[i] * I) * b[i]; |
| 36 |
} |
| 37 |
|
| 38 |
void fma180fst (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 39 |
_Complex TYPE c[restrict N]) |
| 40 |
{ |
| 41 |
for (int i=0; i < N; i++) |
| 42 |
c[i] += (a[i] * I * I) * b[i]; |
| 43 |
} |
| 44 |
|
| 45 |
void fma270fst (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 46 |
_Complex TYPE c[restrict N]) |
| 47 |
{ |
| 48 |
for (int i=0; i < N; i++) |
| 49 |
c[i] += (a[i] * I * I * I) * b[i]; |
| 50 |
} |
| 51 |
|
| 52 |
void fmaconjfst (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 53 |
_Complex TYPE c[restrict N]) |
| 54 |
{ |
| 55 |
for (int i=0; i < N; i++) |
| 56 |
c[i] += ~a[i] * b[i]; |
| 57 |
} |
| 58 |
|
| 59 |
void fmaconjsnd (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 60 |
_Complex TYPE c[restrict N]) |
| 61 |
{ |
| 62 |
for (int i=0; i < N; i++) |
| 63 |
c[i] += a[i] * ~b[i]; |
| 64 |
} |
| 65 |
|
| 66 |
void fmaconjboth (_Complex TYPE a[restrict N], _Complex TYPE b[restrict N], |
| 67 |
_Complex TYPE c[restrict N]) |
| 68 |
{ |
| 69 |
for (int i=0; i < N; i++) |
| 70 |
c[i] += ~a[i] * ~b[i]; |
| 71 |
} |
| 72 |
|
| 73 |
void fma_elem (_Complex TYPE a[restrict N], _Complex TYPE b, |
| 74 |
_Complex TYPE c[restrict N]) |
| 75 |
{ |
| 76 |
for (int i=0; i < N; i++) |
| 77 |
c[i] += a[i] * b; |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
void fma_elemconjfst (_Complex TYPE a[restrict N], _Complex TYPE b, |
| 82 |
_Complex TYPE c[restrict N]) |
| 83 |
{ |
| 84 |
for (int i=0; i < N; i++) |
| 85 |
c[i] += ~a[i] * b; |
| 86 |
} |
| 87 |
|
| 88 |
void fma_elemconjsnd (_Complex TYPE a[restrict N], _Complex TYPE b, |
| 89 |
_Complex TYPE c[restrict N]) |
| 90 |
{ |
| 91 |
for (int i=0; i < N; i++) |
| 92 |
c[i] += a[i] * ~b; |
| 93 |
} |
| 94 |
|
| 95 |
void fma_elemconjboth (_Complex TYPE a[restrict N], _Complex TYPE b, |
| 96 |
_Complex TYPE c[restrict N]) |
| 97 |
{ |
| 98 |
for (int i=0; i < N; i++) |
| 99 |
c[i] += ~a[i] * ~b; |
| 100 |
} |
| 101 |
|