1 /*
2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3 *
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10 */
11
12 #ifndef AOM_AOM_DSP_SIMD_V64_INTRINSICS_C_H_
13 #define AOM_AOM_DSP_SIMD_V64_INTRINSICS_C_H_
14
15 /* Note: This implements the intrinsics in plain, unoptimised C.
16 Intended for reference, porting or debugging. */
17
18 #include <stdio.h>
19 #include <stdlib.h>
20
21 #include "config/aom_config.h"
22
23 typedef union {
24 uint8_t u8[8];
25 uint16_t u16[4];
26 uint32_t u32[2];
27 uint64_t u64;
28 int8_t s8[8];
29 int16_t s16[4];
30 int32_t s32[2];
31 int64_t s64;
32 } c_v64;
33
c_v64_low_u32(c_v64 a)34 SIMD_INLINE uint32_t c_v64_low_u32(c_v64 a) {
35 return a.u32[!!CONFIG_BIG_ENDIAN];
36 }
37
c_v64_high_u32(c_v64 a)38 SIMD_INLINE uint32_t c_v64_high_u32(c_v64 a) {
39 return a.u32[!CONFIG_BIG_ENDIAN];
40 }
41
c_v64_low_s32(c_v64 a)42 SIMD_INLINE int32_t c_v64_low_s32(c_v64 a) {
43 return a.s32[!!CONFIG_BIG_ENDIAN];
44 }
45
c_v64_high_s32(c_v64 a)46 SIMD_INLINE int32_t c_v64_high_s32(c_v64 a) {
47 return a.s32[!CONFIG_BIG_ENDIAN];
48 }
49
c_v64_from_32(uint32_t x,uint32_t y)50 SIMD_INLINE c_v64 c_v64_from_32(uint32_t x, uint32_t y) {
51 c_v64 t;
52 t.u32[!CONFIG_BIG_ENDIAN] = x;
53 t.u32[!!CONFIG_BIG_ENDIAN] = y;
54 return t;
55 }
56
c_v64_from_64(uint64_t x)57 SIMD_INLINE c_v64 c_v64_from_64(uint64_t x) {
58 c_v64 t;
59 t.u64 = x;
60 return t;
61 }
62
c_v64_u64(c_v64 x)63 SIMD_INLINE uint64_t c_v64_u64(c_v64 x) { return x.u64; }
64
c_v64_from_16(uint16_t a,uint16_t b,uint16_t c,uint16_t d)65 SIMD_INLINE c_v64 c_v64_from_16(uint16_t a, uint16_t b, uint16_t c,
66 uint16_t d) {
67 c_v64 t;
68 if (CONFIG_BIG_ENDIAN) {
69 t.u16[0] = a;
70 t.u16[1] = b;
71 t.u16[2] = c;
72 t.u16[3] = d;
73 } else {
74 t.u16[3] = a;
75 t.u16[2] = b;
76 t.u16[1] = c;
77 t.u16[0] = d;
78 }
79 return t;
80 }
81
c_u32_load_unaligned(const void * p)82 SIMD_INLINE uint32_t c_u32_load_unaligned(const void *p) {
83 uint32_t t;
84 uint8_t *pp = (uint8_t *)p;
85 uint8_t *q = (uint8_t *)&t;
86 int c;
87 for (c = 0; c < 4; c++) q[c] = pp[c];
88 return t;
89 }
90
c_u32_store_unaligned(void * p,uint32_t a)91 SIMD_INLINE void c_u32_store_unaligned(void *p, uint32_t a) {
92 uint8_t *pp = (uint8_t *)p;
93 uint8_t *q = (uint8_t *)&a;
94 int c;
95 for (c = 0; c < 4; c++) pp[c] = q[c];
96 }
97
c_u32_load_aligned(const void * p)98 SIMD_INLINE uint32_t c_u32_load_aligned(const void *p) {
99 if (SIMD_CHECK && (uintptr_t)p & 3) {
100 fprintf(stderr, "Error: Unaligned u32 load at %p\n", p);
101 abort();
102 }
103 return c_u32_load_unaligned(p);
104 }
105
c_u32_store_aligned(void * p,uint32_t a)106 SIMD_INLINE void c_u32_store_aligned(void *p, uint32_t a) {
107 if (SIMD_CHECK && (uintptr_t)p & 3) {
108 fprintf(stderr, "Error: Unaligned u32 store at %p\n", p);
109 abort();
110 }
111 c_u32_store_unaligned(p, a);
112 }
113
c_v64_load_unaligned(const void * p)114 SIMD_INLINE c_v64 c_v64_load_unaligned(const void *p) {
115 c_v64 t;
116 uint8_t *pp = (uint8_t *)p;
117 uint8_t *q = (uint8_t *)&t;
118 int c;
119 for (c = 0; c < 8; c++) q[c] = pp[c];
120 return t;
121 }
122
c_v64_load_aligned(const void * p)123 SIMD_INLINE c_v64 c_v64_load_aligned(const void *p) {
124 if (SIMD_CHECK && (uintptr_t)p & 7) {
125 fprintf(stderr, "Error: Unaligned c_v64 load at %p\n", p);
126 abort();
127 }
128 return c_v64_load_unaligned(p);
129 }
130
c_v64_store_unaligned(void * p,c_v64 a)131 SIMD_INLINE void c_v64_store_unaligned(void *p, c_v64 a) {
132 uint8_t *q = (uint8_t *)p;
133 uint8_t *r = (uint8_t *)&a;
134 int c;
135 for (c = 0; c < 8; c++) q[c] = r[c];
136 }
137
c_v64_store_aligned(void * p,c_v64 a)138 SIMD_INLINE void c_v64_store_aligned(void *p, c_v64 a) {
139 if (SIMD_CHECK && (uintptr_t)p & 7) {
140 fprintf(stderr, "Error: Unaligned c_v64 store at %p\n", p);
141 abort();
142 }
143 c_v64_store_unaligned(p, a);
144 }
145
c_v64_zero()146 SIMD_INLINE c_v64 c_v64_zero() {
147 c_v64 t;
148 t.u64 = 0;
149 return t;
150 }
151
c_v64_dup_8(uint8_t x)152 SIMD_INLINE c_v64 c_v64_dup_8(uint8_t x) {
153 c_v64 t;
154 t.u8[0] = t.u8[1] = t.u8[2] = t.u8[3] = t.u8[4] = t.u8[5] = t.u8[6] =
155 t.u8[7] = x;
156 return t;
157 }
158
c_v64_dup_16(uint16_t x)159 SIMD_INLINE c_v64 c_v64_dup_16(uint16_t x) {
160 c_v64 t;
161 t.u16[0] = t.u16[1] = t.u16[2] = t.u16[3] = x;
162 return t;
163 }
164
c_v64_dup_32(uint32_t x)165 SIMD_INLINE c_v64 c_v64_dup_32(uint32_t x) {
166 c_v64 t;
167 t.u32[0] = t.u32[1] = x;
168 return t;
169 }
170
c_v64_add_8(c_v64 a,c_v64 b)171 SIMD_INLINE c_v64 c_v64_add_8(c_v64 a, c_v64 b) {
172 c_v64 t;
173 int c;
174 for (c = 0; c < 8; c++) t.u8[c] = a.u8[c] + b.u8[c];
175 return t;
176 }
177
c_v64_add_16(c_v64 a,c_v64 b)178 SIMD_INLINE c_v64 c_v64_add_16(c_v64 a, c_v64 b) {
179 c_v64 t;
180 int c;
181 for (c = 0; c < 4; c++) t.u16[c] = a.u16[c] + b.u16[c];
182 return t;
183 }
184
c_v64_sadd_u8(c_v64 a,c_v64 b)185 SIMD_INLINE c_v64 c_v64_sadd_u8(c_v64 a, c_v64 b) {
186 c_v64 t;
187 int c;
188 for (c = 0; c < 8; c++)
189 t.u8[c] = (int16_t)a.u8[c] + (int16_t)b.u8[c] > 255
190 ? 255
191 : (int16_t)a.u8[c] + (int16_t)b.u8[c] < 0
192 ? 0
193 : (int16_t)a.u8[c] + (int16_t)b.u8[c];
194 return t;
195 }
196
c_v64_sadd_s8(c_v64 a,c_v64 b)197 SIMD_INLINE c_v64 c_v64_sadd_s8(c_v64 a, c_v64 b) {
198 c_v64 t;
199 int c;
200 for (c = 0; c < 8; c++)
201 t.s8[c] = (int16_t)a.s8[c] + (int16_t)b.s8[c] > 127
202 ? 127
203 : (int16_t)a.s8[c] + (int16_t)b.s8[c] < -128
204 ? -128
205 : (int16_t)a.s8[c] + (int16_t)b.s8[c];
206 return t;
207 }
208
c_v64_sadd_s16(c_v64 a,c_v64 b)209 SIMD_INLINE c_v64 c_v64_sadd_s16(c_v64 a, c_v64 b) {
210 c_v64 t;
211 int c;
212 for (c = 0; c < 4; c++)
213 t.s16[c] = (int32_t)a.s16[c] + (int32_t)b.s16[c] > 32767
214 ? 32767
215 : (int32_t)a.s16[c] + (int32_t)b.s16[c] < -32768
216 ? -32768
217 : (int32_t)a.s16[c] + (int32_t)b.s16[c];
218 return t;
219 }
220
c_v64_add_32(c_v64 a,c_v64 b)221 SIMD_INLINE c_v64 c_v64_add_32(c_v64 a, c_v64 b) {
222 c_v64 t;
223 t.u32[0] = (uint32_t)((uint64_t)a.u32[0] + b.u32[0]);
224 t.u32[1] = (uint32_t)((uint64_t)a.u32[1] + b.u32[1]);
225 return t;
226 }
227
c_v64_sub_8(c_v64 a,c_v64 b)228 SIMD_INLINE c_v64 c_v64_sub_8(c_v64 a, c_v64 b) {
229 c_v64 t;
230 int c;
231 for (c = 0; c < 8; c++) t.u8[c] = a.u8[c] - b.u8[c];
232 return t;
233 }
234
c_v64_ssub_u8(c_v64 a,c_v64 b)235 SIMD_INLINE c_v64 c_v64_ssub_u8(c_v64 a, c_v64 b) {
236 c_v64 t;
237 int c;
238 for (c = 0; c < 8; c++) t.u8[c] = a.u8[c] < b.u8[c] ? 0 : a.u8[c] - b.u8[c];
239 return t;
240 }
241
c_v64_ssub_s8(c_v64 a,c_v64 b)242 SIMD_INLINE c_v64 c_v64_ssub_s8(c_v64 a, c_v64 b) {
243 c_v64 t;
244 int c;
245 for (c = 0; c < 8; c++) {
246 int16_t d = (int16_t)a.s8[c] - (int16_t)b.s8[c];
247 t.s8[c] = d > 127 ? 127 : (d < -128 ? -128 : d);
248 }
249 return t;
250 }
251
c_v64_sub_16(c_v64 a,c_v64 b)252 SIMD_INLINE c_v64 c_v64_sub_16(c_v64 a, c_v64 b) {
253 c_v64 t;
254 int c;
255 for (c = 0; c < 4; c++) t.u16[c] = a.u16[c] - b.u16[c];
256 return t;
257 }
258
c_v64_ssub_s16(c_v64 a,c_v64 b)259 SIMD_INLINE c_v64 c_v64_ssub_s16(c_v64 a, c_v64 b) {
260 c_v64 t;
261 int c;
262 for (c = 0; c < 4; c++)
263 t.s16[c] = (int32_t)a.s16[c] - (int32_t)b.s16[c] < -32768
264 ? -32768
265 : (int32_t)a.s16[c] - (int32_t)b.s16[c] > 32767
266 ? 32767
267 : (int32_t)a.s16[c] - (int32_t)b.s16[c];
268 return t;
269 }
270
c_v64_ssub_u16(c_v64 a,c_v64 b)271 SIMD_INLINE c_v64 c_v64_ssub_u16(c_v64 a, c_v64 b) {
272 c_v64 t;
273 int c;
274 for (c = 0; c < 4; c++)
275 t.u16[c] =
276 (int32_t)a.u16[c] - (int32_t)b.u16[c] < 0 ? 0 : a.u16[c] - b.u16[c];
277 return t;
278 }
279
c_v64_sub_32(c_v64 a,c_v64 b)280 SIMD_INLINE c_v64 c_v64_sub_32(c_v64 a, c_v64 b) {
281 c_v64 t;
282 t.u32[0] = (uint32_t)((int64_t)a.u32[0] - b.u32[0]);
283 t.u32[1] = (uint32_t)((int64_t)a.u32[1] - b.u32[1]);
284 return t;
285 }
286
c_v64_abs_s16(c_v64 a)287 SIMD_INLINE c_v64 c_v64_abs_s16(c_v64 a) {
288 c_v64 t;
289 int c;
290 for (c = 0; c < 4; c++)
291 t.u16[c] = (int16_t)a.u16[c] > 0 ? a.u16[c] : -a.u16[c];
292 return t;
293 }
294
c_v64_abs_s8(c_v64 a)295 SIMD_INLINE c_v64 c_v64_abs_s8(c_v64 a) {
296 c_v64 t;
297 int c;
298 for (c = 0; c < 8; c++) t.u8[c] = (int8_t)a.u8[c] > 0 ? a.u8[c] : -a.u8[c];
299 return t;
300 }
301
_c_v64_zip_8(c_v64 a,c_v64 b,int mode)302 SIMD_INLINE c_v64 _c_v64_zip_8(c_v64 a, c_v64 b, int mode) {
303 c_v64 t;
304 if (mode) {
305 t.u8[7] = a.u8[7];
306 t.u8[6] = b.u8[7];
307 t.u8[5] = a.u8[6];
308 t.u8[4] = b.u8[6];
309 t.u8[3] = a.u8[5];
310 t.u8[2] = b.u8[5];
311 t.u8[1] = a.u8[4];
312 t.u8[0] = b.u8[4];
313 } else {
314 t.u8[7] = a.u8[3];
315 t.u8[6] = b.u8[3];
316 t.u8[5] = a.u8[2];
317 t.u8[4] = b.u8[2];
318 t.u8[3] = a.u8[1];
319 t.u8[2] = b.u8[1];
320 t.u8[1] = a.u8[0];
321 t.u8[0] = b.u8[0];
322 }
323 return t;
324 }
325
c_v64_ziplo_8(c_v64 a,c_v64 b)326 SIMD_INLINE c_v64 c_v64_ziplo_8(c_v64 a, c_v64 b) {
327 return CONFIG_BIG_ENDIAN ? _c_v64_zip_8(b, a, 1) : _c_v64_zip_8(a, b, 0);
328 }
329
c_v64_ziphi_8(c_v64 a,c_v64 b)330 SIMD_INLINE c_v64 c_v64_ziphi_8(c_v64 a, c_v64 b) {
331 return CONFIG_BIG_ENDIAN ? _c_v64_zip_8(b, a, 0) : _c_v64_zip_8(a, b, 1);
332 }
333
_c_v64_zip_16(c_v64 a,c_v64 b,int mode)334 SIMD_INLINE c_v64 _c_v64_zip_16(c_v64 a, c_v64 b, int mode) {
335 c_v64 t;
336 if (mode) {
337 t.u16[3] = a.u16[3];
338 t.u16[2] = b.u16[3];
339 t.u16[1] = a.u16[2];
340 t.u16[0] = b.u16[2];
341 } else {
342 t.u16[3] = a.u16[1];
343 t.u16[2] = b.u16[1];
344 t.u16[1] = a.u16[0];
345 t.u16[0] = b.u16[0];
346 }
347 return t;
348 }
349
c_v64_ziplo_16(c_v64 a,c_v64 b)350 SIMD_INLINE c_v64 c_v64_ziplo_16(c_v64 a, c_v64 b) {
351 return CONFIG_BIG_ENDIAN ? _c_v64_zip_16(b, a, 1) : _c_v64_zip_16(a, b, 0);
352 }
353
c_v64_ziphi_16(c_v64 a,c_v64 b)354 SIMD_INLINE c_v64 c_v64_ziphi_16(c_v64 a, c_v64 b) {
355 return CONFIG_BIG_ENDIAN ? _c_v64_zip_16(b, a, 0) : _c_v64_zip_16(a, b, 1);
356 }
357
_c_v64_zip_32(c_v64 a,c_v64 b,int mode)358 SIMD_INLINE c_v64 _c_v64_zip_32(c_v64 a, c_v64 b, int mode) {
359 c_v64 t;
360 if (mode) {
361 t.u32[1] = a.u32[1];
362 t.u32[0] = b.u32[1];
363 } else {
364 t.u32[1] = a.u32[0];
365 t.u32[0] = b.u32[0];
366 }
367 return t;
368 }
369
c_v64_ziplo_32(c_v64 a,c_v64 b)370 SIMD_INLINE c_v64 c_v64_ziplo_32(c_v64 a, c_v64 b) {
371 return CONFIG_BIG_ENDIAN ? _c_v64_zip_32(b, a, 1) : _c_v64_zip_32(a, b, 0);
372 }
373
c_v64_ziphi_32(c_v64 a,c_v64 b)374 SIMD_INLINE c_v64 c_v64_ziphi_32(c_v64 a, c_v64 b) {
375 return CONFIG_BIG_ENDIAN ? _c_v64_zip_32(b, a, 0) : _c_v64_zip_32(a, b, 1);
376 }
377
_c_v64_unzip_8(c_v64 a,c_v64 b,int mode)378 SIMD_INLINE c_v64 _c_v64_unzip_8(c_v64 a, c_v64 b, int mode) {
379 c_v64 t;
380 if (mode) {
381 t.u8[7] = b.u8[7];
382 t.u8[6] = b.u8[5];
383 t.u8[5] = b.u8[3];
384 t.u8[4] = b.u8[1];
385 t.u8[3] = a.u8[7];
386 t.u8[2] = a.u8[5];
387 t.u8[1] = a.u8[3];
388 t.u8[0] = a.u8[1];
389 } else {
390 t.u8[7] = a.u8[6];
391 t.u8[6] = a.u8[4];
392 t.u8[5] = a.u8[2];
393 t.u8[4] = a.u8[0];
394 t.u8[3] = b.u8[6];
395 t.u8[2] = b.u8[4];
396 t.u8[1] = b.u8[2];
397 t.u8[0] = b.u8[0];
398 }
399 return t;
400 }
401
c_v64_unziplo_8(c_v64 a,c_v64 b)402 SIMD_INLINE c_v64 c_v64_unziplo_8(c_v64 a, c_v64 b) {
403 return CONFIG_BIG_ENDIAN ? _c_v64_unzip_8(a, b, 1) : _c_v64_unzip_8(a, b, 0);
404 }
405
c_v64_unziphi_8(c_v64 a,c_v64 b)406 SIMD_INLINE c_v64 c_v64_unziphi_8(c_v64 a, c_v64 b) {
407 return CONFIG_BIG_ENDIAN ? _c_v64_unzip_8(b, a, 0) : _c_v64_unzip_8(b, a, 1);
408 }
409
_c_v64_unzip_16(c_v64 a,c_v64 b,int mode)410 SIMD_INLINE c_v64 _c_v64_unzip_16(c_v64 a, c_v64 b, int mode) {
411 c_v64 t;
412 if (mode) {
413 t.u16[3] = b.u16[3];
414 t.u16[2] = b.u16[1];
415 t.u16[1] = a.u16[3];
416 t.u16[0] = a.u16[1];
417 } else {
418 t.u16[3] = a.u16[2];
419 t.u16[2] = a.u16[0];
420 t.u16[1] = b.u16[2];
421 t.u16[0] = b.u16[0];
422 }
423 return t;
424 }
425
c_v64_unziplo_16(c_v64 a,c_v64 b)426 SIMD_INLINE c_v64 c_v64_unziplo_16(c_v64 a, c_v64 b) {
427 return CONFIG_BIG_ENDIAN ? _c_v64_unzip_16(a, b, 1)
428 : _c_v64_unzip_16(a, b, 0);
429 }
430
c_v64_unziphi_16(c_v64 a,c_v64 b)431 SIMD_INLINE c_v64 c_v64_unziphi_16(c_v64 a, c_v64 b) {
432 return CONFIG_BIG_ENDIAN ? _c_v64_unzip_16(b, a, 0)
433 : _c_v64_unzip_16(b, a, 1);
434 }
435
c_v64_unpacklo_u8_s16(c_v64 a)436 SIMD_INLINE c_v64 c_v64_unpacklo_u8_s16(c_v64 a) {
437 c_v64 t;
438 int endian = !!CONFIG_BIG_ENDIAN * 4;
439 t.s16[3] = (int16_t)a.u8[3 + endian];
440 t.s16[2] = (int16_t)a.u8[2 + endian];
441 t.s16[1] = (int16_t)a.u8[1 + endian];
442 t.s16[0] = (int16_t)a.u8[0 + endian];
443 return t;
444 }
445
c_v64_unpackhi_u8_s16(c_v64 a)446 SIMD_INLINE c_v64 c_v64_unpackhi_u8_s16(c_v64 a) {
447 c_v64 t;
448 int endian = !!CONFIG_BIG_ENDIAN * 4;
449 t.s16[3] = (int16_t)a.u8[7 - endian];
450 t.s16[2] = (int16_t)a.u8[6 - endian];
451 t.s16[1] = (int16_t)a.u8[5 - endian];
452 t.s16[0] = (int16_t)a.u8[4 - endian];
453 return t;
454 }
455
c_v64_unpacklo_s8_s16(c_v64 a)456 SIMD_INLINE c_v64 c_v64_unpacklo_s8_s16(c_v64 a) {
457 c_v64 t;
458 int endian = !!CONFIG_BIG_ENDIAN * 4;
459 t.s16[3] = (int16_t)a.s8[3 + endian];
460 t.s16[2] = (int16_t)a.s8[2 + endian];
461 t.s16[1] = (int16_t)a.s8[1 + endian];
462 t.s16[0] = (int16_t)a.s8[0 + endian];
463 return t;
464 }
465
c_v64_unpackhi_s8_s16(c_v64 a)466 SIMD_INLINE c_v64 c_v64_unpackhi_s8_s16(c_v64 a) {
467 c_v64 t;
468 int endian = !!CONFIG_BIG_ENDIAN * 4;
469 t.s16[3] = (int16_t)a.s8[7 - endian];
470 t.s16[2] = (int16_t)a.s8[6 - endian];
471 t.s16[1] = (int16_t)a.s8[5 - endian];
472 t.s16[0] = (int16_t)a.s8[4 - endian];
473 return t;
474 }
475
c_v64_pack_s32_s16(c_v64 a,c_v64 b)476 SIMD_INLINE c_v64 c_v64_pack_s32_s16(c_v64 a, c_v64 b) {
477 c_v64 t;
478 if (CONFIG_BIG_ENDIAN) {
479 c_v64 u = a;
480 a = b;
481 b = u;
482 }
483 t.s16[3] = a.s32[1] > 32767 ? 32767 : a.s32[1] < -32768 ? -32768 : a.s32[1];
484 t.s16[2] = a.s32[0] > 32767 ? 32767 : a.s32[0] < -32768 ? -32768 : a.s32[0];
485 t.s16[1] = b.s32[1] > 32767 ? 32767 : b.s32[1] < -32768 ? -32768 : b.s32[1];
486 t.s16[0] = b.s32[0] > 32767 ? 32767 : b.s32[0] < -32768 ? -32768 : b.s32[0];
487 return t;
488 }
489
c_v64_pack_s32_u16(c_v64 a,c_v64 b)490 SIMD_INLINE c_v64 c_v64_pack_s32_u16(c_v64 a, c_v64 b) {
491 c_v64 t;
492 if (CONFIG_BIG_ENDIAN) {
493 c_v64 u = a;
494 a = b;
495 b = u;
496 }
497 t.u16[3] = a.s32[1] > 65535 ? 65535 : a.s32[1] < 0 ? 0 : a.s32[1];
498 t.u16[2] = a.s32[0] > 65535 ? 65535 : a.s32[0] < 0 ? 0 : a.s32[0];
499 t.u16[1] = b.s32[1] > 65535 ? 65535 : b.s32[1] < 0 ? 0 : b.s32[1];
500 t.u16[0] = b.s32[0] > 65535 ? 65535 : b.s32[0] < 0 ? 0 : b.s32[0];
501 return t;
502 }
503
c_v64_pack_s16_u8(c_v64 a,c_v64 b)504 SIMD_INLINE c_v64 c_v64_pack_s16_u8(c_v64 a, c_v64 b) {
505 c_v64 t;
506 if (CONFIG_BIG_ENDIAN) {
507 c_v64 u = a;
508 a = b;
509 b = u;
510 }
511 t.u8[7] = a.s16[3] > 255 ? 255 : a.s16[3] < 0 ? 0 : a.s16[3];
512 t.u8[6] = a.s16[2] > 255 ? 255 : a.s16[2] < 0 ? 0 : a.s16[2];
513 t.u8[5] = a.s16[1] > 255 ? 255 : a.s16[1] < 0 ? 0 : a.s16[1];
514 t.u8[4] = a.s16[0] > 255 ? 255 : a.s16[0] < 0 ? 0 : a.s16[0];
515 t.u8[3] = b.s16[3] > 255 ? 255 : b.s16[3] < 0 ? 0 : b.s16[3];
516 t.u8[2] = b.s16[2] > 255 ? 255 : b.s16[2] < 0 ? 0 : b.s16[2];
517 t.u8[1] = b.s16[1] > 255 ? 255 : b.s16[1] < 0 ? 0 : b.s16[1];
518 t.u8[0] = b.s16[0] > 255 ? 255 : b.s16[0] < 0 ? 0 : b.s16[0];
519 return t;
520 }
521
c_v64_pack_s16_s8(c_v64 a,c_v64 b)522 SIMD_INLINE c_v64 c_v64_pack_s16_s8(c_v64 a, c_v64 b) {
523 c_v64 t;
524 if (CONFIG_BIG_ENDIAN) {
525 c_v64 u = a;
526 a = b;
527 b = u;
528 }
529 t.u8[7] = a.s16[3] > 127 ? 127 : a.s16[3] < -128 ? 128 : a.s16[3];
530 t.u8[6] = a.s16[2] > 127 ? 127 : a.s16[2] < -128 ? 128 : a.s16[2];
531 t.u8[5] = a.s16[1] > 127 ? 127 : a.s16[1] < -128 ? 128 : a.s16[1];
532 t.u8[4] = a.s16[0] > 127 ? 127 : a.s16[0] < -128 ? 128 : a.s16[0];
533 t.u8[3] = b.s16[3] > 127 ? 127 : b.s16[3] < -128 ? 128 : b.s16[3];
534 t.u8[2] = b.s16[2] > 127 ? 127 : b.s16[2] < -128 ? 128 : b.s16[2];
535 t.u8[1] = b.s16[1] > 127 ? 127 : b.s16[1] < -128 ? 128 : b.s16[1];
536 t.u8[0] = b.s16[0] > 127 ? 127 : b.s16[0] < -128 ? 128 : b.s16[0];
537 return t;
538 }
539
c_v64_unpacklo_u16_s32(c_v64 a)540 SIMD_INLINE c_v64 c_v64_unpacklo_u16_s32(c_v64 a) {
541 c_v64 t;
542 t.s32[1] = a.u16[1 + !!CONFIG_BIG_ENDIAN * 2];
543 t.s32[0] = a.u16[0 + !!CONFIG_BIG_ENDIAN * 2];
544 return t;
545 }
546
c_v64_unpacklo_s16_s32(c_v64 a)547 SIMD_INLINE c_v64 c_v64_unpacklo_s16_s32(c_v64 a) {
548 c_v64 t;
549 t.s32[1] = a.s16[1 + !!CONFIG_BIG_ENDIAN * 2];
550 t.s32[0] = a.s16[0 + !!CONFIG_BIG_ENDIAN * 2];
551 return t;
552 }
553
c_v64_unpackhi_u16_s32(c_v64 a)554 SIMD_INLINE c_v64 c_v64_unpackhi_u16_s32(c_v64 a) {
555 c_v64 t;
556 t.s32[1] = a.u16[3 - !!CONFIG_BIG_ENDIAN * 2];
557 t.s32[0] = a.u16[2 - !!CONFIG_BIG_ENDIAN * 2];
558 return t;
559 }
560
c_v64_unpackhi_s16_s32(c_v64 a)561 SIMD_INLINE c_v64 c_v64_unpackhi_s16_s32(c_v64 a) {
562 c_v64 t;
563 t.s32[1] = a.s16[3 - !!CONFIG_BIG_ENDIAN * 2];
564 t.s32[0] = a.s16[2 - !!CONFIG_BIG_ENDIAN * 2];
565 return t;
566 }
567
c_v64_shuffle_8(c_v64 a,c_v64 pattern)568 SIMD_INLINE c_v64 c_v64_shuffle_8(c_v64 a, c_v64 pattern) {
569 c_v64 t;
570 int c;
571 for (c = 0; c < 8; c++) {
572 if (SIMD_CHECK && (pattern.u8[c] & ~7)) {
573 fprintf(stderr, "Error: Undefined v64_shuffle_8 index %d/%d\n",
574 pattern.u8[c], c);
575 abort();
576 }
577 t.u8[c] =
578 a.u8[CONFIG_BIG_ENDIAN ? 7 - (pattern.u8[c] & 7) : pattern.u8[c] & 7];
579 }
580 return t;
581 }
582
c_v64_dotp_su8(c_v64 a,c_v64 b)583 SIMD_INLINE int64_t c_v64_dotp_su8(c_v64 a, c_v64 b) {
584 return a.s8[7] * b.u8[7] + a.s8[6] * b.u8[6] + a.s8[5] * b.u8[5] +
585 a.s8[4] * b.u8[4] + a.s8[3] * b.u8[3] + a.s8[2] * b.u8[2] +
586 a.s8[1] * b.u8[1] + a.s8[0] * b.u8[0];
587 }
588
c_v64_dotp_s16(c_v64 a,c_v64 b)589 SIMD_INLINE int64_t c_v64_dotp_s16(c_v64 a, c_v64 b) {
590 return (int64_t)(a.s16[3] * b.s16[3] + a.s16[2] * b.s16[2]) +
591 (int64_t)(a.s16[1] * b.s16[1] + a.s16[0] * b.s16[0]);
592 }
593
c_v64_hadd_u8(c_v64 a)594 SIMD_INLINE uint64_t c_v64_hadd_u8(c_v64 a) {
595 return a.u8[7] + a.u8[6] + a.u8[5] + a.u8[4] + a.u8[3] + a.u8[2] + a.u8[1] +
596 a.u8[0];
597 }
598
c_v64_hadd_s16(c_v64 a)599 SIMD_INLINE int64_t c_v64_hadd_s16(c_v64 a) {
600 return a.s16[3] + a.s16[2] + a.s16[1] + a.s16[0];
601 }
602
603 typedef uint32_t c_sad64_internal;
604
605 /* Implementation dependent return value. Result must be finalised with
606 v64_sad_u8_sum().
607 The result for more than 32 v64_sad_u8() calls is undefined. */
c_v64_sad_u8_init()608 SIMD_INLINE c_sad64_internal c_v64_sad_u8_init() { return 0; }
609
c_v64_sad_u8(c_sad64_internal s,c_v64 a,c_v64 b)610 SIMD_INLINE c_sad64_internal c_v64_sad_u8(c_sad64_internal s, c_v64 a,
611 c_v64 b) {
612 int c;
613 for (c = 0; c < 8; c++)
614 s += a.u8[c] > b.u8[c] ? a.u8[c] - b.u8[c] : b.u8[c] - a.u8[c];
615 return s;
616 }
617
c_v64_sad_u8_sum(c_sad64_internal s)618 SIMD_INLINE uint32_t c_v64_sad_u8_sum(c_sad64_internal s) { return s; }
619
620 typedef uint32_t c_ssd64_internal;
621
622 /* Implementation dependent return value. Result must be finalised with
623 * v64_ssd_u8_sum(). */
c_v64_ssd_u8_init()624 SIMD_INLINE c_ssd64_internal c_v64_ssd_u8_init() { return 0; }
625
c_v64_ssd_u8(c_ssd64_internal s,c_v64 a,c_v64 b)626 SIMD_INLINE c_ssd64_internal c_v64_ssd_u8(c_ssd64_internal s, c_v64 a,
627 c_v64 b) {
628 int c;
629 for (c = 0; c < 8; c++) s += (a.u8[c] - b.u8[c]) * (a.u8[c] - b.u8[c]);
630 return s;
631 }
632
c_v64_ssd_u8_sum(c_ssd64_internal s)633 SIMD_INLINE uint32_t c_v64_ssd_u8_sum(c_ssd64_internal s) { return s; }
634
c_v64_or(c_v64 a,c_v64 b)635 SIMD_INLINE c_v64 c_v64_or(c_v64 a, c_v64 b) {
636 c_v64 t;
637 t.u64 = a.u64 | b.u64;
638 return t;
639 }
640
c_v64_xor(c_v64 a,c_v64 b)641 SIMD_INLINE c_v64 c_v64_xor(c_v64 a, c_v64 b) {
642 c_v64 t;
643 t.u64 = a.u64 ^ b.u64;
644 return t;
645 }
646
c_v64_and(c_v64 a,c_v64 b)647 SIMD_INLINE c_v64 c_v64_and(c_v64 a, c_v64 b) {
648 c_v64 t;
649 t.u64 = a.u64 & b.u64;
650 return t;
651 }
652
c_v64_andn(c_v64 a,c_v64 b)653 SIMD_INLINE c_v64 c_v64_andn(c_v64 a, c_v64 b) {
654 c_v64 t;
655 t.u64 = a.u64 & ~b.u64;
656 return t;
657 }
658
c_v64_mullo_s16(c_v64 a,c_v64 b)659 SIMD_INLINE c_v64 c_v64_mullo_s16(c_v64 a, c_v64 b) {
660 c_v64 t;
661 int c;
662 for (c = 0; c < 4; c++) t.s16[c] = (int16_t)(a.s16[c] * b.s16[c]);
663 return t;
664 }
665
c_v64_mulhi_s16(c_v64 a,c_v64 b)666 SIMD_INLINE c_v64 c_v64_mulhi_s16(c_v64 a, c_v64 b) {
667 c_v64 t;
668 int c;
669 for (c = 0; c < 4; c++) t.s16[c] = (a.s16[c] * b.s16[c]) >> 16;
670 return t;
671 }
672
c_v64_mullo_s32(c_v64 a,c_v64 b)673 SIMD_INLINE c_v64 c_v64_mullo_s32(c_v64 a, c_v64 b) {
674 c_v64 t;
675 t.s32[0] = (int32_t)((int64_t)a.s32[0] * b.s32[0]);
676 t.s32[1] = (int32_t)((int64_t)a.s32[1] * b.s32[1]);
677 return t;
678 }
679
c_v64_madd_s16(c_v64 a,c_v64 b)680 SIMD_INLINE c_v64 c_v64_madd_s16(c_v64 a, c_v64 b) {
681 c_v64 t;
682 t.s32[0] = a.s16[0] * b.s16[0] + a.s16[1] * b.s16[1];
683 t.s32[1] = a.s16[2] * b.s16[2] + a.s16[3] * b.s16[3];
684 return t;
685 }
686
c_v64_madd_us8(c_v64 a,c_v64 b)687 SIMD_INLINE c_v64 c_v64_madd_us8(c_v64 a, c_v64 b) {
688 c_v64 t;
689 int32_t u;
690 u = a.u8[0] * b.s8[0] + a.u8[1] * b.s8[1];
691 t.s16[0] = u > 32767 ? 32767 : u < -32768 ? -32768 : u;
692 u = a.u8[2] * b.s8[2] + a.u8[3] * b.s8[3];
693 t.s16[1] = u > 32767 ? 32767 : u < -32768 ? -32768 : u;
694 u = a.u8[4] * b.s8[4] + a.u8[5] * b.s8[5];
695 t.s16[2] = u > 32767 ? 32767 : u < -32768 ? -32768 : u;
696 u = a.u8[6] * b.s8[6] + a.u8[7] * b.s8[7];
697 t.s16[3] = u > 32767 ? 32767 : u < -32768 ? -32768 : u;
698 return t;
699 }
700
c_v64_avg_u8(c_v64 a,c_v64 b)701 SIMD_INLINE c_v64 c_v64_avg_u8(c_v64 a, c_v64 b) {
702 c_v64 t;
703 int c;
704 for (c = 0; c < 8; c++) t.u8[c] = (a.u8[c] + b.u8[c] + 1) >> 1;
705 return t;
706 }
707
c_v64_rdavg_u8(c_v64 a,c_v64 b)708 SIMD_INLINE c_v64 c_v64_rdavg_u8(c_v64 a, c_v64 b) {
709 c_v64 t;
710 int c;
711 for (c = 0; c < 8; c++) t.u8[c] = (a.u8[c] + b.u8[c]) >> 1;
712 return t;
713 }
714
c_v64_rdavg_u16(c_v64 a,c_v64 b)715 SIMD_INLINE c_v64 c_v64_rdavg_u16(c_v64 a, c_v64 b) {
716 c_v64 t;
717 int c;
718 for (c = 0; c < 4; c++) t.u16[c] = (a.u16[c] + b.u16[c]) >> 1;
719 return t;
720 }
721
c_v64_avg_u16(c_v64 a,c_v64 b)722 SIMD_INLINE c_v64 c_v64_avg_u16(c_v64 a, c_v64 b) {
723 c_v64 t;
724 int c;
725 for (c = 0; c < 4; c++) t.u16[c] = (a.u16[c] + b.u16[c] + 1) >> 1;
726 return t;
727 }
728
c_v64_min_u8(c_v64 a,c_v64 b)729 SIMD_INLINE c_v64 c_v64_min_u8(c_v64 a, c_v64 b) {
730 c_v64 t;
731 int c;
732 for (c = 0; c < 8; c++) t.u8[c] = a.u8[c] > b.u8[c] ? b.u8[c] : a.u8[c];
733 return t;
734 }
735
c_v64_max_u8(c_v64 a,c_v64 b)736 SIMD_INLINE c_v64 c_v64_max_u8(c_v64 a, c_v64 b) {
737 c_v64 t;
738 int c;
739 for (c = 0; c < 8; c++) t.u8[c] = a.u8[c] > b.u8[c] ? a.u8[c] : b.u8[c];
740 return t;
741 }
742
c_v64_min_s8(c_v64 a,c_v64 b)743 SIMD_INLINE c_v64 c_v64_min_s8(c_v64 a, c_v64 b) {
744 c_v64 t;
745 int c;
746 for (c = 0; c < 8; c++) t.s8[c] = a.s8[c] > b.s8[c] ? b.s8[c] : a.s8[c];
747 return t;
748 }
749
c_v64_max_s8(c_v64 a,c_v64 b)750 SIMD_INLINE c_v64 c_v64_max_s8(c_v64 a, c_v64 b) {
751 c_v64 t;
752 int c;
753 for (c = 0; c < 8; c++) t.s8[c] = a.s8[c] > b.s8[c] ? a.s8[c] : b.s8[c];
754 return t;
755 }
756
c_v64_min_s16(c_v64 a,c_v64 b)757 SIMD_INLINE c_v64 c_v64_min_s16(c_v64 a, c_v64 b) {
758 c_v64 t;
759 int c;
760 for (c = 0; c < 4; c++) t.s16[c] = a.s16[c] > b.s16[c] ? b.s16[c] : a.s16[c];
761 return t;
762 }
763
c_v64_max_s16(c_v64 a,c_v64 b)764 SIMD_INLINE c_v64 c_v64_max_s16(c_v64 a, c_v64 b) {
765 c_v64 t;
766 int c;
767 for (c = 0; c < 4; c++) t.s16[c] = a.s16[c] > b.s16[c] ? a.s16[c] : b.s16[c];
768 return t;
769 }
770
c_v64_cmpgt_s8(c_v64 a,c_v64 b)771 SIMD_INLINE c_v64 c_v64_cmpgt_s8(c_v64 a, c_v64 b) {
772 c_v64 t;
773 int c;
774 for (c = 0; c < 8; c++) t.s8[c] = -(a.s8[c] > b.s8[c]);
775 return t;
776 }
777
c_v64_cmplt_s8(c_v64 a,c_v64 b)778 SIMD_INLINE c_v64 c_v64_cmplt_s8(c_v64 a, c_v64 b) {
779 c_v64 t;
780 int c;
781 for (c = 0; c < 8; c++) t.s8[c] = -(a.s8[c] < b.s8[c]);
782 return t;
783 }
784
c_v64_cmpeq_8(c_v64 a,c_v64 b)785 SIMD_INLINE c_v64 c_v64_cmpeq_8(c_v64 a, c_v64 b) {
786 c_v64 t;
787 int c;
788 for (c = 0; c < 8; c++) t.s8[c] = -(a.u8[c] == b.u8[c]);
789 return t;
790 }
791
c_v64_cmpgt_s16(c_v64 a,c_v64 b)792 SIMD_INLINE c_v64 c_v64_cmpgt_s16(c_v64 a, c_v64 b) {
793 c_v64 t;
794 int c;
795 for (c = 0; c < 4; c++) t.s16[c] = -(a.s16[c] > b.s16[c]);
796 return t;
797 }
798
c_v64_cmplt_s16(c_v64 a,c_v64 b)799 SIMD_INLINE c_v64 c_v64_cmplt_s16(c_v64 a, c_v64 b) {
800 c_v64 t;
801 int c;
802 for (c = 0; c < 4; c++) t.s16[c] = -(a.s16[c] < b.s16[c]);
803 return t;
804 }
805
c_v64_cmpeq_16(c_v64 a,c_v64 b)806 SIMD_INLINE c_v64 c_v64_cmpeq_16(c_v64 a, c_v64 b) {
807 c_v64 t;
808 int c;
809 for (c = 0; c < 4; c++) t.s16[c] = -(a.u16[c] == b.u16[c]);
810 return t;
811 }
812
c_v64_shl_8(c_v64 a,unsigned int n)813 SIMD_INLINE c_v64 c_v64_shl_8(c_v64 a, unsigned int n) {
814 c_v64 t;
815 int c;
816 if (SIMD_CHECK && n > 7) {
817 fprintf(stderr, "Error: Undefined u8 shift left %d\n", n);
818 abort();
819 }
820 for (c = 0; c < 8; c++) t.s8[c] = a.u8[c] << n;
821 return t;
822 }
823
c_v64_shr_u8(c_v64 a,unsigned int n)824 SIMD_INLINE c_v64 c_v64_shr_u8(c_v64 a, unsigned int n) {
825 c_v64 t;
826 int c;
827 if (SIMD_CHECK && n > 7) {
828 fprintf(stderr, "Error: Undefined u8 shift right %d\n", n);
829 abort();
830 }
831 for (c = 0; c < 8; c++) t.u8[c] = a.u8[c] >> n;
832 return t;
833 }
834
c_v64_shr_s8(c_v64 a,unsigned int n)835 SIMD_INLINE c_v64 c_v64_shr_s8(c_v64 a, unsigned int n) {
836 c_v64 t;
837 int c;
838 if (SIMD_CHECK && n > 7) {
839 fprintf(stderr, "Error: Undefined s8 shift right %d\n", n);
840 abort();
841 }
842 for (c = 0; c < 8; c++) t.s8[c] = a.s8[c] >> n;
843 return t;
844 }
845
c_v64_shl_16(c_v64 a,unsigned int n)846 SIMD_INLINE c_v64 c_v64_shl_16(c_v64 a, unsigned int n) {
847 c_v64 t;
848 int c;
849 if (SIMD_CHECK && n > 15) {
850 fprintf(stderr, "Error: Undefined u16 shift left %d\n", n);
851 abort();
852 }
853 for (c = 0; c < 4; c++) t.u16[c] = a.u16[c] << n;
854 return t;
855 }
856
c_v64_shr_u16(c_v64 a,unsigned int n)857 SIMD_INLINE c_v64 c_v64_shr_u16(c_v64 a, unsigned int n) {
858 c_v64 t;
859 int c;
860 if (SIMD_CHECK && n > 15) {
861 fprintf(stderr, "Error: Undefined u16 shift right %d\n", n);
862 abort();
863 }
864 for (c = 0; c < 4; c++) t.u16[c] = a.u16[c] >> n;
865 return t;
866 }
867
c_v64_shr_s16(c_v64 a,unsigned int n)868 SIMD_INLINE c_v64 c_v64_shr_s16(c_v64 a, unsigned int n) {
869 c_v64 t;
870 int c;
871 if (SIMD_CHECK && n > 15) {
872 fprintf(stderr, "Error: undefined s16 shift right %d\n", n);
873 abort();
874 }
875 for (c = 0; c < 4; c++) t.s16[c] = a.s16[c] >> n;
876 return t;
877 }
878
c_v64_shl_32(c_v64 a,unsigned int n)879 SIMD_INLINE c_v64 c_v64_shl_32(c_v64 a, unsigned int n) {
880 c_v64 t;
881 if (SIMD_CHECK && n > 31) {
882 fprintf(stderr, "Error: undefined u32 shift left %d\n", n);
883 abort();
884 }
885 t.u32[1] = a.u32[1] << n;
886 t.u32[0] = a.u32[0] << n;
887 return t;
888 }
889
c_v64_shr_u32(c_v64 a,unsigned int n)890 SIMD_INLINE c_v64 c_v64_shr_u32(c_v64 a, unsigned int n) {
891 c_v64 t;
892 if (SIMD_CHECK && n > 31) {
893 fprintf(stderr, "Error: undefined u32 shift right %d\n", n);
894 abort();
895 }
896 t.u32[1] = a.u32[1] >> n;
897 t.u32[0] = a.u32[0] >> n;
898 return t;
899 }
900
c_v64_shr_s32(c_v64 a,unsigned int n)901 SIMD_INLINE c_v64 c_v64_shr_s32(c_v64 a, unsigned int n) {
902 c_v64 t;
903 if (SIMD_CHECK && n > 31) {
904 fprintf(stderr, "Error: undefined s32 shift right %d\n", n);
905 abort();
906 }
907 t.s32[1] = a.s32[1] >> n;
908 t.s32[0] = a.s32[0] >> n;
909 return t;
910 }
911
c_v64_shr_n_byte(c_v64 x,unsigned int i)912 SIMD_INLINE c_v64 c_v64_shr_n_byte(c_v64 x, unsigned int i) {
913 c_v64 t;
914 t.u64 = x.u64 >> i * 8;
915 return t;
916 }
917
c_v64_shl_n_byte(c_v64 x,unsigned int i)918 SIMD_INLINE c_v64 c_v64_shl_n_byte(c_v64 x, unsigned int i) {
919 c_v64 t;
920 t.u64 = x.u64 << i * 8;
921 return t;
922 }
923
c_v64_align(c_v64 a,c_v64 b,unsigned int c)924 SIMD_INLINE c_v64 c_v64_align(c_v64 a, c_v64 b, unsigned int c) {
925 if (SIMD_CHECK && c > 7) {
926 fprintf(stderr, "Error: undefined alignment %d\n", c);
927 abort();
928 }
929 return c ? c_v64_or(c_v64_shr_n_byte(b, c), c_v64_shl_n_byte(a, 8 - c)) : b;
930 }
931
c_v64_shl_n_8(c_v64 a,unsigned int c)932 SIMD_INLINE c_v64 c_v64_shl_n_8(c_v64 a, unsigned int c) {
933 return c_v64_shl_8(a, c);
934 }
935
c_v64_shr_n_u8(c_v64 a,unsigned int c)936 SIMD_INLINE c_v64 c_v64_shr_n_u8(c_v64 a, unsigned int c) {
937 return c_v64_shr_u8(a, c);
938 }
939
c_v64_shr_n_s8(c_v64 a,unsigned int c)940 SIMD_INLINE c_v64 c_v64_shr_n_s8(c_v64 a, unsigned int c) {
941 return c_v64_shr_s8(a, c);
942 }
943
c_v64_shl_n_16(c_v64 a,unsigned int c)944 SIMD_INLINE c_v64 c_v64_shl_n_16(c_v64 a, unsigned int c) {
945 return c_v64_shl_16(a, c);
946 }
947
c_v64_shr_n_u16(c_v64 a,unsigned int c)948 SIMD_INLINE c_v64 c_v64_shr_n_u16(c_v64 a, unsigned int c) {
949 return c_v64_shr_u16(a, c);
950 }
951
c_v64_shr_n_s16(c_v64 a,unsigned int c)952 SIMD_INLINE c_v64 c_v64_shr_n_s16(c_v64 a, unsigned int c) {
953 return c_v64_shr_s16(a, c);
954 }
955
c_v64_shl_n_32(c_v64 a,unsigned int c)956 SIMD_INLINE c_v64 c_v64_shl_n_32(c_v64 a, unsigned int c) {
957 return c_v64_shl_32(a, c);
958 }
959
c_v64_shr_n_u32(c_v64 a,unsigned int c)960 SIMD_INLINE c_v64 c_v64_shr_n_u32(c_v64 a, unsigned int c) {
961 return c_v64_shr_u32(a, c);
962 }
963
c_v64_shr_n_s32(c_v64 a,unsigned int c)964 SIMD_INLINE c_v64 c_v64_shr_n_s32(c_v64 a, unsigned int c) {
965 return c_v64_shr_s32(a, c);
966 }
967
968 #endif // AOM_AOM_DSP_SIMD_V64_INTRINSICS_C_H_
969