| 1 |
typedef int *__restrict__ pRINT; |
| 2 |
typedef unsigned int *__restrict__ pRUINT; |
| 3 |
typedef long long *__restrict__ pRINT64; |
| 4 |
typedef unsigned long long *__restrict__ pRUINT64; |
| 5 |
extern int abs (int j); |
| 6 |
|
| 7 |
void test_orn (pRUINT a, pRUINT b, pRUINT c) |
| 8 |
{ |
| 9 |
int i; |
| 10 |
for (i = 0; i < 16; i++) |
| 11 |
c[i] = a[i] | (~b[i]); |
| 12 |
} |
| 13 |
|
| 14 |
void test_bic (pRUINT a, pRUINT b, pRUINT c) |
| 15 |
{ |
| 16 |
int i; |
| 17 |
for (i = 0; i < 16; i++) |
| 18 |
c[i] = a[i] & (~b[i]); |
| 19 |
} |
| 20 |
|
| 21 |
void mla (pRINT a, pRINT b, pRINT c) |
| 22 |
{ |
| 23 |
int i; |
| 24 |
for (i=0;i<16;i++) |
| 25 |
c[i] += a[i] * b[i]; |
| 26 |
} |
| 27 |
|
| 28 |
void mls (pRINT a, pRINT b, pRINT c) |
| 29 |
{ |
| 30 |
int i; |
| 31 |
for (i=0;i<16;i++) |
| 32 |
c[i] -= a[i] * b[i]; |
| 33 |
} |
| 34 |
|
| 35 |
void smax (pRINT a, pRINT b, pRINT c) |
| 36 |
{ |
| 37 |
int i; |
| 38 |
for (i=0;i<16;i++) |
| 39 |
c[i] = (a[i] > b[i] ? a[i] : b[i]); |
| 40 |
} |
| 41 |
|
| 42 |
void smin (pRINT a, pRINT b, pRINT c) |
| 43 |
{ |
| 44 |
int i; |
| 45 |
for (i=0;i<16;i++) |
| 46 |
c[i] = (a[i] < b[i] ? a[i] : b[i]); |
| 47 |
} |
| 48 |
|
| 49 |
void umax (pRUINT a, pRUINT b, pRUINT c) |
| 50 |
{ |
| 51 |
int i; |
| 52 |
for (i=0;i<16;i++) |
| 53 |
c[i] = (a[i] > b[i] ? a[i] : b[i]); |
| 54 |
} |
| 55 |
|
| 56 |
void umin (pRUINT a, pRUINT b, pRUINT c) |
| 57 |
{ |
| 58 |
int i; |
| 59 |
for (i=0;i<16;i++) |
| 60 |
c[i] = (a[i] < b[i] ? a[i] : b[i]); |
| 61 |
} |
| 62 |
|
| 63 |
unsigned int reduce_umax (pRUINT a) |
| 64 |
{ |
| 65 |
int i; |
| 66 |
unsigned int s = a[0]; |
| 67 |
for (i = 1; i < 16; i++) |
| 68 |
s = (s > a[i] ? s : a[i]); |
| 69 |
|
| 70 |
return s; |
| 71 |
} |
| 72 |
|
| 73 |
unsigned int reduce_umin (pRUINT a) |
| 74 |
{ |
| 75 |
int i; |
| 76 |
unsigned int s = a[0]; |
| 77 |
for (i = 1; i < 16; i++) |
| 78 |
s = (s < a[i] ? s : a[i]); |
| 79 |
|
| 80 |
return s; |
| 81 |
} |
| 82 |
|
| 83 |
int reduce_smax (pRINT a) |
| 84 |
{ |
| 85 |
int i; |
| 86 |
int s = a[0]; |
| 87 |
for (i = 1; i < 16; i++) |
| 88 |
s = (s > a[i] ? s : a[i]); |
| 89 |
|
| 90 |
return s; |
| 91 |
} |
| 92 |
|
| 93 |
int reduce_smin (pRINT a) |
| 94 |
{ |
| 95 |
int i; |
| 96 |
int s = a[0]; |
| 97 |
for (i = 1; i < 16; i++) |
| 98 |
s = (s < a[i] ? s : a[i]); |
| 99 |
|
| 100 |
return s; |
| 101 |
} |
| 102 |
|
| 103 |
unsigned int reduce_add_u32 (pRINT a) |
| 104 |
{ |
| 105 |
int i; |
| 106 |
unsigned int s = 0; |
| 107 |
for (i = 0; i < 16; i++) |
| 108 |
s += a[i]; |
| 109 |
|
| 110 |
return s; |
| 111 |
} |
| 112 |
|
| 113 |
int reduce_add_s32 (pRINT a) |
| 114 |
{ |
| 115 |
int i; |
| 116 |
int s = 0; |
| 117 |
for (i = 0; i < 16; i++) |
| 118 |
s += a[i]; |
| 119 |
|
| 120 |
return s; |
| 121 |
} |
| 122 |
|
| 123 |
unsigned long long reduce_add_u64 (pRUINT64 a) |
| 124 |
{ |
| 125 |
int i; |
| 126 |
unsigned long long s = 0; |
| 127 |
for (i = 0; i < 16; i++) |
| 128 |
s += a[i]; |
| 129 |
|
| 130 |
return s; |
| 131 |
} |
| 132 |
|
| 133 |
long long reduce_add_s64 (pRINT64 a) |
| 134 |
{ |
| 135 |
int i; |
| 136 |
long long s = 0; |
| 137 |
for (i = 0; i < 16; i++) |
| 138 |
s += a[i]; |
| 139 |
|
| 140 |
return s; |
| 141 |
} |
| 142 |
|
| 143 |
void sabd (pRINT a, pRINT b, pRINT c) |
| 144 |
{ |
| 145 |
int i; |
| 146 |
for (i = 0; i < 16; i++) |
| 147 |
c[i] = abs (a[i] - b[i]); |
| 148 |
} |
| 149 |
|
| 150 |
void saba (pRINT a, pRINT b, pRINT c) |
| 151 |
{ |
| 152 |
int i; |
| 153 |
for (i = 0; i < 16; i++) |
| 154 |
c[i] += abs (a[i] - b[i]); |
| 155 |
} |