1
2 /* autogenerated from gstadderorc.orc */
3
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
7 #include <glib.h>
8
9 #ifndef _ORC_INTEGER_TYPEDEFS_
10 #define _ORC_INTEGER_TYPEDEFS_
11 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12 #include <stdint.h>
13 typedef int8_t orc_int8;
14 typedef int16_t orc_int16;
15 typedef int32_t orc_int32;
16 typedef int64_t orc_int64;
17 typedef uint8_t orc_uint8;
18 typedef uint16_t orc_uint16;
19 typedef uint32_t orc_uint32;
20 typedef uint64_t orc_uint64;
21 #define ORC_UINT64_C(x) UINT64_C(x)
22 #elif defined(_MSC_VER)
23 typedef signed __int8 orc_int8;
24 typedef signed __int16 orc_int16;
25 typedef signed __int32 orc_int32;
26 typedef signed __int64 orc_int64;
27 typedef unsigned __int8 orc_uint8;
28 typedef unsigned __int16 orc_uint16;
29 typedef unsigned __int32 orc_uint32;
30 typedef unsigned __int64 orc_uint64;
31 #define ORC_UINT64_C(x) (x##Ui64)
32 #define inline __inline
33 #else
34 #include <limits.h>
35 typedef signed char orc_int8;
36 typedef short orc_int16;
37 typedef int orc_int32;
38 typedef unsigned char orc_uint8;
39 typedef unsigned short orc_uint16;
40 typedef unsigned int orc_uint32;
41 #if INT_MAX == LONG_MAX
42 typedef long long orc_int64;
43 typedef unsigned long long orc_uint64;
44 #define ORC_UINT64_C(x) (x##ULL)
45 #else
46 typedef long orc_int64;
47 typedef unsigned long orc_uint64;
48 #define ORC_UINT64_C(x) (x##UL)
49 #endif
50 #endif
51 typedef union
52 {
53 orc_int16 i;
54 orc_int8 x2[2];
55 } orc_union16;
56 typedef union
57 {
58 orc_int32 i;
59 float f;
60 orc_int16 x2[2];
61 orc_int8 x4[4];
62 } orc_union32;
63 typedef union
64 {
65 orc_int64 i;
66 double f;
67 orc_int32 x2[2];
68 float x2f[2];
69 orc_int16 x4[4];
70 } orc_union64;
71 #endif
72 #ifndef ORC_RESTRICT
73 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
74 #define ORC_RESTRICT restrict
75 #elif defined(__GNUC__) && __GNUC__ >= 4
76 #define ORC_RESTRICT __restrict__
77 #else
78 #define ORC_RESTRICT
79 #endif
80 #endif
81
82 #ifndef ORC_INTERNAL
83 #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
84 #define ORC_INTERNAL __attribute__((visibility("hidden")))
85 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
86 #define ORC_INTERNAL __hidden
87 #elif defined (__GNUC__)
88 #define ORC_INTERNAL __attribute__((visibility("hidden")))
89 #else
90 #define ORC_INTERNAL
91 #endif
92 #endif
93
94
95 #ifndef DISABLE_ORC
96 #include <orc/orc.h>
97 #endif
98 void adder_orc_add_s32 (gint32 * ORC_RESTRICT d1,
99 const gint32 * ORC_RESTRICT s1, int n);
100 void adder_orc_add_s16 (gint16 * ORC_RESTRICT d1,
101 const gint16 * ORC_RESTRICT s1, int n);
102 void adder_orc_add_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1,
103 int n);
104 void adder_orc_add_u32 (guint32 * ORC_RESTRICT d1,
105 const guint32 * ORC_RESTRICT s1, int n);
106 void adder_orc_add_u16 (guint16 * ORC_RESTRICT d1,
107 const guint16 * ORC_RESTRICT s1, int n);
108 void adder_orc_add_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
109 int n);
110 void adder_orc_add_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1,
111 int n);
112 void adder_orc_add_f64 (double *ORC_RESTRICT d1, const double *ORC_RESTRICT s1,
113 int n);
114 void adder_orc_volume_u8 (guint8 * ORC_RESTRICT d1, int p1, int n);
115 void adder_orc_volume_s8 (gint8 * ORC_RESTRICT d1, int p1, int n);
116 void adder_orc_volume_u16 (guint16 * ORC_RESTRICT d1, int p1, int n);
117 void adder_orc_volume_s16 (gint16 * ORC_RESTRICT d1, int p1, int n);
118 void adder_orc_volume_u32 (guint32 * ORC_RESTRICT d1, int p1, int n);
119 void adder_orc_volume_s32 (gint32 * ORC_RESTRICT d1, int p1, int n);
120 void adder_orc_volume_f32 (float *ORC_RESTRICT d1, float p1, int n);
121 void adder_orc_volume_f64 (double *ORC_RESTRICT d1, double p1, int n);
122 void adder_orc_add_volume_u8 (guint8 * ORC_RESTRICT d1,
123 const guint8 * ORC_RESTRICT s1, int p1, int n);
124 void adder_orc_add_volume_s8 (gint8 * ORC_RESTRICT d1,
125 const gint8 * ORC_RESTRICT s1, int p1, int n);
126 void adder_orc_add_volume_u16 (guint16 * ORC_RESTRICT d1,
127 const guint16 * ORC_RESTRICT s1, int p1, int n);
128 void adder_orc_add_volume_s16 (gint16 * ORC_RESTRICT d1,
129 const gint16 * ORC_RESTRICT s1, int p1, int n);
130 void adder_orc_add_volume_u32 (guint32 * ORC_RESTRICT d1,
131 const guint32 * ORC_RESTRICT s1, int p1, int n);
132 void adder_orc_add_volume_s32 (gint32 * ORC_RESTRICT d1,
133 const gint32 * ORC_RESTRICT s1, int p1, int n);
134 void adder_orc_add_volume_f32 (float *ORC_RESTRICT d1,
135 const float *ORC_RESTRICT s1, float p1, int n);
136 void adder_orc_add_volume_f64 (double *ORC_RESTRICT d1,
137 const double *ORC_RESTRICT s1, double p1, int n);
138
139
140 /* begin Orc C target preamble */
141 #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
142 #define ORC_ABS(a) ((a)<0 ? -(a) : (a))
143 #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))
144 #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))
145 #define ORC_SB_MAX 127
146 #define ORC_SB_MIN (-1-ORC_SB_MAX)
147 #define ORC_UB_MAX (orc_uint8) 255
148 #define ORC_UB_MIN 0
149 #define ORC_SW_MAX 32767
150 #define ORC_SW_MIN (-1-ORC_SW_MAX)
151 #define ORC_UW_MAX (orc_uint16)65535
152 #define ORC_UW_MIN 0
153 #define ORC_SL_MAX 2147483647
154 #define ORC_SL_MIN (-1-ORC_SL_MAX)
155 #define ORC_UL_MAX 4294967295U
156 #define ORC_UL_MIN 0
157 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)
158 #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)
159 #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)
160 #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)
161 #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)
162 #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)
163 #define ORC_SWAP_W(x) ((((x)&0xffU)<<8) | (((x)&0xff00U)>>8))
164 #define ORC_SWAP_L(x) ((((x)&0xffU)<<24) | (((x)&0xff00U)<<8) | (((x)&0xff0000U)>>8) | (((x)&0xff000000U)>>24))
165 #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56))
166 #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))
167 #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))
168 #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
169 #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
170 #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
171 #ifndef ORC_RESTRICT
172 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
173 #define ORC_RESTRICT restrict
174 #elif defined(__GNUC__) && __GNUC__ >= 4
175 #define ORC_RESTRICT __restrict__
176 #else
177 #define ORC_RESTRICT
178 #endif
179 #endif
180 /* end Orc C target preamble */
181
182
183
184 /* adder_orc_add_s32 */
185 #ifdef DISABLE_ORC
186 void
adder_orc_add_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int n)187 adder_orc_add_s32 (gint32 * ORC_RESTRICT d1, const gint32 * ORC_RESTRICT s1,
188 int n)
189 {
190 int i;
191 orc_union32 *ORC_RESTRICT ptr0;
192 const orc_union32 *ORC_RESTRICT ptr4;
193 orc_union32 var32;
194 orc_union32 var33;
195 orc_union32 var34;
196
197 ptr0 = (orc_union32 *) d1;
198 ptr4 = (orc_union32 *) s1;
199
200
201 for (i = 0; i < n; i++) {
202 /* 0: loadl */
203 var32 = ptr0[i];
204 /* 1: loadl */
205 var33 = ptr4[i];
206 /* 2: addssl */
207 var34.i = ORC_CLAMP_SL ((orc_int64) var32.i + (orc_int64) var33.i);
208 /* 3: storel */
209 ptr0[i] = var34;
210 }
211
212 }
213
214 #else
215 static void
_backup_adder_orc_add_s32(OrcExecutor * ORC_RESTRICT ex)216 _backup_adder_orc_add_s32 (OrcExecutor * ORC_RESTRICT ex)
217 {
218 int i;
219 int n = ex->n;
220 orc_union32 *ORC_RESTRICT ptr0;
221 const orc_union32 *ORC_RESTRICT ptr4;
222 orc_union32 var32;
223 orc_union32 var33;
224 orc_union32 var34;
225
226 ptr0 = (orc_union32 *) ex->arrays[0];
227 ptr4 = (orc_union32 *) ex->arrays[4];
228
229
230 for (i = 0; i < n; i++) {
231 /* 0: loadl */
232 var32 = ptr0[i];
233 /* 1: loadl */
234 var33 = ptr4[i];
235 /* 2: addssl */
236 var34.i = ORC_CLAMP_SL ((orc_int64) var32.i + (orc_int64) var33.i);
237 /* 3: storel */
238 ptr0[i] = var34;
239 }
240
241 }
242
243 void
adder_orc_add_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int n)244 adder_orc_add_s32 (gint32 * ORC_RESTRICT d1, const gint32 * ORC_RESTRICT s1,
245 int n)
246 {
247 OrcExecutor _ex, *ex = &_ex;
248 static volatile int p_inited = 0;
249 static OrcCode *c = 0;
250 void (*func) (OrcExecutor *);
251
252 if (!p_inited) {
253 orc_once_mutex_lock ();
254 if (!p_inited) {
255 OrcProgram *p;
256
257 #if 1
258 static const orc_uint8 bc[] = {
259 1, 9, 17, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
260 95, 115, 51, 50, 11, 4, 4, 12, 4, 4, 104, 0, 0, 4, 2, 0,
261
262 };
263 p = orc_program_new_from_static_bytecode (bc);
264 orc_program_set_backup_function (p, _backup_adder_orc_add_s32);
265 #else
266 p = orc_program_new ();
267 orc_program_set_name (p, "adder_orc_add_s32");
268 orc_program_set_backup_function (p, _backup_adder_orc_add_s32);
269 orc_program_add_destination (p, 4, "d1");
270 orc_program_add_source (p, 4, "s1");
271
272 orc_program_append_2 (p, "addssl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
273 ORC_VAR_D1);
274 #endif
275
276 orc_program_compile (p);
277 c = orc_program_take_code (p);
278 orc_program_free (p);
279 }
280 p_inited = TRUE;
281 orc_once_mutex_unlock ();
282 }
283 ex->arrays[ORC_VAR_A2] = c;
284 ex->program = 0;
285
286 ex->n = n;
287 ex->arrays[ORC_VAR_D1] = d1;
288 ex->arrays[ORC_VAR_S1] = (void *) s1;
289
290 func = c->exec;
291 func (ex);
292 }
293 #endif
294
295
296 /* adder_orc_add_s16 */
297 #ifdef DISABLE_ORC
298 void
adder_orc_add_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int n)299 adder_orc_add_s16 (gint16 * ORC_RESTRICT d1, const gint16 * ORC_RESTRICT s1,
300 int n)
301 {
302 int i;
303 orc_union16 *ORC_RESTRICT ptr0;
304 const orc_union16 *ORC_RESTRICT ptr4;
305 orc_union16 var32;
306 orc_union16 var33;
307 orc_union16 var34;
308
309 ptr0 = (orc_union16 *) d1;
310 ptr4 = (orc_union16 *) s1;
311
312
313 for (i = 0; i < n; i++) {
314 /* 0: loadw */
315 var32 = ptr0[i];
316 /* 1: loadw */
317 var33 = ptr4[i];
318 /* 2: addssw */
319 var34.i = ORC_CLAMP_SW (var32.i + var33.i);
320 /* 3: storew */
321 ptr0[i] = var34;
322 }
323
324 }
325
326 #else
327 static void
_backup_adder_orc_add_s16(OrcExecutor * ORC_RESTRICT ex)328 _backup_adder_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex)
329 {
330 int i;
331 int n = ex->n;
332 orc_union16 *ORC_RESTRICT ptr0;
333 const orc_union16 *ORC_RESTRICT ptr4;
334 orc_union16 var32;
335 orc_union16 var33;
336 orc_union16 var34;
337
338 ptr0 = (orc_union16 *) ex->arrays[0];
339 ptr4 = (orc_union16 *) ex->arrays[4];
340
341
342 for (i = 0; i < n; i++) {
343 /* 0: loadw */
344 var32 = ptr0[i];
345 /* 1: loadw */
346 var33 = ptr4[i];
347 /* 2: addssw */
348 var34.i = ORC_CLAMP_SW (var32.i + var33.i);
349 /* 3: storew */
350 ptr0[i] = var34;
351 }
352
353 }
354
355 void
adder_orc_add_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int n)356 adder_orc_add_s16 (gint16 * ORC_RESTRICT d1, const gint16 * ORC_RESTRICT s1,
357 int n)
358 {
359 OrcExecutor _ex, *ex = &_ex;
360 static volatile int p_inited = 0;
361 static OrcCode *c = 0;
362 void (*func) (OrcExecutor *);
363
364 if (!p_inited) {
365 orc_once_mutex_lock ();
366 if (!p_inited) {
367 OrcProgram *p;
368
369 #if 1
370 static const orc_uint8 bc[] = {
371 1, 9, 17, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
372 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 71, 0, 0, 4, 2, 0,
373
374 };
375 p = orc_program_new_from_static_bytecode (bc);
376 orc_program_set_backup_function (p, _backup_adder_orc_add_s16);
377 #else
378 p = orc_program_new ();
379 orc_program_set_name (p, "adder_orc_add_s16");
380 orc_program_set_backup_function (p, _backup_adder_orc_add_s16);
381 orc_program_add_destination (p, 2, "d1");
382 orc_program_add_source (p, 2, "s1");
383
384 orc_program_append_2 (p, "addssw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
385 ORC_VAR_D1);
386 #endif
387
388 orc_program_compile (p);
389 c = orc_program_take_code (p);
390 orc_program_free (p);
391 }
392 p_inited = TRUE;
393 orc_once_mutex_unlock ();
394 }
395 ex->arrays[ORC_VAR_A2] = c;
396 ex->program = 0;
397
398 ex->n = n;
399 ex->arrays[ORC_VAR_D1] = d1;
400 ex->arrays[ORC_VAR_S1] = (void *) s1;
401
402 func = c->exec;
403 func (ex);
404 }
405 #endif
406
407
408 /* adder_orc_add_s8 */
409 #ifdef DISABLE_ORC
410 void
adder_orc_add_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int n)411 adder_orc_add_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1, int n)
412 {
413 int i;
414 orc_int8 *ORC_RESTRICT ptr0;
415 const orc_int8 *ORC_RESTRICT ptr4;
416 orc_int8 var32;
417 orc_int8 var33;
418 orc_int8 var34;
419
420 ptr0 = (orc_int8 *) d1;
421 ptr4 = (orc_int8 *) s1;
422
423
424 for (i = 0; i < n; i++) {
425 /* 0: loadb */
426 var32 = ptr0[i];
427 /* 1: loadb */
428 var33 = ptr4[i];
429 /* 2: addssb */
430 var34 = ORC_CLAMP_SB (var32 + var33);
431 /* 3: storeb */
432 ptr0[i] = var34;
433 }
434
435 }
436
437 #else
438 static void
_backup_adder_orc_add_s8(OrcExecutor * ORC_RESTRICT ex)439 _backup_adder_orc_add_s8 (OrcExecutor * ORC_RESTRICT ex)
440 {
441 int i;
442 int n = ex->n;
443 orc_int8 *ORC_RESTRICT ptr0;
444 const orc_int8 *ORC_RESTRICT ptr4;
445 orc_int8 var32;
446 orc_int8 var33;
447 orc_int8 var34;
448
449 ptr0 = (orc_int8 *) ex->arrays[0];
450 ptr4 = (orc_int8 *) ex->arrays[4];
451
452
453 for (i = 0; i < n; i++) {
454 /* 0: loadb */
455 var32 = ptr0[i];
456 /* 1: loadb */
457 var33 = ptr4[i];
458 /* 2: addssb */
459 var34 = ORC_CLAMP_SB (var32 + var33);
460 /* 3: storeb */
461 ptr0[i] = var34;
462 }
463
464 }
465
466 void
adder_orc_add_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int n)467 adder_orc_add_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1, int n)
468 {
469 OrcExecutor _ex, *ex = &_ex;
470 static volatile int p_inited = 0;
471 static OrcCode *c = 0;
472 void (*func) (OrcExecutor *);
473
474 if (!p_inited) {
475 orc_once_mutex_lock ();
476 if (!p_inited) {
477 OrcProgram *p;
478
479 #if 1
480 static const orc_uint8 bc[] = {
481 1, 9, 16, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
482 95, 115, 56, 11, 1, 1, 12, 1, 1, 34, 0, 0, 4, 2, 0,
483 };
484 p = orc_program_new_from_static_bytecode (bc);
485 orc_program_set_backup_function (p, _backup_adder_orc_add_s8);
486 #else
487 p = orc_program_new ();
488 orc_program_set_name (p, "adder_orc_add_s8");
489 orc_program_set_backup_function (p, _backup_adder_orc_add_s8);
490 orc_program_add_destination (p, 1, "d1");
491 orc_program_add_source (p, 1, "s1");
492
493 orc_program_append_2 (p, "addssb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
494 ORC_VAR_D1);
495 #endif
496
497 orc_program_compile (p);
498 c = orc_program_take_code (p);
499 orc_program_free (p);
500 }
501 p_inited = TRUE;
502 orc_once_mutex_unlock ();
503 }
504 ex->arrays[ORC_VAR_A2] = c;
505 ex->program = 0;
506
507 ex->n = n;
508 ex->arrays[ORC_VAR_D1] = d1;
509 ex->arrays[ORC_VAR_S1] = (void *) s1;
510
511 func = c->exec;
512 func (ex);
513 }
514 #endif
515
516
517 /* adder_orc_add_u32 */
518 #ifdef DISABLE_ORC
519 void
adder_orc_add_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int n)520 adder_orc_add_u32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1,
521 int n)
522 {
523 int i;
524 orc_union32 *ORC_RESTRICT ptr0;
525 const orc_union32 *ORC_RESTRICT ptr4;
526 orc_union32 var32;
527 orc_union32 var33;
528 orc_union32 var34;
529
530 ptr0 = (orc_union32 *) d1;
531 ptr4 = (orc_union32 *) s1;
532
533
534 for (i = 0; i < n; i++) {
535 /* 0: loadl */
536 var32 = ptr0[i];
537 /* 1: loadl */
538 var33 = ptr4[i];
539 /* 2: addusl */
540 var34.i =
541 ORC_CLAMP_UL ((orc_int64) (orc_uint32) var32.i +
542 (orc_int64) (orc_uint32) var33.i);
543 /* 3: storel */
544 ptr0[i] = var34;
545 }
546
547 }
548
549 #else
550 static void
_backup_adder_orc_add_u32(OrcExecutor * ORC_RESTRICT ex)551 _backup_adder_orc_add_u32 (OrcExecutor * ORC_RESTRICT ex)
552 {
553 int i;
554 int n = ex->n;
555 orc_union32 *ORC_RESTRICT ptr0;
556 const orc_union32 *ORC_RESTRICT ptr4;
557 orc_union32 var32;
558 orc_union32 var33;
559 orc_union32 var34;
560
561 ptr0 = (orc_union32 *) ex->arrays[0];
562 ptr4 = (orc_union32 *) ex->arrays[4];
563
564
565 for (i = 0; i < n; i++) {
566 /* 0: loadl */
567 var32 = ptr0[i];
568 /* 1: loadl */
569 var33 = ptr4[i];
570 /* 2: addusl */
571 var34.i =
572 ORC_CLAMP_UL ((orc_int64) (orc_uint32) var32.i +
573 (orc_int64) (orc_uint32) var33.i);
574 /* 3: storel */
575 ptr0[i] = var34;
576 }
577
578 }
579
580 void
adder_orc_add_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int n)581 adder_orc_add_u32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1,
582 int n)
583 {
584 OrcExecutor _ex, *ex = &_ex;
585 static volatile int p_inited = 0;
586 static OrcCode *c = 0;
587 void (*func) (OrcExecutor *);
588
589 if (!p_inited) {
590 orc_once_mutex_lock ();
591 if (!p_inited) {
592 OrcProgram *p;
593
594 #if 1
595 static const orc_uint8 bc[] = {
596 1, 9, 17, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
597 95, 117, 51, 50, 11, 4, 4, 12, 4, 4, 105, 0, 0, 4, 2, 0,
598
599 };
600 p = orc_program_new_from_static_bytecode (bc);
601 orc_program_set_backup_function (p, _backup_adder_orc_add_u32);
602 #else
603 p = orc_program_new ();
604 orc_program_set_name (p, "adder_orc_add_u32");
605 orc_program_set_backup_function (p, _backup_adder_orc_add_u32);
606 orc_program_add_destination (p, 4, "d1");
607 orc_program_add_source (p, 4, "s1");
608
609 orc_program_append_2 (p, "addusl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
610 ORC_VAR_D1);
611 #endif
612
613 orc_program_compile (p);
614 c = orc_program_take_code (p);
615 orc_program_free (p);
616 }
617 p_inited = TRUE;
618 orc_once_mutex_unlock ();
619 }
620 ex->arrays[ORC_VAR_A2] = c;
621 ex->program = 0;
622
623 ex->n = n;
624 ex->arrays[ORC_VAR_D1] = d1;
625 ex->arrays[ORC_VAR_S1] = (void *) s1;
626
627 func = c->exec;
628 func (ex);
629 }
630 #endif
631
632
633 /* adder_orc_add_u16 */
634 #ifdef DISABLE_ORC
635 void
adder_orc_add_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int n)636 adder_orc_add_u16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1,
637 int n)
638 {
639 int i;
640 orc_union16 *ORC_RESTRICT ptr0;
641 const orc_union16 *ORC_RESTRICT ptr4;
642 orc_union16 var32;
643 orc_union16 var33;
644 orc_union16 var34;
645
646 ptr0 = (orc_union16 *) d1;
647 ptr4 = (orc_union16 *) s1;
648
649
650 for (i = 0; i < n; i++) {
651 /* 0: loadw */
652 var32 = ptr0[i];
653 /* 1: loadw */
654 var33 = ptr4[i];
655 /* 2: addusw */
656 var34.i = ORC_CLAMP_UW ((orc_uint16) var32.i + (orc_uint16) var33.i);
657 /* 3: storew */
658 ptr0[i] = var34;
659 }
660
661 }
662
663 #else
664 static void
_backup_adder_orc_add_u16(OrcExecutor * ORC_RESTRICT ex)665 _backup_adder_orc_add_u16 (OrcExecutor * ORC_RESTRICT ex)
666 {
667 int i;
668 int n = ex->n;
669 orc_union16 *ORC_RESTRICT ptr0;
670 const orc_union16 *ORC_RESTRICT ptr4;
671 orc_union16 var32;
672 orc_union16 var33;
673 orc_union16 var34;
674
675 ptr0 = (orc_union16 *) ex->arrays[0];
676 ptr4 = (orc_union16 *) ex->arrays[4];
677
678
679 for (i = 0; i < n; i++) {
680 /* 0: loadw */
681 var32 = ptr0[i];
682 /* 1: loadw */
683 var33 = ptr4[i];
684 /* 2: addusw */
685 var34.i = ORC_CLAMP_UW ((orc_uint16) var32.i + (orc_uint16) var33.i);
686 /* 3: storew */
687 ptr0[i] = var34;
688 }
689
690 }
691
692 void
adder_orc_add_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int n)693 adder_orc_add_u16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1,
694 int n)
695 {
696 OrcExecutor _ex, *ex = &_ex;
697 static volatile int p_inited = 0;
698 static OrcCode *c = 0;
699 void (*func) (OrcExecutor *);
700
701 if (!p_inited) {
702 orc_once_mutex_lock ();
703 if (!p_inited) {
704 OrcProgram *p;
705
706 #if 1
707 static const orc_uint8 bc[] = {
708 1, 9, 17, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
709 95, 117, 49, 54, 11, 2, 2, 12, 2, 2, 72, 0, 0, 4, 2, 0,
710
711 };
712 p = orc_program_new_from_static_bytecode (bc);
713 orc_program_set_backup_function (p, _backup_adder_orc_add_u16);
714 #else
715 p = orc_program_new ();
716 orc_program_set_name (p, "adder_orc_add_u16");
717 orc_program_set_backup_function (p, _backup_adder_orc_add_u16);
718 orc_program_add_destination (p, 2, "d1");
719 orc_program_add_source (p, 2, "s1");
720
721 orc_program_append_2 (p, "addusw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
722 ORC_VAR_D1);
723 #endif
724
725 orc_program_compile (p);
726 c = orc_program_take_code (p);
727 orc_program_free (p);
728 }
729 p_inited = TRUE;
730 orc_once_mutex_unlock ();
731 }
732 ex->arrays[ORC_VAR_A2] = c;
733 ex->program = 0;
734
735 ex->n = n;
736 ex->arrays[ORC_VAR_D1] = d1;
737 ex->arrays[ORC_VAR_S1] = (void *) s1;
738
739 func = c->exec;
740 func (ex);
741 }
742 #endif
743
744
745 /* adder_orc_add_u8 */
746 #ifdef DISABLE_ORC
747 void
adder_orc_add_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int n)748 adder_orc_add_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
749 int n)
750 {
751 int i;
752 orc_int8 *ORC_RESTRICT ptr0;
753 const orc_int8 *ORC_RESTRICT ptr4;
754 orc_int8 var32;
755 orc_int8 var33;
756 orc_int8 var34;
757
758 ptr0 = (orc_int8 *) d1;
759 ptr4 = (orc_int8 *) s1;
760
761
762 for (i = 0; i < n; i++) {
763 /* 0: loadb */
764 var32 = ptr0[i];
765 /* 1: loadb */
766 var33 = ptr4[i];
767 /* 2: addusb */
768 var34 = ORC_CLAMP_UB ((orc_uint8) var32 + (orc_uint8) var33);
769 /* 3: storeb */
770 ptr0[i] = var34;
771 }
772
773 }
774
775 #else
776 static void
_backup_adder_orc_add_u8(OrcExecutor * ORC_RESTRICT ex)777 _backup_adder_orc_add_u8 (OrcExecutor * ORC_RESTRICT ex)
778 {
779 int i;
780 int n = ex->n;
781 orc_int8 *ORC_RESTRICT ptr0;
782 const orc_int8 *ORC_RESTRICT ptr4;
783 orc_int8 var32;
784 orc_int8 var33;
785 orc_int8 var34;
786
787 ptr0 = (orc_int8 *) ex->arrays[0];
788 ptr4 = (orc_int8 *) ex->arrays[4];
789
790
791 for (i = 0; i < n; i++) {
792 /* 0: loadb */
793 var32 = ptr0[i];
794 /* 1: loadb */
795 var33 = ptr4[i];
796 /* 2: addusb */
797 var34 = ORC_CLAMP_UB ((orc_uint8) var32 + (orc_uint8) var33);
798 /* 3: storeb */
799 ptr0[i] = var34;
800 }
801
802 }
803
804 void
adder_orc_add_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int n)805 adder_orc_add_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
806 int n)
807 {
808 OrcExecutor _ex, *ex = &_ex;
809 static volatile int p_inited = 0;
810 static OrcCode *c = 0;
811 void (*func) (OrcExecutor *);
812
813 if (!p_inited) {
814 orc_once_mutex_lock ();
815 if (!p_inited) {
816 OrcProgram *p;
817
818 #if 1
819 static const orc_uint8 bc[] = {
820 1, 9, 16, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
821 95, 117, 56, 11, 1, 1, 12, 1, 1, 35, 0, 0, 4, 2, 0,
822 };
823 p = orc_program_new_from_static_bytecode (bc);
824 orc_program_set_backup_function (p, _backup_adder_orc_add_u8);
825 #else
826 p = orc_program_new ();
827 orc_program_set_name (p, "adder_orc_add_u8");
828 orc_program_set_backup_function (p, _backup_adder_orc_add_u8);
829 orc_program_add_destination (p, 1, "d1");
830 orc_program_add_source (p, 1, "s1");
831
832 orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
833 ORC_VAR_D1);
834 #endif
835
836 orc_program_compile (p);
837 c = orc_program_take_code (p);
838 orc_program_free (p);
839 }
840 p_inited = TRUE;
841 orc_once_mutex_unlock ();
842 }
843 ex->arrays[ORC_VAR_A2] = c;
844 ex->program = 0;
845
846 ex->n = n;
847 ex->arrays[ORC_VAR_D1] = d1;
848 ex->arrays[ORC_VAR_S1] = (void *) s1;
849
850 func = c->exec;
851 func (ex);
852 }
853 #endif
854
855
856 /* adder_orc_add_f32 */
857 #ifdef DISABLE_ORC
858 void
adder_orc_add_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,int n)859 adder_orc_add_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1, int n)
860 {
861 int i;
862 orc_union32 *ORC_RESTRICT ptr0;
863 const orc_union32 *ORC_RESTRICT ptr4;
864 orc_union32 var32;
865 orc_union32 var33;
866 orc_union32 var34;
867
868 ptr0 = (orc_union32 *) d1;
869 ptr4 = (orc_union32 *) s1;
870
871
872 for (i = 0; i < n; i++) {
873 /* 0: loadl */
874 var32 = ptr0[i];
875 /* 1: loadl */
876 var33 = ptr4[i];
877 /* 2: addf */
878 {
879 orc_union32 _src1;
880 orc_union32 _src2;
881 orc_union32 _dest1;
882 _src1.i = ORC_DENORMAL (var32.i);
883 _src2.i = ORC_DENORMAL (var33.i);
884 _dest1.f = _src1.f + _src2.f;
885 var34.i = ORC_DENORMAL (_dest1.i);
886 }
887 /* 3: storel */
888 ptr0[i] = var34;
889 }
890
891 }
892
893 #else
894 static void
_backup_adder_orc_add_f32(OrcExecutor * ORC_RESTRICT ex)895 _backup_adder_orc_add_f32 (OrcExecutor * ORC_RESTRICT ex)
896 {
897 int i;
898 int n = ex->n;
899 orc_union32 *ORC_RESTRICT ptr0;
900 const orc_union32 *ORC_RESTRICT ptr4;
901 orc_union32 var32;
902 orc_union32 var33;
903 orc_union32 var34;
904
905 ptr0 = (orc_union32 *) ex->arrays[0];
906 ptr4 = (orc_union32 *) ex->arrays[4];
907
908
909 for (i = 0; i < n; i++) {
910 /* 0: loadl */
911 var32 = ptr0[i];
912 /* 1: loadl */
913 var33 = ptr4[i];
914 /* 2: addf */
915 {
916 orc_union32 _src1;
917 orc_union32 _src2;
918 orc_union32 _dest1;
919 _src1.i = ORC_DENORMAL (var32.i);
920 _src2.i = ORC_DENORMAL (var33.i);
921 _dest1.f = _src1.f + _src2.f;
922 var34.i = ORC_DENORMAL (_dest1.i);
923 }
924 /* 3: storel */
925 ptr0[i] = var34;
926 }
927
928 }
929
930 void
adder_orc_add_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,int n)931 adder_orc_add_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1, int n)
932 {
933 OrcExecutor _ex, *ex = &_ex;
934 static volatile int p_inited = 0;
935 static OrcCode *c = 0;
936 void (*func) (OrcExecutor *);
937
938 if (!p_inited) {
939 orc_once_mutex_lock ();
940 if (!p_inited) {
941 OrcProgram *p;
942
943 #if 1
944 static const orc_uint8 bc[] = {
945 1, 9, 17, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
946 95, 102, 51, 50, 11, 4, 4, 12, 4, 4, 200, 0, 0, 4, 2, 0,
947
948 };
949 p = orc_program_new_from_static_bytecode (bc);
950 orc_program_set_backup_function (p, _backup_adder_orc_add_f32);
951 #else
952 p = orc_program_new ();
953 orc_program_set_name (p, "adder_orc_add_f32");
954 orc_program_set_backup_function (p, _backup_adder_orc_add_f32);
955 orc_program_add_destination (p, 4, "d1");
956 orc_program_add_source (p, 4, "s1");
957
958 orc_program_append_2 (p, "addf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
959 ORC_VAR_D1);
960 #endif
961
962 orc_program_compile (p);
963 c = orc_program_take_code (p);
964 orc_program_free (p);
965 }
966 p_inited = TRUE;
967 orc_once_mutex_unlock ();
968 }
969 ex->arrays[ORC_VAR_A2] = c;
970 ex->program = 0;
971
972 ex->n = n;
973 ex->arrays[ORC_VAR_D1] = d1;
974 ex->arrays[ORC_VAR_S1] = (void *) s1;
975
976 func = c->exec;
977 func (ex);
978 }
979 #endif
980
981
982 /* adder_orc_add_f64 */
983 #ifdef DISABLE_ORC
984 void
adder_orc_add_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,int n)985 adder_orc_add_f64 (double *ORC_RESTRICT d1, const double *ORC_RESTRICT s1,
986 int n)
987 {
988 int i;
989 orc_union64 *ORC_RESTRICT ptr0;
990 const orc_union64 *ORC_RESTRICT ptr4;
991 orc_union64 var32;
992 orc_union64 var33;
993 orc_union64 var34;
994
995 ptr0 = (orc_union64 *) d1;
996 ptr4 = (orc_union64 *) s1;
997
998
999 for (i = 0; i < n; i++) {
1000 /* 0: loadq */
1001 var32 = ptr0[i];
1002 /* 1: loadq */
1003 var33 = ptr4[i];
1004 /* 2: addd */
1005 {
1006 orc_union64 _src1;
1007 orc_union64 _src2;
1008 orc_union64 _dest1;
1009 _src1.i = ORC_DENORMAL_DOUBLE (var32.i);
1010 _src2.i = ORC_DENORMAL_DOUBLE (var33.i);
1011 _dest1.f = _src1.f + _src2.f;
1012 var34.i = ORC_DENORMAL_DOUBLE (_dest1.i);
1013 }
1014 /* 3: storeq */
1015 ptr0[i] = var34;
1016 }
1017
1018 }
1019
1020 #else
1021 static void
_backup_adder_orc_add_f64(OrcExecutor * ORC_RESTRICT ex)1022 _backup_adder_orc_add_f64 (OrcExecutor * ORC_RESTRICT ex)
1023 {
1024 int i;
1025 int n = ex->n;
1026 orc_union64 *ORC_RESTRICT ptr0;
1027 const orc_union64 *ORC_RESTRICT ptr4;
1028 orc_union64 var32;
1029 orc_union64 var33;
1030 orc_union64 var34;
1031
1032 ptr0 = (orc_union64 *) ex->arrays[0];
1033 ptr4 = (orc_union64 *) ex->arrays[4];
1034
1035
1036 for (i = 0; i < n; i++) {
1037 /* 0: loadq */
1038 var32 = ptr0[i];
1039 /* 1: loadq */
1040 var33 = ptr4[i];
1041 /* 2: addd */
1042 {
1043 orc_union64 _src1;
1044 orc_union64 _src2;
1045 orc_union64 _dest1;
1046 _src1.i = ORC_DENORMAL_DOUBLE (var32.i);
1047 _src2.i = ORC_DENORMAL_DOUBLE (var33.i);
1048 _dest1.f = _src1.f + _src2.f;
1049 var34.i = ORC_DENORMAL_DOUBLE (_dest1.i);
1050 }
1051 /* 3: storeq */
1052 ptr0[i] = var34;
1053 }
1054
1055 }
1056
1057 void
adder_orc_add_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,int n)1058 adder_orc_add_f64 (double *ORC_RESTRICT d1, const double *ORC_RESTRICT s1,
1059 int n)
1060 {
1061 OrcExecutor _ex, *ex = &_ex;
1062 static volatile int p_inited = 0;
1063 static OrcCode *c = 0;
1064 void (*func) (OrcExecutor *);
1065
1066 if (!p_inited) {
1067 orc_once_mutex_lock ();
1068 if (!p_inited) {
1069 OrcProgram *p;
1070
1071 #if 1
1072 static const orc_uint8 bc[] = {
1073 1, 9, 17, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
1074 95, 102, 54, 52, 11, 8, 8, 12, 8, 8, 212, 0, 0, 4, 2, 0,
1075
1076 };
1077 p = orc_program_new_from_static_bytecode (bc);
1078 orc_program_set_backup_function (p, _backup_adder_orc_add_f64);
1079 #else
1080 p = orc_program_new ();
1081 orc_program_set_name (p, "adder_orc_add_f64");
1082 orc_program_set_backup_function (p, _backup_adder_orc_add_f64);
1083 orc_program_add_destination (p, 8, "d1");
1084 orc_program_add_source (p, 8, "s1");
1085
1086 orc_program_append_2 (p, "addd", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
1087 ORC_VAR_D1);
1088 #endif
1089
1090 orc_program_compile (p);
1091 c = orc_program_take_code (p);
1092 orc_program_free (p);
1093 }
1094 p_inited = TRUE;
1095 orc_once_mutex_unlock ();
1096 }
1097 ex->arrays[ORC_VAR_A2] = c;
1098 ex->program = 0;
1099
1100 ex->n = n;
1101 ex->arrays[ORC_VAR_D1] = d1;
1102 ex->arrays[ORC_VAR_S1] = (void *) s1;
1103
1104 func = c->exec;
1105 func (ex);
1106 }
1107 #endif
1108
1109
1110 /* adder_orc_volume_u8 */
1111 #ifdef DISABLE_ORC
1112 void
adder_orc_volume_u8(guint8 * ORC_RESTRICT d1,int p1,int n)1113 adder_orc_volume_u8 (guint8 * ORC_RESTRICT d1, int p1, int n)
1114 {
1115 int i;
1116 orc_int8 *ORC_RESTRICT ptr0;
1117 orc_int8 var34;
1118 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1119 volatile orc_int8 var35;
1120 #else
1121 orc_int8 var35;
1122 #endif
1123 orc_int8 var36;
1124 orc_int8 var37;
1125 orc_int8 var38;
1126 orc_union16 var39;
1127 orc_union16 var40;
1128 orc_int8 var41;
1129
1130 ptr0 = (orc_int8 *) d1;
1131
1132 /* 1: loadpb */
1133 var35 = 0x00000080; /* 128 or 6.32404e-322f */
1134 /* 3: loadpb */
1135 var36 = p1;
1136
1137 for (i = 0; i < n; i++) {
1138 /* 0: loadb */
1139 var34 = ptr0[i];
1140 /* 2: xorb */
1141 var38 = var34 ^ var35;
1142 /* 4: mulsbw */
1143 var39.i = var38 * var36;
1144 /* 5: shrsw */
1145 var40.i = var39.i >> 3;
1146 /* 6: convssswb */
1147 var41 = ORC_CLAMP_SB (var40.i);
1148 /* 7: xorb */
1149 var37 = var41 ^ var35;
1150 /* 8: storeb */
1151 ptr0[i] = var37;
1152 }
1153
1154 }
1155
1156 #else
1157 static void
_backup_adder_orc_volume_u8(OrcExecutor * ORC_RESTRICT ex)1158 _backup_adder_orc_volume_u8 (OrcExecutor * ORC_RESTRICT ex)
1159 {
1160 int i;
1161 int n = ex->n;
1162 orc_int8 *ORC_RESTRICT ptr0;
1163 orc_int8 var34;
1164 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1165 volatile orc_int8 var35;
1166 #else
1167 orc_int8 var35;
1168 #endif
1169 orc_int8 var36;
1170 orc_int8 var37;
1171 orc_int8 var38;
1172 orc_union16 var39;
1173 orc_union16 var40;
1174 orc_int8 var41;
1175
1176 ptr0 = (orc_int8 *) ex->arrays[0];
1177
1178 /* 1: loadpb */
1179 var35 = 0x00000080; /* 128 or 6.32404e-322f */
1180 /* 3: loadpb */
1181 var36 = ex->params[24];
1182
1183 for (i = 0; i < n; i++) {
1184 /* 0: loadb */
1185 var34 = ptr0[i];
1186 /* 2: xorb */
1187 var38 = var34 ^ var35;
1188 /* 4: mulsbw */
1189 var39.i = var38 * var36;
1190 /* 5: shrsw */
1191 var40.i = var39.i >> 3;
1192 /* 6: convssswb */
1193 var41 = ORC_CLAMP_SB (var40.i);
1194 /* 7: xorb */
1195 var37 = var41 ^ var35;
1196 /* 8: storeb */
1197 ptr0[i] = var37;
1198 }
1199
1200 }
1201
1202 void
adder_orc_volume_u8(guint8 * ORC_RESTRICT d1,int p1,int n)1203 adder_orc_volume_u8 (guint8 * ORC_RESTRICT d1, int p1, int n)
1204 {
1205 OrcExecutor _ex, *ex = &_ex;
1206 static volatile int p_inited = 0;
1207 static OrcCode *c = 0;
1208 void (*func) (OrcExecutor *);
1209
1210 if (!p_inited) {
1211 orc_once_mutex_lock ();
1212 if (!p_inited) {
1213 OrcProgram *p;
1214
1215 #if 1
1216 static const orc_uint8 bc[] = {
1217 1, 9, 19, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
1218 117, 109, 101, 95, 117, 56, 11, 1, 1, 14, 1, 128, 0, 0, 0, 14,
1219 2, 3, 0, 0, 0, 16, 1, 20, 2, 20, 1, 68, 33, 0, 16, 174,
1220 32, 33, 24, 94, 32, 32, 17, 159, 33, 32, 68, 0, 33, 16, 2, 0,
1221
1222 };
1223 p = orc_program_new_from_static_bytecode (bc);
1224 orc_program_set_backup_function (p, _backup_adder_orc_volume_u8);
1225 #else
1226 p = orc_program_new ();
1227 orc_program_set_name (p, "adder_orc_volume_u8");
1228 orc_program_set_backup_function (p, _backup_adder_orc_volume_u8);
1229 orc_program_add_destination (p, 1, "d1");
1230 orc_program_add_constant (p, 1, 0x00000080, "c1");
1231 orc_program_add_constant (p, 2, 0x00000003, "c2");
1232 orc_program_add_parameter (p, 1, "p1");
1233 orc_program_add_temporary (p, 2, "t1");
1234 orc_program_add_temporary (p, 1, "t2");
1235
1236 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_C1,
1237 ORC_VAR_D1);
1238 orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
1239 ORC_VAR_D1);
1240 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
1241 ORC_VAR_D1);
1242 orc_program_append_2 (p, "convssswb", 0, ORC_VAR_T2, ORC_VAR_T1,
1243 ORC_VAR_D1, ORC_VAR_D1);
1244 orc_program_append_2 (p, "xorb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_C1,
1245 ORC_VAR_D1);
1246 #endif
1247
1248 orc_program_compile (p);
1249 c = orc_program_take_code (p);
1250 orc_program_free (p);
1251 }
1252 p_inited = TRUE;
1253 orc_once_mutex_unlock ();
1254 }
1255 ex->arrays[ORC_VAR_A2] = c;
1256 ex->program = 0;
1257
1258 ex->n = n;
1259 ex->arrays[ORC_VAR_D1] = d1;
1260 ex->params[ORC_VAR_P1] = p1;
1261
1262 func = c->exec;
1263 func (ex);
1264 }
1265 #endif
1266
1267
1268 /* adder_orc_volume_s8 */
1269 #ifdef DISABLE_ORC
1270 void
adder_orc_volume_s8(gint8 * ORC_RESTRICT d1,int p1,int n)1271 adder_orc_volume_s8 (gint8 * ORC_RESTRICT d1, int p1, int n)
1272 {
1273 int i;
1274 orc_int8 *ORC_RESTRICT ptr0;
1275 orc_int8 var33;
1276 orc_int8 var34;
1277 orc_int8 var35;
1278 orc_union16 var36;
1279 orc_union16 var37;
1280
1281 ptr0 = (orc_int8 *) d1;
1282
1283 /* 1: loadpb */
1284 var34 = p1;
1285
1286 for (i = 0; i < n; i++) {
1287 /* 0: loadb */
1288 var33 = ptr0[i];
1289 /* 2: mulsbw */
1290 var36.i = var33 * var34;
1291 /* 3: shrsw */
1292 var37.i = var36.i >> 3;
1293 /* 4: convssswb */
1294 var35 = ORC_CLAMP_SB (var37.i);
1295 /* 5: storeb */
1296 ptr0[i] = var35;
1297 }
1298
1299 }
1300
1301 #else
1302 static void
_backup_adder_orc_volume_s8(OrcExecutor * ORC_RESTRICT ex)1303 _backup_adder_orc_volume_s8 (OrcExecutor * ORC_RESTRICT ex)
1304 {
1305 int i;
1306 int n = ex->n;
1307 orc_int8 *ORC_RESTRICT ptr0;
1308 orc_int8 var33;
1309 orc_int8 var34;
1310 orc_int8 var35;
1311 orc_union16 var36;
1312 orc_union16 var37;
1313
1314 ptr0 = (orc_int8 *) ex->arrays[0];
1315
1316 /* 1: loadpb */
1317 var34 = ex->params[24];
1318
1319 for (i = 0; i < n; i++) {
1320 /* 0: loadb */
1321 var33 = ptr0[i];
1322 /* 2: mulsbw */
1323 var36.i = var33 * var34;
1324 /* 3: shrsw */
1325 var37.i = var36.i >> 3;
1326 /* 4: convssswb */
1327 var35 = ORC_CLAMP_SB (var37.i);
1328 /* 5: storeb */
1329 ptr0[i] = var35;
1330 }
1331
1332 }
1333
1334 void
adder_orc_volume_s8(gint8 * ORC_RESTRICT d1,int p1,int n)1335 adder_orc_volume_s8 (gint8 * ORC_RESTRICT d1, int p1, int n)
1336 {
1337 OrcExecutor _ex, *ex = &_ex;
1338 static volatile int p_inited = 0;
1339 static OrcCode *c = 0;
1340 void (*func) (OrcExecutor *);
1341
1342 if (!p_inited) {
1343 orc_once_mutex_lock ();
1344 if (!p_inited) {
1345 OrcProgram *p;
1346
1347 #if 1
1348 static const orc_uint8 bc[] = {
1349 1, 9, 19, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
1350 117, 109, 101, 95, 115, 56, 11, 1, 1, 14, 2, 3, 0, 0, 0, 16,
1351 1, 20, 2, 174, 32, 0, 24, 94, 32, 32, 16, 159, 0, 32, 2, 0,
1352
1353 };
1354 p = orc_program_new_from_static_bytecode (bc);
1355 orc_program_set_backup_function (p, _backup_adder_orc_volume_s8);
1356 #else
1357 p = orc_program_new ();
1358 orc_program_set_name (p, "adder_orc_volume_s8");
1359 orc_program_set_backup_function (p, _backup_adder_orc_volume_s8);
1360 orc_program_add_destination (p, 1, "d1");
1361 orc_program_add_constant (p, 2, 0x00000003, "c1");
1362 orc_program_add_parameter (p, 1, "p1");
1363 orc_program_add_temporary (p, 2, "t1");
1364
1365 orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
1366 ORC_VAR_D1);
1367 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
1368 ORC_VAR_D1);
1369 orc_program_append_2 (p, "convssswb", 0, ORC_VAR_D1, ORC_VAR_T1,
1370 ORC_VAR_D1, ORC_VAR_D1);
1371 #endif
1372
1373 orc_program_compile (p);
1374 c = orc_program_take_code (p);
1375 orc_program_free (p);
1376 }
1377 p_inited = TRUE;
1378 orc_once_mutex_unlock ();
1379 }
1380 ex->arrays[ORC_VAR_A2] = c;
1381 ex->program = 0;
1382
1383 ex->n = n;
1384 ex->arrays[ORC_VAR_D1] = d1;
1385 ex->params[ORC_VAR_P1] = p1;
1386
1387 func = c->exec;
1388 func (ex);
1389 }
1390 #endif
1391
1392
1393 /* adder_orc_volume_u16 */
1394 #ifdef DISABLE_ORC
1395 void
adder_orc_volume_u16(guint16 * ORC_RESTRICT d1,int p1,int n)1396 adder_orc_volume_u16 (guint16 * ORC_RESTRICT d1, int p1, int n)
1397 {
1398 int i;
1399 orc_union16 *ORC_RESTRICT ptr0;
1400 orc_union16 var34;
1401 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1402 volatile orc_union16 var35;
1403 #else
1404 orc_union16 var35;
1405 #endif
1406 orc_union16 var36;
1407 orc_union16 var37;
1408 orc_union16 var38;
1409 orc_union32 var39;
1410 orc_union32 var40;
1411 orc_union16 var41;
1412
1413 ptr0 = (orc_union16 *) d1;
1414
1415 /* 1: loadpw */
1416 var35.i = 0x00008000; /* 32768 or 1.61895e-319f */
1417 /* 3: loadpw */
1418 var36.i = p1;
1419
1420 for (i = 0; i < n; i++) {
1421 /* 0: loadw */
1422 var34 = ptr0[i];
1423 /* 2: xorw */
1424 var38.i = var34.i ^ var35.i;
1425 /* 4: mulswl */
1426 var39.i = var38.i * var36.i;
1427 /* 5: shrsl */
1428 var40.i = var39.i >> 11;
1429 /* 6: convssslw */
1430 var41.i = ORC_CLAMP_SW (var40.i);
1431 /* 7: xorw */
1432 var37.i = var41.i ^ var35.i;
1433 /* 8: storew */
1434 ptr0[i] = var37;
1435 }
1436
1437 }
1438
1439 #else
1440 static void
_backup_adder_orc_volume_u16(OrcExecutor * ORC_RESTRICT ex)1441 _backup_adder_orc_volume_u16 (OrcExecutor * ORC_RESTRICT ex)
1442 {
1443 int i;
1444 int n = ex->n;
1445 orc_union16 *ORC_RESTRICT ptr0;
1446 orc_union16 var34;
1447 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1448 volatile orc_union16 var35;
1449 #else
1450 orc_union16 var35;
1451 #endif
1452 orc_union16 var36;
1453 orc_union16 var37;
1454 orc_union16 var38;
1455 orc_union32 var39;
1456 orc_union32 var40;
1457 orc_union16 var41;
1458
1459 ptr0 = (orc_union16 *) ex->arrays[0];
1460
1461 /* 1: loadpw */
1462 var35.i = 0x00008000; /* 32768 or 1.61895e-319f */
1463 /* 3: loadpw */
1464 var36.i = ex->params[24];
1465
1466 for (i = 0; i < n; i++) {
1467 /* 0: loadw */
1468 var34 = ptr0[i];
1469 /* 2: xorw */
1470 var38.i = var34.i ^ var35.i;
1471 /* 4: mulswl */
1472 var39.i = var38.i * var36.i;
1473 /* 5: shrsl */
1474 var40.i = var39.i >> 11;
1475 /* 6: convssslw */
1476 var41.i = ORC_CLAMP_SW (var40.i);
1477 /* 7: xorw */
1478 var37.i = var41.i ^ var35.i;
1479 /* 8: storew */
1480 ptr0[i] = var37;
1481 }
1482
1483 }
1484
1485 void
adder_orc_volume_u16(guint16 * ORC_RESTRICT d1,int p1,int n)1486 adder_orc_volume_u16 (guint16 * ORC_RESTRICT d1, int p1, int n)
1487 {
1488 OrcExecutor _ex, *ex = &_ex;
1489 static volatile int p_inited = 0;
1490 static OrcCode *c = 0;
1491 void (*func) (OrcExecutor *);
1492
1493 if (!p_inited) {
1494 orc_once_mutex_lock ();
1495 if (!p_inited) {
1496 OrcProgram *p;
1497
1498 #if 1
1499 static const orc_uint8 bc[] = {
1500 1, 9, 20, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
1501 117, 109, 101, 95, 117, 49, 54, 11, 2, 2, 14, 2, 0, 128, 0, 0,
1502 14, 4, 11, 0, 0, 0, 16, 2, 20, 4, 20, 2, 101, 33, 0, 16,
1503 176, 32, 33, 24, 125, 32, 32, 17, 165, 33, 32, 101, 0, 33, 16, 2,
1504 0,
1505 };
1506 p = orc_program_new_from_static_bytecode (bc);
1507 orc_program_set_backup_function (p, _backup_adder_orc_volume_u16);
1508 #else
1509 p = orc_program_new ();
1510 orc_program_set_name (p, "adder_orc_volume_u16");
1511 orc_program_set_backup_function (p, _backup_adder_orc_volume_u16);
1512 orc_program_add_destination (p, 2, "d1");
1513 orc_program_add_constant (p, 2, 0x00008000, "c1");
1514 orc_program_add_constant (p, 4, 0x0000000b, "c2");
1515 orc_program_add_parameter (p, 2, "p1");
1516 orc_program_add_temporary (p, 4, "t1");
1517 orc_program_add_temporary (p, 2, "t2");
1518
1519 orc_program_append_2 (p, "xorw", 0, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_C1,
1520 ORC_VAR_D1);
1521 orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
1522 ORC_VAR_D1);
1523 orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
1524 ORC_VAR_D1);
1525 orc_program_append_2 (p, "convssslw", 0, ORC_VAR_T2, ORC_VAR_T1,
1526 ORC_VAR_D1, ORC_VAR_D1);
1527 orc_program_append_2 (p, "xorw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_C1,
1528 ORC_VAR_D1);
1529 #endif
1530
1531 orc_program_compile (p);
1532 c = orc_program_take_code (p);
1533 orc_program_free (p);
1534 }
1535 p_inited = TRUE;
1536 orc_once_mutex_unlock ();
1537 }
1538 ex->arrays[ORC_VAR_A2] = c;
1539 ex->program = 0;
1540
1541 ex->n = n;
1542 ex->arrays[ORC_VAR_D1] = d1;
1543 ex->params[ORC_VAR_P1] = p1;
1544
1545 func = c->exec;
1546 func (ex);
1547 }
1548 #endif
1549
1550
1551 /* adder_orc_volume_s16 */
1552 #ifdef DISABLE_ORC
1553 void
adder_orc_volume_s16(gint16 * ORC_RESTRICT d1,int p1,int n)1554 adder_orc_volume_s16 (gint16 * ORC_RESTRICT d1, int p1, int n)
1555 {
1556 int i;
1557 orc_union16 *ORC_RESTRICT ptr0;
1558 orc_union16 var33;
1559 orc_union16 var34;
1560 orc_union16 var35;
1561 orc_union32 var36;
1562 orc_union32 var37;
1563
1564 ptr0 = (orc_union16 *) d1;
1565
1566 /* 1: loadpw */
1567 var34.i = p1;
1568
1569 for (i = 0; i < n; i++) {
1570 /* 0: loadw */
1571 var33 = ptr0[i];
1572 /* 2: mulswl */
1573 var36.i = var33.i * var34.i;
1574 /* 3: shrsl */
1575 var37.i = var36.i >> 11;
1576 /* 4: convssslw */
1577 var35.i = ORC_CLAMP_SW (var37.i);
1578 /* 5: storew */
1579 ptr0[i] = var35;
1580 }
1581
1582 }
1583
1584 #else
1585 static void
_backup_adder_orc_volume_s16(OrcExecutor * ORC_RESTRICT ex)1586 _backup_adder_orc_volume_s16 (OrcExecutor * ORC_RESTRICT ex)
1587 {
1588 int i;
1589 int n = ex->n;
1590 orc_union16 *ORC_RESTRICT ptr0;
1591 orc_union16 var33;
1592 orc_union16 var34;
1593 orc_union16 var35;
1594 orc_union32 var36;
1595 orc_union32 var37;
1596
1597 ptr0 = (orc_union16 *) ex->arrays[0];
1598
1599 /* 1: loadpw */
1600 var34.i = ex->params[24];
1601
1602 for (i = 0; i < n; i++) {
1603 /* 0: loadw */
1604 var33 = ptr0[i];
1605 /* 2: mulswl */
1606 var36.i = var33.i * var34.i;
1607 /* 3: shrsl */
1608 var37.i = var36.i >> 11;
1609 /* 4: convssslw */
1610 var35.i = ORC_CLAMP_SW (var37.i);
1611 /* 5: storew */
1612 ptr0[i] = var35;
1613 }
1614
1615 }
1616
1617 void
adder_orc_volume_s16(gint16 * ORC_RESTRICT d1,int p1,int n)1618 adder_orc_volume_s16 (gint16 * ORC_RESTRICT d1, int p1, int n)
1619 {
1620 OrcExecutor _ex, *ex = &_ex;
1621 static volatile int p_inited = 0;
1622 static OrcCode *c = 0;
1623 void (*func) (OrcExecutor *);
1624
1625 if (!p_inited) {
1626 orc_once_mutex_lock ();
1627 if (!p_inited) {
1628 OrcProgram *p;
1629
1630 #if 1
1631 static const orc_uint8 bc[] = {
1632 1, 9, 20, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
1633 117, 109, 101, 95, 115, 49, 54, 11, 2, 2, 14, 4, 11, 0, 0, 0,
1634 16, 2, 20, 4, 176, 32, 0, 24, 125, 32, 32, 16, 165, 0, 32, 2,
1635 0,
1636 };
1637 p = orc_program_new_from_static_bytecode (bc);
1638 orc_program_set_backup_function (p, _backup_adder_orc_volume_s16);
1639 #else
1640 p = orc_program_new ();
1641 orc_program_set_name (p, "adder_orc_volume_s16");
1642 orc_program_set_backup_function (p, _backup_adder_orc_volume_s16);
1643 orc_program_add_destination (p, 2, "d1");
1644 orc_program_add_constant (p, 4, 0x0000000b, "c1");
1645 orc_program_add_parameter (p, 2, "p1");
1646 orc_program_add_temporary (p, 4, "t1");
1647
1648 orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
1649 ORC_VAR_D1);
1650 orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
1651 ORC_VAR_D1);
1652 orc_program_append_2 (p, "convssslw", 0, ORC_VAR_D1, ORC_VAR_T1,
1653 ORC_VAR_D1, ORC_VAR_D1);
1654 #endif
1655
1656 orc_program_compile (p);
1657 c = orc_program_take_code (p);
1658 orc_program_free (p);
1659 }
1660 p_inited = TRUE;
1661 orc_once_mutex_unlock ();
1662 }
1663 ex->arrays[ORC_VAR_A2] = c;
1664 ex->program = 0;
1665
1666 ex->n = n;
1667 ex->arrays[ORC_VAR_D1] = d1;
1668 ex->params[ORC_VAR_P1] = p1;
1669
1670 func = c->exec;
1671 func (ex);
1672 }
1673 #endif
1674
1675
1676 /* adder_orc_volume_u32 */
1677 #ifdef DISABLE_ORC
1678 void
adder_orc_volume_u32(guint32 * ORC_RESTRICT d1,int p1,int n)1679 adder_orc_volume_u32 (guint32 * ORC_RESTRICT d1, int p1, int n)
1680 {
1681 int i;
1682 orc_union32 *ORC_RESTRICT ptr0;
1683 orc_union32 var34;
1684 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1685 volatile orc_union32 var35;
1686 #else
1687 orc_union32 var35;
1688 #endif
1689 orc_union32 var36;
1690 orc_union32 var37;
1691 orc_union32 var38;
1692 orc_union64 var39;
1693 orc_union64 var40;
1694 orc_union32 var41;
1695
1696 ptr0 = (orc_union32 *) d1;
1697
1698 /* 1: loadpl */
1699 var35.i = 0x80000000; /* -2147483648 or 1.061e-314f */
1700 /* 3: loadpl */
1701 var36.i = p1;
1702
1703 for (i = 0; i < n; i++) {
1704 /* 0: loadl */
1705 var34 = ptr0[i];
1706 /* 2: xorl */
1707 var38.i = var34.i ^ var35.i;
1708 /* 4: mulslq */
1709 var39.i = ((orc_int64) var38.i) * ((orc_int64) var36.i);
1710 /* 5: shrsq */
1711 var40.i = var39.i >> 27;
1712 /* 6: convsssql */
1713 var41.i = ORC_CLAMP_SL (var40.i);
1714 /* 7: xorl */
1715 var37.i = var41.i ^ var35.i;
1716 /* 8: storel */
1717 ptr0[i] = var37;
1718 }
1719
1720 }
1721
1722 #else
1723 static void
_backup_adder_orc_volume_u32(OrcExecutor * ORC_RESTRICT ex)1724 _backup_adder_orc_volume_u32 (OrcExecutor * ORC_RESTRICT ex)
1725 {
1726 int i;
1727 int n = ex->n;
1728 orc_union32 *ORC_RESTRICT ptr0;
1729 orc_union32 var34;
1730 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1731 volatile orc_union32 var35;
1732 #else
1733 orc_union32 var35;
1734 #endif
1735 orc_union32 var36;
1736 orc_union32 var37;
1737 orc_union32 var38;
1738 orc_union64 var39;
1739 orc_union64 var40;
1740 orc_union32 var41;
1741
1742 ptr0 = (orc_union32 *) ex->arrays[0];
1743
1744 /* 1: loadpl */
1745 var35.i = 0x80000000; /* -2147483648 or 1.061e-314f */
1746 /* 3: loadpl */
1747 var36.i = ex->params[24];
1748
1749 for (i = 0; i < n; i++) {
1750 /* 0: loadl */
1751 var34 = ptr0[i];
1752 /* 2: xorl */
1753 var38.i = var34.i ^ var35.i;
1754 /* 4: mulslq */
1755 var39.i = ((orc_int64) var38.i) * ((orc_int64) var36.i);
1756 /* 5: shrsq */
1757 var40.i = var39.i >> 27;
1758 /* 6: convsssql */
1759 var41.i = ORC_CLAMP_SL (var40.i);
1760 /* 7: xorl */
1761 var37.i = var41.i ^ var35.i;
1762 /* 8: storel */
1763 ptr0[i] = var37;
1764 }
1765
1766 }
1767
1768 void
adder_orc_volume_u32(guint32 * ORC_RESTRICT d1,int p1,int n)1769 adder_orc_volume_u32 (guint32 * ORC_RESTRICT d1, int p1, int n)
1770 {
1771 OrcExecutor _ex, *ex = &_ex;
1772 static volatile int p_inited = 0;
1773 static OrcCode *c = 0;
1774 void (*func) (OrcExecutor *);
1775
1776 if (!p_inited) {
1777 orc_once_mutex_lock ();
1778 if (!p_inited) {
1779 OrcProgram *p;
1780
1781 #if 1
1782 static const orc_uint8 bc[] = {
1783 1, 9, 20, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
1784 117, 109, 101, 95, 117, 51, 50, 11, 4, 4, 14, 4, 0, 0, 0, 128,
1785 15, 8, 27, 0, 0, 0, 0, 0, 0, 0, 16, 4, 20, 8, 20, 4,
1786 132, 33, 0, 16, 178, 32, 33, 24, 147, 32, 32, 17, 170, 33, 32, 132,
1787 0, 33, 16, 2, 0,
1788 };
1789 p = orc_program_new_from_static_bytecode (bc);
1790 orc_program_set_backup_function (p, _backup_adder_orc_volume_u32);
1791 #else
1792 p = orc_program_new ();
1793 orc_program_set_name (p, "adder_orc_volume_u32");
1794 orc_program_set_backup_function (p, _backup_adder_orc_volume_u32);
1795 orc_program_add_destination (p, 4, "d1");
1796 orc_program_add_constant (p, 4, 0x80000000, "c1");
1797 orc_program_add_constant_int64 (p, 8, 0x000000000000001bULL, "c2");
1798 orc_program_add_parameter (p, 4, "p1");
1799 orc_program_add_temporary (p, 8, "t1");
1800 orc_program_add_temporary (p, 4, "t2");
1801
1802 orc_program_append_2 (p, "xorl", 0, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_C1,
1803 ORC_VAR_D1);
1804 orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
1805 ORC_VAR_D1);
1806 orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
1807 ORC_VAR_D1);
1808 orc_program_append_2 (p, "convsssql", 0, ORC_VAR_T2, ORC_VAR_T1,
1809 ORC_VAR_D1, ORC_VAR_D1);
1810 orc_program_append_2 (p, "xorl", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_C1,
1811 ORC_VAR_D1);
1812 #endif
1813
1814 orc_program_compile (p);
1815 c = orc_program_take_code (p);
1816 orc_program_free (p);
1817 }
1818 p_inited = TRUE;
1819 orc_once_mutex_unlock ();
1820 }
1821 ex->arrays[ORC_VAR_A2] = c;
1822 ex->program = 0;
1823
1824 ex->n = n;
1825 ex->arrays[ORC_VAR_D1] = d1;
1826 ex->params[ORC_VAR_P1] = p1;
1827
1828 func = c->exec;
1829 func (ex);
1830 }
1831 #endif
1832
1833
1834 /* adder_orc_volume_s32 */
1835 #ifdef DISABLE_ORC
1836 void
adder_orc_volume_s32(gint32 * ORC_RESTRICT d1,int p1,int n)1837 adder_orc_volume_s32 (gint32 * ORC_RESTRICT d1, int p1, int n)
1838 {
1839 int i;
1840 orc_union32 *ORC_RESTRICT ptr0;
1841 orc_union32 var33;
1842 orc_union32 var34;
1843 orc_union32 var35;
1844 orc_union64 var36;
1845 orc_union64 var37;
1846
1847 ptr0 = (orc_union32 *) d1;
1848
1849 /* 1: loadpl */
1850 var34.i = p1;
1851
1852 for (i = 0; i < n; i++) {
1853 /* 0: loadl */
1854 var33 = ptr0[i];
1855 /* 2: mulslq */
1856 var36.i = ((orc_int64) var33.i) * ((orc_int64) var34.i);
1857 /* 3: shrsq */
1858 var37.i = var36.i >> 27;
1859 /* 4: convsssql */
1860 var35.i = ORC_CLAMP_SL (var37.i);
1861 /* 5: storel */
1862 ptr0[i] = var35;
1863 }
1864
1865 }
1866
1867 #else
1868 static void
_backup_adder_orc_volume_s32(OrcExecutor * ORC_RESTRICT ex)1869 _backup_adder_orc_volume_s32 (OrcExecutor * ORC_RESTRICT ex)
1870 {
1871 int i;
1872 int n = ex->n;
1873 orc_union32 *ORC_RESTRICT ptr0;
1874 orc_union32 var33;
1875 orc_union32 var34;
1876 orc_union32 var35;
1877 orc_union64 var36;
1878 orc_union64 var37;
1879
1880 ptr0 = (orc_union32 *) ex->arrays[0];
1881
1882 /* 1: loadpl */
1883 var34.i = ex->params[24];
1884
1885 for (i = 0; i < n; i++) {
1886 /* 0: loadl */
1887 var33 = ptr0[i];
1888 /* 2: mulslq */
1889 var36.i = ((orc_int64) var33.i) * ((orc_int64) var34.i);
1890 /* 3: shrsq */
1891 var37.i = var36.i >> 27;
1892 /* 4: convsssql */
1893 var35.i = ORC_CLAMP_SL (var37.i);
1894 /* 5: storel */
1895 ptr0[i] = var35;
1896 }
1897
1898 }
1899
1900 void
adder_orc_volume_s32(gint32 * ORC_RESTRICT d1,int p1,int n)1901 adder_orc_volume_s32 (gint32 * ORC_RESTRICT d1, int p1, int n)
1902 {
1903 OrcExecutor _ex, *ex = &_ex;
1904 static volatile int p_inited = 0;
1905 static OrcCode *c = 0;
1906 void (*func) (OrcExecutor *);
1907
1908 if (!p_inited) {
1909 orc_once_mutex_lock ();
1910 if (!p_inited) {
1911 OrcProgram *p;
1912
1913 #if 1
1914 static const orc_uint8 bc[] = {
1915 1, 9, 20, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
1916 117, 109, 101, 95, 115, 51, 50, 11, 4, 4, 15, 8, 27, 0, 0, 0,
1917 0, 0, 0, 0, 16, 4, 20, 8, 178, 32, 0, 24, 147, 32, 32, 16,
1918 170, 0, 32, 2, 0,
1919 };
1920 p = orc_program_new_from_static_bytecode (bc);
1921 orc_program_set_backup_function (p, _backup_adder_orc_volume_s32);
1922 #else
1923 p = orc_program_new ();
1924 orc_program_set_name (p, "adder_orc_volume_s32");
1925 orc_program_set_backup_function (p, _backup_adder_orc_volume_s32);
1926 orc_program_add_destination (p, 4, "d1");
1927 orc_program_add_constant_int64 (p, 8, 0x000000000000001bULL, "c1");
1928 orc_program_add_parameter (p, 4, "p1");
1929 orc_program_add_temporary (p, 8, "t1");
1930
1931 orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1,
1932 ORC_VAR_D1);
1933 orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
1934 ORC_VAR_D1);
1935 orc_program_append_2 (p, "convsssql", 0, ORC_VAR_D1, ORC_VAR_T1,
1936 ORC_VAR_D1, ORC_VAR_D1);
1937 #endif
1938
1939 orc_program_compile (p);
1940 c = orc_program_take_code (p);
1941 orc_program_free (p);
1942 }
1943 p_inited = TRUE;
1944 orc_once_mutex_unlock ();
1945 }
1946 ex->arrays[ORC_VAR_A2] = c;
1947 ex->program = 0;
1948
1949 ex->n = n;
1950 ex->arrays[ORC_VAR_D1] = d1;
1951 ex->params[ORC_VAR_P1] = p1;
1952
1953 func = c->exec;
1954 func (ex);
1955 }
1956 #endif
1957
1958
1959 /* adder_orc_volume_f32 */
1960 #ifdef DISABLE_ORC
1961 void
adder_orc_volume_f32(float * ORC_RESTRICT d1,float p1,int n)1962 adder_orc_volume_f32 (float *ORC_RESTRICT d1, float p1, int n)
1963 {
1964 int i;
1965 orc_union32 *ORC_RESTRICT ptr0;
1966 orc_union32 var32;
1967 orc_union32 var33;
1968 orc_union32 var34;
1969
1970 ptr0 = (orc_union32 *) d1;
1971
1972 /* 1: loadpl */
1973 var33.f = p1;
1974
1975 for (i = 0; i < n; i++) {
1976 /* 0: loadl */
1977 var32 = ptr0[i];
1978 /* 2: mulf */
1979 {
1980 orc_union32 _src1;
1981 orc_union32 _src2;
1982 orc_union32 _dest1;
1983 _src1.i = ORC_DENORMAL (var32.i);
1984 _src2.i = ORC_DENORMAL (var33.i);
1985 _dest1.f = _src1.f * _src2.f;
1986 var34.i = ORC_DENORMAL (_dest1.i);
1987 }
1988 /* 3: storel */
1989 ptr0[i] = var34;
1990 }
1991
1992 }
1993
1994 #else
1995 static void
_backup_adder_orc_volume_f32(OrcExecutor * ORC_RESTRICT ex)1996 _backup_adder_orc_volume_f32 (OrcExecutor * ORC_RESTRICT ex)
1997 {
1998 int i;
1999 int n = ex->n;
2000 orc_union32 *ORC_RESTRICT ptr0;
2001 orc_union32 var32;
2002 orc_union32 var33;
2003 orc_union32 var34;
2004
2005 ptr0 = (orc_union32 *) ex->arrays[0];
2006
2007 /* 1: loadpl */
2008 var33.i = ex->params[24];
2009
2010 for (i = 0; i < n; i++) {
2011 /* 0: loadl */
2012 var32 = ptr0[i];
2013 /* 2: mulf */
2014 {
2015 orc_union32 _src1;
2016 orc_union32 _src2;
2017 orc_union32 _dest1;
2018 _src1.i = ORC_DENORMAL (var32.i);
2019 _src2.i = ORC_DENORMAL (var33.i);
2020 _dest1.f = _src1.f * _src2.f;
2021 var34.i = ORC_DENORMAL (_dest1.i);
2022 }
2023 /* 3: storel */
2024 ptr0[i] = var34;
2025 }
2026
2027 }
2028
2029 void
adder_orc_volume_f32(float * ORC_RESTRICT d1,float p1,int n)2030 adder_orc_volume_f32 (float *ORC_RESTRICT d1, float p1, int n)
2031 {
2032 OrcExecutor _ex, *ex = &_ex;
2033 static volatile int p_inited = 0;
2034 static OrcCode *c = 0;
2035 void (*func) (OrcExecutor *);
2036
2037 if (!p_inited) {
2038 orc_once_mutex_lock ();
2039 if (!p_inited) {
2040 OrcProgram *p;
2041
2042 #if 1
2043 static const orc_uint8 bc[] = {
2044 1, 9, 20, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
2045 117, 109, 101, 95, 102, 51, 50, 11, 4, 4, 17, 4, 202, 0, 0, 24,
2046 2, 0,
2047 };
2048 p = orc_program_new_from_static_bytecode (bc);
2049 orc_program_set_backup_function (p, _backup_adder_orc_volume_f32);
2050 #else
2051 p = orc_program_new ();
2052 orc_program_set_name (p, "adder_orc_volume_f32");
2053 orc_program_set_backup_function (p, _backup_adder_orc_volume_f32);
2054 orc_program_add_destination (p, 4, "d1");
2055 orc_program_add_parameter_float (p, 4, "p1");
2056
2057 orc_program_append_2 (p, "mulf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1,
2058 ORC_VAR_D1);
2059 #endif
2060
2061 orc_program_compile (p);
2062 c = orc_program_take_code (p);
2063 orc_program_free (p);
2064 }
2065 p_inited = TRUE;
2066 orc_once_mutex_unlock ();
2067 }
2068 ex->arrays[ORC_VAR_A2] = c;
2069 ex->program = 0;
2070
2071 ex->n = n;
2072 ex->arrays[ORC_VAR_D1] = d1;
2073 {
2074 orc_union32 tmp;
2075 tmp.f = p1;
2076 ex->params[ORC_VAR_P1] = tmp.i;
2077 }
2078
2079 func = c->exec;
2080 func (ex);
2081 }
2082 #endif
2083
2084
2085 /* adder_orc_volume_f64 */
2086 #ifdef DISABLE_ORC
2087 void
adder_orc_volume_f64(double * ORC_RESTRICT d1,double p1,int n)2088 adder_orc_volume_f64 (double *ORC_RESTRICT d1, double p1, int n)
2089 {
2090 int i;
2091 orc_union64 *ORC_RESTRICT ptr0;
2092 orc_union64 var32;
2093 orc_union64 var33;
2094 orc_union64 var34;
2095
2096 ptr0 = (orc_union64 *) d1;
2097
2098 /* 1: loadpq */
2099 var33.f = p1;
2100
2101 for (i = 0; i < n; i++) {
2102 /* 0: loadq */
2103 var32 = ptr0[i];
2104 /* 2: muld */
2105 {
2106 orc_union64 _src1;
2107 orc_union64 _src2;
2108 orc_union64 _dest1;
2109 _src1.i = ORC_DENORMAL_DOUBLE (var32.i);
2110 _src2.i = ORC_DENORMAL_DOUBLE (var33.i);
2111 _dest1.f = _src1.f * _src2.f;
2112 var34.i = ORC_DENORMAL_DOUBLE (_dest1.i);
2113 }
2114 /* 3: storeq */
2115 ptr0[i] = var34;
2116 }
2117
2118 }
2119
2120 #else
2121 static void
_backup_adder_orc_volume_f64(OrcExecutor * ORC_RESTRICT ex)2122 _backup_adder_orc_volume_f64 (OrcExecutor * ORC_RESTRICT ex)
2123 {
2124 int i;
2125 int n = ex->n;
2126 orc_union64 *ORC_RESTRICT ptr0;
2127 orc_union64 var32;
2128 orc_union64 var33;
2129 orc_union64 var34;
2130
2131 ptr0 = (orc_union64 *) ex->arrays[0];
2132
2133 /* 1: loadpq */
2134 var33.i =
2135 (ex->params[24] & 0xffffffff) | ((orc_uint64) (ex->params[24 +
2136 (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);
2137
2138 for (i = 0; i < n; i++) {
2139 /* 0: loadq */
2140 var32 = ptr0[i];
2141 /* 2: muld */
2142 {
2143 orc_union64 _src1;
2144 orc_union64 _src2;
2145 orc_union64 _dest1;
2146 _src1.i = ORC_DENORMAL_DOUBLE (var32.i);
2147 _src2.i = ORC_DENORMAL_DOUBLE (var33.i);
2148 _dest1.f = _src1.f * _src2.f;
2149 var34.i = ORC_DENORMAL_DOUBLE (_dest1.i);
2150 }
2151 /* 3: storeq */
2152 ptr0[i] = var34;
2153 }
2154
2155 }
2156
2157 void
adder_orc_volume_f64(double * ORC_RESTRICT d1,double p1,int n)2158 adder_orc_volume_f64 (double *ORC_RESTRICT d1, double p1, int n)
2159 {
2160 OrcExecutor _ex, *ex = &_ex;
2161 static volatile int p_inited = 0;
2162 static OrcCode *c = 0;
2163 void (*func) (OrcExecutor *);
2164
2165 if (!p_inited) {
2166 orc_once_mutex_lock ();
2167 if (!p_inited) {
2168 OrcProgram *p;
2169
2170 #if 1
2171 static const orc_uint8 bc[] = {
2172 1, 9, 20, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 118, 111, 108,
2173 117, 109, 101, 95, 102, 54, 52, 11, 8, 8, 18, 8, 214, 0, 0, 24,
2174 2, 0,
2175 };
2176 p = orc_program_new_from_static_bytecode (bc);
2177 orc_program_set_backup_function (p, _backup_adder_orc_volume_f64);
2178 #else
2179 p = orc_program_new ();
2180 orc_program_set_name (p, "adder_orc_volume_f64");
2181 orc_program_set_backup_function (p, _backup_adder_orc_volume_f64);
2182 orc_program_add_destination (p, 8, "d1");
2183 orc_program_add_parameter_double (p, 8, "p1");
2184
2185 orc_program_append_2 (p, "muld", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1,
2186 ORC_VAR_D1);
2187 #endif
2188
2189 orc_program_compile (p);
2190 c = orc_program_take_code (p);
2191 orc_program_free (p);
2192 }
2193 p_inited = TRUE;
2194 orc_once_mutex_unlock ();
2195 }
2196 ex->arrays[ORC_VAR_A2] = c;
2197 ex->program = 0;
2198
2199 ex->n = n;
2200 ex->arrays[ORC_VAR_D1] = d1;
2201 {
2202 orc_union64 tmp;
2203 tmp.f = p1;
2204 ex->params[ORC_VAR_P1] = ((orc_uint64) tmp.i) & 0xffffffff;
2205 ex->params[ORC_VAR_T1] = ((orc_uint64) tmp.i) >> 32;
2206 }
2207
2208 func = c->exec;
2209 func (ex);
2210 }
2211 #endif
2212
2213
2214 /* adder_orc_add_volume_u8 */
2215 #ifdef DISABLE_ORC
2216 void
adder_orc_add_volume_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int p1,int n)2217 adder_orc_add_volume_u8 (guint8 * ORC_RESTRICT d1,
2218 const guint8 * ORC_RESTRICT s1, int p1, int n)
2219 {
2220 int i;
2221 orc_int8 *ORC_RESTRICT ptr0;
2222 const orc_int8 *ORC_RESTRICT ptr4;
2223 orc_int8 var34;
2224 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
2225 volatile orc_int8 var35;
2226 #else
2227 orc_int8 var35;
2228 #endif
2229 orc_int8 var36;
2230 orc_int8 var37;
2231 orc_int8 var38;
2232 orc_int8 var39;
2233 orc_union16 var40;
2234 orc_union16 var41;
2235 orc_int8 var42;
2236 orc_int8 var43;
2237
2238 ptr0 = (orc_int8 *) d1;
2239 ptr4 = (orc_int8 *) s1;
2240
2241 /* 1: loadpb */
2242 var35 = 0x00000080; /* 128 or 6.32404e-322f */
2243 /* 3: loadpb */
2244 var36 = p1;
2245
2246 for (i = 0; i < n; i++) {
2247 /* 0: loadb */
2248 var34 = ptr4[i];
2249 /* 2: xorb */
2250 var39 = var34 ^ var35;
2251 /* 4: mulsbw */
2252 var40.i = var39 * var36;
2253 /* 5: shrsw */
2254 var41.i = var40.i >> 3;
2255 /* 6: convssswb */
2256 var42 = ORC_CLAMP_SB (var41.i);
2257 /* 7: xorb */
2258 var43 = var42 ^ var35;
2259 /* 8: loadb */
2260 var37 = ptr0[i];
2261 /* 9: addusb */
2262 var38 = ORC_CLAMP_UB ((orc_uint8) var37 + (orc_uint8) var43);
2263 /* 10: storeb */
2264 ptr0[i] = var38;
2265 }
2266
2267 }
2268
2269 #else
2270 static void
_backup_adder_orc_add_volume_u8(OrcExecutor * ORC_RESTRICT ex)2271 _backup_adder_orc_add_volume_u8 (OrcExecutor * ORC_RESTRICT ex)
2272 {
2273 int i;
2274 int n = ex->n;
2275 orc_int8 *ORC_RESTRICT ptr0;
2276 const orc_int8 *ORC_RESTRICT ptr4;
2277 orc_int8 var34;
2278 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
2279 volatile orc_int8 var35;
2280 #else
2281 orc_int8 var35;
2282 #endif
2283 orc_int8 var36;
2284 orc_int8 var37;
2285 orc_int8 var38;
2286 orc_int8 var39;
2287 orc_union16 var40;
2288 orc_union16 var41;
2289 orc_int8 var42;
2290 orc_int8 var43;
2291
2292 ptr0 = (orc_int8 *) ex->arrays[0];
2293 ptr4 = (orc_int8 *) ex->arrays[4];
2294
2295 /* 1: loadpb */
2296 var35 = 0x00000080; /* 128 or 6.32404e-322f */
2297 /* 3: loadpb */
2298 var36 = ex->params[24];
2299
2300 for (i = 0; i < n; i++) {
2301 /* 0: loadb */
2302 var34 = ptr4[i];
2303 /* 2: xorb */
2304 var39 = var34 ^ var35;
2305 /* 4: mulsbw */
2306 var40.i = var39 * var36;
2307 /* 5: shrsw */
2308 var41.i = var40.i >> 3;
2309 /* 6: convssswb */
2310 var42 = ORC_CLAMP_SB (var41.i);
2311 /* 7: xorb */
2312 var43 = var42 ^ var35;
2313 /* 8: loadb */
2314 var37 = ptr0[i];
2315 /* 9: addusb */
2316 var38 = ORC_CLAMP_UB ((orc_uint8) var37 + (orc_uint8) var43);
2317 /* 10: storeb */
2318 ptr0[i] = var38;
2319 }
2320
2321 }
2322
2323 void
adder_orc_add_volume_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int p1,int n)2324 adder_orc_add_volume_u8 (guint8 * ORC_RESTRICT d1,
2325 const guint8 * ORC_RESTRICT s1, int p1, int n)
2326 {
2327 OrcExecutor _ex, *ex = &_ex;
2328 static volatile int p_inited = 0;
2329 static OrcCode *c = 0;
2330 void (*func) (OrcExecutor *);
2331
2332 if (!p_inited) {
2333 orc_once_mutex_lock ();
2334 if (!p_inited) {
2335 OrcProgram *p;
2336
2337 #if 1
2338 static const orc_uint8 bc[] = {
2339 1, 9, 23, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
2340 95, 118, 111, 108, 117, 109, 101, 95, 117, 56, 11, 1, 1, 12, 1, 1,
2341 14, 1, 128, 0, 0, 0, 14, 2, 3, 0, 0, 0, 16, 1, 20, 2,
2342 20, 1, 68, 33, 4, 16, 174, 32, 33, 24, 94, 32, 32, 17, 159, 33,
2343 32, 68, 33, 33, 16, 35, 0, 0, 33, 2, 0,
2344 };
2345 p = orc_program_new_from_static_bytecode (bc);
2346 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_u8);
2347 #else
2348 p = orc_program_new ();
2349 orc_program_set_name (p, "adder_orc_add_volume_u8");
2350 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_u8);
2351 orc_program_add_destination (p, 1, "d1");
2352 orc_program_add_source (p, 1, "s1");
2353 orc_program_add_constant (p, 1, 0x00000080, "c1");
2354 orc_program_add_constant (p, 2, 0x00000003, "c2");
2355 orc_program_add_parameter (p, 1, "p1");
2356 orc_program_add_temporary (p, 2, "t1");
2357 orc_program_add_temporary (p, 1, "t2");
2358
2359 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C1,
2360 ORC_VAR_D1);
2361 orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
2362 ORC_VAR_D1);
2363 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
2364 ORC_VAR_D1);
2365 orc_program_append_2 (p, "convssswb", 0, ORC_VAR_T2, ORC_VAR_T1,
2366 ORC_VAR_D1, ORC_VAR_D1);
2367 orc_program_append_2 (p, "xorb", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
2368 ORC_VAR_D1);
2369 orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
2370 ORC_VAR_D1);
2371 #endif
2372
2373 orc_program_compile (p);
2374 c = orc_program_take_code (p);
2375 orc_program_free (p);
2376 }
2377 p_inited = TRUE;
2378 orc_once_mutex_unlock ();
2379 }
2380 ex->arrays[ORC_VAR_A2] = c;
2381 ex->program = 0;
2382
2383 ex->n = n;
2384 ex->arrays[ORC_VAR_D1] = d1;
2385 ex->arrays[ORC_VAR_S1] = (void *) s1;
2386 ex->params[ORC_VAR_P1] = p1;
2387
2388 func = c->exec;
2389 func (ex);
2390 }
2391 #endif
2392
2393
2394 /* adder_orc_add_volume_s8 */
2395 #ifdef DISABLE_ORC
2396 void
adder_orc_add_volume_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int p1,int n)2397 adder_orc_add_volume_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1,
2398 int p1, int n)
2399 {
2400 int i;
2401 orc_int8 *ORC_RESTRICT ptr0;
2402 const orc_int8 *ORC_RESTRICT ptr4;
2403 orc_int8 var34;
2404 orc_int8 var35;
2405 orc_int8 var36;
2406 orc_int8 var37;
2407 orc_union16 var38;
2408 orc_union16 var39;
2409 orc_int8 var40;
2410
2411 ptr0 = (orc_int8 *) d1;
2412 ptr4 = (orc_int8 *) s1;
2413
2414 /* 1: loadpb */
2415 var35 = p1;
2416
2417 for (i = 0; i < n; i++) {
2418 /* 0: loadb */
2419 var34 = ptr4[i];
2420 /* 2: mulsbw */
2421 var38.i = var34 * var35;
2422 /* 3: shrsw */
2423 var39.i = var38.i >> 3;
2424 /* 4: convssswb */
2425 var40 = ORC_CLAMP_SB (var39.i);
2426 /* 5: loadb */
2427 var36 = ptr0[i];
2428 /* 6: addssb */
2429 var37 = ORC_CLAMP_SB (var36 + var40);
2430 /* 7: storeb */
2431 ptr0[i] = var37;
2432 }
2433
2434 }
2435
2436 #else
2437 static void
_backup_adder_orc_add_volume_s8(OrcExecutor * ORC_RESTRICT ex)2438 _backup_adder_orc_add_volume_s8 (OrcExecutor * ORC_RESTRICT ex)
2439 {
2440 int i;
2441 int n = ex->n;
2442 orc_int8 *ORC_RESTRICT ptr0;
2443 const orc_int8 *ORC_RESTRICT ptr4;
2444 orc_int8 var34;
2445 orc_int8 var35;
2446 orc_int8 var36;
2447 orc_int8 var37;
2448 orc_union16 var38;
2449 orc_union16 var39;
2450 orc_int8 var40;
2451
2452 ptr0 = (orc_int8 *) ex->arrays[0];
2453 ptr4 = (orc_int8 *) ex->arrays[4];
2454
2455 /* 1: loadpb */
2456 var35 = ex->params[24];
2457
2458 for (i = 0; i < n; i++) {
2459 /* 0: loadb */
2460 var34 = ptr4[i];
2461 /* 2: mulsbw */
2462 var38.i = var34 * var35;
2463 /* 3: shrsw */
2464 var39.i = var38.i >> 3;
2465 /* 4: convssswb */
2466 var40 = ORC_CLAMP_SB (var39.i);
2467 /* 5: loadb */
2468 var36 = ptr0[i];
2469 /* 6: addssb */
2470 var37 = ORC_CLAMP_SB (var36 + var40);
2471 /* 7: storeb */
2472 ptr0[i] = var37;
2473 }
2474
2475 }
2476
2477 void
adder_orc_add_volume_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int p1,int n)2478 adder_orc_add_volume_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1,
2479 int p1, int n)
2480 {
2481 OrcExecutor _ex, *ex = &_ex;
2482 static volatile int p_inited = 0;
2483 static OrcCode *c = 0;
2484 void (*func) (OrcExecutor *);
2485
2486 if (!p_inited) {
2487 orc_once_mutex_lock ();
2488 if (!p_inited) {
2489 OrcProgram *p;
2490
2491 #if 1
2492 static const orc_uint8 bc[] = {
2493 1, 9, 23, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
2494 95, 118, 111, 108, 117, 109, 101, 95, 115, 56, 11, 1, 1, 12, 1, 1,
2495 14, 2, 3, 0, 0, 0, 16, 1, 20, 2, 20, 1, 174, 32, 4, 24,
2496 94, 32, 32, 16, 159, 33, 32, 34, 0, 0, 33, 2, 0,
2497 };
2498 p = orc_program_new_from_static_bytecode (bc);
2499 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_s8);
2500 #else
2501 p = orc_program_new ();
2502 orc_program_set_name (p, "adder_orc_add_volume_s8");
2503 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_s8);
2504 orc_program_add_destination (p, 1, "d1");
2505 orc_program_add_source (p, 1, "s1");
2506 orc_program_add_constant (p, 2, 0x00000003, "c1");
2507 orc_program_add_parameter (p, 1, "p1");
2508 orc_program_add_temporary (p, 2, "t1");
2509 orc_program_add_temporary (p, 1, "t2");
2510
2511 orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
2512 ORC_VAR_D1);
2513 orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
2514 ORC_VAR_D1);
2515 orc_program_append_2 (p, "convssswb", 0, ORC_VAR_T2, ORC_VAR_T1,
2516 ORC_VAR_D1, ORC_VAR_D1);
2517 orc_program_append_2 (p, "addssb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
2518 ORC_VAR_D1);
2519 #endif
2520
2521 orc_program_compile (p);
2522 c = orc_program_take_code (p);
2523 orc_program_free (p);
2524 }
2525 p_inited = TRUE;
2526 orc_once_mutex_unlock ();
2527 }
2528 ex->arrays[ORC_VAR_A2] = c;
2529 ex->program = 0;
2530
2531 ex->n = n;
2532 ex->arrays[ORC_VAR_D1] = d1;
2533 ex->arrays[ORC_VAR_S1] = (void *) s1;
2534 ex->params[ORC_VAR_P1] = p1;
2535
2536 func = c->exec;
2537 func (ex);
2538 }
2539 #endif
2540
2541
2542 /* adder_orc_add_volume_u16 */
2543 #ifdef DISABLE_ORC
2544 void
adder_orc_add_volume_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int p1,int n)2545 adder_orc_add_volume_u16 (guint16 * ORC_RESTRICT d1,
2546 const guint16 * ORC_RESTRICT s1, int p1, int n)
2547 {
2548 int i;
2549 orc_union16 *ORC_RESTRICT ptr0;
2550 const orc_union16 *ORC_RESTRICT ptr4;
2551 orc_union16 var34;
2552 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
2553 volatile orc_union16 var35;
2554 #else
2555 orc_union16 var35;
2556 #endif
2557 orc_union16 var36;
2558 orc_union16 var37;
2559 orc_union16 var38;
2560 orc_union16 var39;
2561 orc_union32 var40;
2562 orc_union32 var41;
2563 orc_union16 var42;
2564 orc_union16 var43;
2565
2566 ptr0 = (orc_union16 *) d1;
2567 ptr4 = (orc_union16 *) s1;
2568
2569 /* 1: loadpw */
2570 var35.i = 0x00008000; /* 32768 or 1.61895e-319f */
2571 /* 3: loadpw */
2572 var36.i = p1;
2573
2574 for (i = 0; i < n; i++) {
2575 /* 0: loadw */
2576 var34 = ptr4[i];
2577 /* 2: xorw */
2578 var39.i = var34.i ^ var35.i;
2579 /* 4: mulswl */
2580 var40.i = var39.i * var36.i;
2581 /* 5: shrsl */
2582 var41.i = var40.i >> 11;
2583 /* 6: convssslw */
2584 var42.i = ORC_CLAMP_SW (var41.i);
2585 /* 7: xorw */
2586 var43.i = var42.i ^ var35.i;
2587 /* 8: loadw */
2588 var37 = ptr0[i];
2589 /* 9: addusw */
2590 var38.i = ORC_CLAMP_UW ((orc_uint16) var37.i + (orc_uint16) var43.i);
2591 /* 10: storew */
2592 ptr0[i] = var38;
2593 }
2594
2595 }
2596
2597 #else
2598 static void
_backup_adder_orc_add_volume_u16(OrcExecutor * ORC_RESTRICT ex)2599 _backup_adder_orc_add_volume_u16 (OrcExecutor * ORC_RESTRICT ex)
2600 {
2601 int i;
2602 int n = ex->n;
2603 orc_union16 *ORC_RESTRICT ptr0;
2604 const orc_union16 *ORC_RESTRICT ptr4;
2605 orc_union16 var34;
2606 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
2607 volatile orc_union16 var35;
2608 #else
2609 orc_union16 var35;
2610 #endif
2611 orc_union16 var36;
2612 orc_union16 var37;
2613 orc_union16 var38;
2614 orc_union16 var39;
2615 orc_union32 var40;
2616 orc_union32 var41;
2617 orc_union16 var42;
2618 orc_union16 var43;
2619
2620 ptr0 = (orc_union16 *) ex->arrays[0];
2621 ptr4 = (orc_union16 *) ex->arrays[4];
2622
2623 /* 1: loadpw */
2624 var35.i = 0x00008000; /* 32768 or 1.61895e-319f */
2625 /* 3: loadpw */
2626 var36.i = ex->params[24];
2627
2628 for (i = 0; i < n; i++) {
2629 /* 0: loadw */
2630 var34 = ptr4[i];
2631 /* 2: xorw */
2632 var39.i = var34.i ^ var35.i;
2633 /* 4: mulswl */
2634 var40.i = var39.i * var36.i;
2635 /* 5: shrsl */
2636 var41.i = var40.i >> 11;
2637 /* 6: convssslw */
2638 var42.i = ORC_CLAMP_SW (var41.i);
2639 /* 7: xorw */
2640 var43.i = var42.i ^ var35.i;
2641 /* 8: loadw */
2642 var37 = ptr0[i];
2643 /* 9: addusw */
2644 var38.i = ORC_CLAMP_UW ((orc_uint16) var37.i + (orc_uint16) var43.i);
2645 /* 10: storew */
2646 ptr0[i] = var38;
2647 }
2648
2649 }
2650
2651 void
adder_orc_add_volume_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int p1,int n)2652 adder_orc_add_volume_u16 (guint16 * ORC_RESTRICT d1,
2653 const guint16 * ORC_RESTRICT s1, int p1, int n)
2654 {
2655 OrcExecutor _ex, *ex = &_ex;
2656 static volatile int p_inited = 0;
2657 static OrcCode *c = 0;
2658 void (*func) (OrcExecutor *);
2659
2660 if (!p_inited) {
2661 orc_once_mutex_lock ();
2662 if (!p_inited) {
2663 OrcProgram *p;
2664
2665 #if 1
2666 static const orc_uint8 bc[] = {
2667 1, 9, 24, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
2668 95, 118, 111, 108, 117, 109, 101, 95, 117, 49, 54, 11, 2, 2, 12, 2,
2669 2, 14, 2, 0, 128, 0, 0, 14, 4, 11, 0, 0, 0, 16, 2, 20,
2670 4, 20, 2, 101, 33, 4, 16, 176, 32, 33, 24, 125, 32, 32, 17, 165,
2671 33, 32, 101, 33, 33, 16, 72, 0, 0, 33, 2, 0,
2672 };
2673 p = orc_program_new_from_static_bytecode (bc);
2674 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_u16);
2675 #else
2676 p = orc_program_new ();
2677 orc_program_set_name (p, "adder_orc_add_volume_u16");
2678 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_u16);
2679 orc_program_add_destination (p, 2, "d1");
2680 orc_program_add_source (p, 2, "s1");
2681 orc_program_add_constant (p, 2, 0x00008000, "c1");
2682 orc_program_add_constant (p, 4, 0x0000000b, "c2");
2683 orc_program_add_parameter (p, 2, "p1");
2684 orc_program_add_temporary (p, 4, "t1");
2685 orc_program_add_temporary (p, 2, "t2");
2686
2687 orc_program_append_2 (p, "xorw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C1,
2688 ORC_VAR_D1);
2689 orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
2690 ORC_VAR_D1);
2691 orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
2692 ORC_VAR_D1);
2693 orc_program_append_2 (p, "convssslw", 0, ORC_VAR_T2, ORC_VAR_T1,
2694 ORC_VAR_D1, ORC_VAR_D1);
2695 orc_program_append_2 (p, "xorw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
2696 ORC_VAR_D1);
2697 orc_program_append_2 (p, "addusw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
2698 ORC_VAR_D1);
2699 #endif
2700
2701 orc_program_compile (p);
2702 c = orc_program_take_code (p);
2703 orc_program_free (p);
2704 }
2705 p_inited = TRUE;
2706 orc_once_mutex_unlock ();
2707 }
2708 ex->arrays[ORC_VAR_A2] = c;
2709 ex->program = 0;
2710
2711 ex->n = n;
2712 ex->arrays[ORC_VAR_D1] = d1;
2713 ex->arrays[ORC_VAR_S1] = (void *) s1;
2714 ex->params[ORC_VAR_P1] = p1;
2715
2716 func = c->exec;
2717 func (ex);
2718 }
2719 #endif
2720
2721
2722 /* adder_orc_add_volume_s16 */
2723 #ifdef DISABLE_ORC
2724 void
adder_orc_add_volume_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int p1,int n)2725 adder_orc_add_volume_s16 (gint16 * ORC_RESTRICT d1,
2726 const gint16 * ORC_RESTRICT s1, int p1, int n)
2727 {
2728 int i;
2729 orc_union16 *ORC_RESTRICT ptr0;
2730 const orc_union16 *ORC_RESTRICT ptr4;
2731 orc_union16 var34;
2732 orc_union16 var35;
2733 orc_union16 var36;
2734 orc_union16 var37;
2735 orc_union32 var38;
2736 orc_union32 var39;
2737 orc_union16 var40;
2738
2739 ptr0 = (orc_union16 *) d1;
2740 ptr4 = (orc_union16 *) s1;
2741
2742 /* 1: loadpw */
2743 var35.i = p1;
2744
2745 for (i = 0; i < n; i++) {
2746 /* 0: loadw */
2747 var34 = ptr4[i];
2748 /* 2: mulswl */
2749 var38.i = var34.i * var35.i;
2750 /* 3: shrsl */
2751 var39.i = var38.i >> 11;
2752 /* 4: convssslw */
2753 var40.i = ORC_CLAMP_SW (var39.i);
2754 /* 5: loadw */
2755 var36 = ptr0[i];
2756 /* 6: addssw */
2757 var37.i = ORC_CLAMP_SW (var36.i + var40.i);
2758 /* 7: storew */
2759 ptr0[i] = var37;
2760 }
2761
2762 }
2763
2764 #else
2765 static void
_backup_adder_orc_add_volume_s16(OrcExecutor * ORC_RESTRICT ex)2766 _backup_adder_orc_add_volume_s16 (OrcExecutor * ORC_RESTRICT ex)
2767 {
2768 int i;
2769 int n = ex->n;
2770 orc_union16 *ORC_RESTRICT ptr0;
2771 const orc_union16 *ORC_RESTRICT ptr4;
2772 orc_union16 var34;
2773 orc_union16 var35;
2774 orc_union16 var36;
2775 orc_union16 var37;
2776 orc_union32 var38;
2777 orc_union32 var39;
2778 orc_union16 var40;
2779
2780 ptr0 = (orc_union16 *) ex->arrays[0];
2781 ptr4 = (orc_union16 *) ex->arrays[4];
2782
2783 /* 1: loadpw */
2784 var35.i = ex->params[24];
2785
2786 for (i = 0; i < n; i++) {
2787 /* 0: loadw */
2788 var34 = ptr4[i];
2789 /* 2: mulswl */
2790 var38.i = var34.i * var35.i;
2791 /* 3: shrsl */
2792 var39.i = var38.i >> 11;
2793 /* 4: convssslw */
2794 var40.i = ORC_CLAMP_SW (var39.i);
2795 /* 5: loadw */
2796 var36 = ptr0[i];
2797 /* 6: addssw */
2798 var37.i = ORC_CLAMP_SW (var36.i + var40.i);
2799 /* 7: storew */
2800 ptr0[i] = var37;
2801 }
2802
2803 }
2804
2805 void
adder_orc_add_volume_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int p1,int n)2806 adder_orc_add_volume_s16 (gint16 * ORC_RESTRICT d1,
2807 const gint16 * ORC_RESTRICT s1, int p1, int n)
2808 {
2809 OrcExecutor _ex, *ex = &_ex;
2810 static volatile int p_inited = 0;
2811 static OrcCode *c = 0;
2812 void (*func) (OrcExecutor *);
2813
2814 if (!p_inited) {
2815 orc_once_mutex_lock ();
2816 if (!p_inited) {
2817 OrcProgram *p;
2818
2819 #if 1
2820 static const orc_uint8 bc[] = {
2821 1, 9, 24, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
2822 95, 118, 111, 108, 117, 109, 101, 95, 115, 49, 54, 11, 2, 2, 12, 2,
2823 2, 14, 4, 11, 0, 0, 0, 16, 2, 20, 4, 20, 2, 176, 32, 4,
2824 24, 125, 32, 32, 16, 165, 33, 32, 71, 0, 0, 33, 2, 0,
2825 };
2826 p = orc_program_new_from_static_bytecode (bc);
2827 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_s16);
2828 #else
2829 p = orc_program_new ();
2830 orc_program_set_name (p, "adder_orc_add_volume_s16");
2831 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_s16);
2832 orc_program_add_destination (p, 2, "d1");
2833 orc_program_add_source (p, 2, "s1");
2834 orc_program_add_constant (p, 4, 0x0000000b, "c1");
2835 orc_program_add_parameter (p, 2, "p1");
2836 orc_program_add_temporary (p, 4, "t1");
2837 orc_program_add_temporary (p, 2, "t2");
2838
2839 orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
2840 ORC_VAR_D1);
2841 orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
2842 ORC_VAR_D1);
2843 orc_program_append_2 (p, "convssslw", 0, ORC_VAR_T2, ORC_VAR_T1,
2844 ORC_VAR_D1, ORC_VAR_D1);
2845 orc_program_append_2 (p, "addssw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
2846 ORC_VAR_D1);
2847 #endif
2848
2849 orc_program_compile (p);
2850 c = orc_program_take_code (p);
2851 orc_program_free (p);
2852 }
2853 p_inited = TRUE;
2854 orc_once_mutex_unlock ();
2855 }
2856 ex->arrays[ORC_VAR_A2] = c;
2857 ex->program = 0;
2858
2859 ex->n = n;
2860 ex->arrays[ORC_VAR_D1] = d1;
2861 ex->arrays[ORC_VAR_S1] = (void *) s1;
2862 ex->params[ORC_VAR_P1] = p1;
2863
2864 func = c->exec;
2865 func (ex);
2866 }
2867 #endif
2868
2869
2870 /* adder_orc_add_volume_u32 */
2871 #ifdef DISABLE_ORC
2872 void
adder_orc_add_volume_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int p1,int n)2873 adder_orc_add_volume_u32 (guint32 * ORC_RESTRICT d1,
2874 const guint32 * ORC_RESTRICT s1, int p1, int n)
2875 {
2876 int i;
2877 orc_union32 *ORC_RESTRICT ptr0;
2878 const orc_union32 *ORC_RESTRICT ptr4;
2879 orc_union32 var34;
2880 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
2881 volatile orc_union32 var35;
2882 #else
2883 orc_union32 var35;
2884 #endif
2885 orc_union32 var36;
2886 orc_union32 var37;
2887 orc_union32 var38;
2888 orc_union32 var39;
2889 orc_union64 var40;
2890 orc_union64 var41;
2891 orc_union32 var42;
2892 orc_union32 var43;
2893
2894 ptr0 = (orc_union32 *) d1;
2895 ptr4 = (orc_union32 *) s1;
2896
2897 /* 1: loadpl */
2898 var35.i = 0x80000000; /* -2147483648 or 1.061e-314f */
2899 /* 3: loadpl */
2900 var36.i = p1;
2901
2902 for (i = 0; i < n; i++) {
2903 /* 0: loadl */
2904 var34 = ptr4[i];
2905 /* 2: xorl */
2906 var39.i = var34.i ^ var35.i;
2907 /* 4: mulslq */
2908 var40.i = ((orc_int64) var39.i) * ((orc_int64) var36.i);
2909 /* 5: shrsq */
2910 var41.i = var40.i >> 27;
2911 /* 6: convsssql */
2912 var42.i = ORC_CLAMP_SL (var41.i);
2913 /* 7: xorl */
2914 var43.i = var42.i ^ var35.i;
2915 /* 8: loadl */
2916 var37 = ptr0[i];
2917 /* 9: addusl */
2918 var38.i =
2919 ORC_CLAMP_UL ((orc_int64) (orc_uint32) var37.i +
2920 (orc_int64) (orc_uint32) var43.i);
2921 /* 10: storel */
2922 ptr0[i] = var38;
2923 }
2924
2925 }
2926
2927 #else
2928 static void
_backup_adder_orc_add_volume_u32(OrcExecutor * ORC_RESTRICT ex)2929 _backup_adder_orc_add_volume_u32 (OrcExecutor * ORC_RESTRICT ex)
2930 {
2931 int i;
2932 int n = ex->n;
2933 orc_union32 *ORC_RESTRICT ptr0;
2934 const orc_union32 *ORC_RESTRICT ptr4;
2935 orc_union32 var34;
2936 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
2937 volatile orc_union32 var35;
2938 #else
2939 orc_union32 var35;
2940 #endif
2941 orc_union32 var36;
2942 orc_union32 var37;
2943 orc_union32 var38;
2944 orc_union32 var39;
2945 orc_union64 var40;
2946 orc_union64 var41;
2947 orc_union32 var42;
2948 orc_union32 var43;
2949
2950 ptr0 = (orc_union32 *) ex->arrays[0];
2951 ptr4 = (orc_union32 *) ex->arrays[4];
2952
2953 /* 1: loadpl */
2954 var35.i = 0x80000000; /* -2147483648 or 1.061e-314f */
2955 /* 3: loadpl */
2956 var36.i = ex->params[24];
2957
2958 for (i = 0; i < n; i++) {
2959 /* 0: loadl */
2960 var34 = ptr4[i];
2961 /* 2: xorl */
2962 var39.i = var34.i ^ var35.i;
2963 /* 4: mulslq */
2964 var40.i = ((orc_int64) var39.i) * ((orc_int64) var36.i);
2965 /* 5: shrsq */
2966 var41.i = var40.i >> 27;
2967 /* 6: convsssql */
2968 var42.i = ORC_CLAMP_SL (var41.i);
2969 /* 7: xorl */
2970 var43.i = var42.i ^ var35.i;
2971 /* 8: loadl */
2972 var37 = ptr0[i];
2973 /* 9: addusl */
2974 var38.i =
2975 ORC_CLAMP_UL ((orc_int64) (orc_uint32) var37.i +
2976 (orc_int64) (orc_uint32) var43.i);
2977 /* 10: storel */
2978 ptr0[i] = var38;
2979 }
2980
2981 }
2982
2983 void
adder_orc_add_volume_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int p1,int n)2984 adder_orc_add_volume_u32 (guint32 * ORC_RESTRICT d1,
2985 const guint32 * ORC_RESTRICT s1, int p1, int n)
2986 {
2987 OrcExecutor _ex, *ex = &_ex;
2988 static volatile int p_inited = 0;
2989 static OrcCode *c = 0;
2990 void (*func) (OrcExecutor *);
2991
2992 if (!p_inited) {
2993 orc_once_mutex_lock ();
2994 if (!p_inited) {
2995 OrcProgram *p;
2996
2997 #if 1
2998 static const orc_uint8 bc[] = {
2999 1, 9, 24, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
3000 95, 118, 111, 108, 117, 109, 101, 95, 117, 51, 50, 11, 4, 4, 12, 4,
3001 4, 14, 4, 0, 0, 0, 128, 15, 8, 27, 0, 0, 0, 0, 0, 0,
3002 0, 16, 4, 20, 8, 20, 4, 132, 33, 4, 16, 178, 32, 33, 24, 147,
3003 32, 32, 17, 170, 33, 32, 132, 33, 33, 16, 105, 0, 0, 33, 2, 0,
3004
3005 };
3006 p = orc_program_new_from_static_bytecode (bc);
3007 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_u32);
3008 #else
3009 p = orc_program_new ();
3010 orc_program_set_name (p, "adder_orc_add_volume_u32");
3011 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_u32);
3012 orc_program_add_destination (p, 4, "d1");
3013 orc_program_add_source (p, 4, "s1");
3014 orc_program_add_constant (p, 4, 0x80000000, "c1");
3015 orc_program_add_constant_int64 (p, 8, 0x000000000000001bULL, "c2");
3016 orc_program_add_parameter (p, 4, "p1");
3017 orc_program_add_temporary (p, 8, "t1");
3018 orc_program_add_temporary (p, 4, "t2");
3019
3020 orc_program_append_2 (p, "xorl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C1,
3021 ORC_VAR_D1);
3022 orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
3023 ORC_VAR_D1);
3024 orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
3025 ORC_VAR_D1);
3026 orc_program_append_2 (p, "convsssql", 0, ORC_VAR_T2, ORC_VAR_T1,
3027 ORC_VAR_D1, ORC_VAR_D1);
3028 orc_program_append_2 (p, "xorl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
3029 ORC_VAR_D1);
3030 orc_program_append_2 (p, "addusl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
3031 ORC_VAR_D1);
3032 #endif
3033
3034 orc_program_compile (p);
3035 c = orc_program_take_code (p);
3036 orc_program_free (p);
3037 }
3038 p_inited = TRUE;
3039 orc_once_mutex_unlock ();
3040 }
3041 ex->arrays[ORC_VAR_A2] = c;
3042 ex->program = 0;
3043
3044 ex->n = n;
3045 ex->arrays[ORC_VAR_D1] = d1;
3046 ex->arrays[ORC_VAR_S1] = (void *) s1;
3047 ex->params[ORC_VAR_P1] = p1;
3048
3049 func = c->exec;
3050 func (ex);
3051 }
3052 #endif
3053
3054
3055 /* adder_orc_add_volume_s32 */
3056 #ifdef DISABLE_ORC
3057 void
adder_orc_add_volume_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int p1,int n)3058 adder_orc_add_volume_s32 (gint32 * ORC_RESTRICT d1,
3059 const gint32 * ORC_RESTRICT s1, int p1, int n)
3060 {
3061 int i;
3062 orc_union32 *ORC_RESTRICT ptr0;
3063 const orc_union32 *ORC_RESTRICT ptr4;
3064 orc_union32 var34;
3065 orc_union32 var35;
3066 orc_union32 var36;
3067 orc_union32 var37;
3068 orc_union64 var38;
3069 orc_union64 var39;
3070 orc_union32 var40;
3071
3072 ptr0 = (orc_union32 *) d1;
3073 ptr4 = (orc_union32 *) s1;
3074
3075 /* 1: loadpl */
3076 var35.i = p1;
3077
3078 for (i = 0; i < n; i++) {
3079 /* 0: loadl */
3080 var34 = ptr4[i];
3081 /* 2: mulslq */
3082 var38.i = ((orc_int64) var34.i) * ((orc_int64) var35.i);
3083 /* 3: shrsq */
3084 var39.i = var38.i >> 27;
3085 /* 4: convsssql */
3086 var40.i = ORC_CLAMP_SL (var39.i);
3087 /* 5: loadl */
3088 var36 = ptr0[i];
3089 /* 6: addssl */
3090 var37.i = ORC_CLAMP_SL ((orc_int64) var36.i + (orc_int64) var40.i);
3091 /* 7: storel */
3092 ptr0[i] = var37;
3093 }
3094
3095 }
3096
3097 #else
3098 static void
_backup_adder_orc_add_volume_s32(OrcExecutor * ORC_RESTRICT ex)3099 _backup_adder_orc_add_volume_s32 (OrcExecutor * ORC_RESTRICT ex)
3100 {
3101 int i;
3102 int n = ex->n;
3103 orc_union32 *ORC_RESTRICT ptr0;
3104 const orc_union32 *ORC_RESTRICT ptr4;
3105 orc_union32 var34;
3106 orc_union32 var35;
3107 orc_union32 var36;
3108 orc_union32 var37;
3109 orc_union64 var38;
3110 orc_union64 var39;
3111 orc_union32 var40;
3112
3113 ptr0 = (orc_union32 *) ex->arrays[0];
3114 ptr4 = (orc_union32 *) ex->arrays[4];
3115
3116 /* 1: loadpl */
3117 var35.i = ex->params[24];
3118
3119 for (i = 0; i < n; i++) {
3120 /* 0: loadl */
3121 var34 = ptr4[i];
3122 /* 2: mulslq */
3123 var38.i = ((orc_int64) var34.i) * ((orc_int64) var35.i);
3124 /* 3: shrsq */
3125 var39.i = var38.i >> 27;
3126 /* 4: convsssql */
3127 var40.i = ORC_CLAMP_SL (var39.i);
3128 /* 5: loadl */
3129 var36 = ptr0[i];
3130 /* 6: addssl */
3131 var37.i = ORC_CLAMP_SL ((orc_int64) var36.i + (orc_int64) var40.i);
3132 /* 7: storel */
3133 ptr0[i] = var37;
3134 }
3135
3136 }
3137
3138 void
adder_orc_add_volume_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int p1,int n)3139 adder_orc_add_volume_s32 (gint32 * ORC_RESTRICT d1,
3140 const gint32 * ORC_RESTRICT s1, int p1, int n)
3141 {
3142 OrcExecutor _ex, *ex = &_ex;
3143 static volatile int p_inited = 0;
3144 static OrcCode *c = 0;
3145 void (*func) (OrcExecutor *);
3146
3147 if (!p_inited) {
3148 orc_once_mutex_lock ();
3149 if (!p_inited) {
3150 OrcProgram *p;
3151
3152 #if 1
3153 static const orc_uint8 bc[] = {
3154 1, 9, 24, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
3155 95, 118, 111, 108, 117, 109, 101, 95, 115, 51, 50, 11, 4, 4, 12, 4,
3156 4, 15, 8, 27, 0, 0, 0, 0, 0, 0, 0, 16, 4, 20, 8, 20,
3157 4, 178, 32, 4, 24, 147, 32, 32, 16, 170, 33, 32, 104, 0, 0, 33,
3158 2, 0,
3159 };
3160 p = orc_program_new_from_static_bytecode (bc);
3161 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_s32);
3162 #else
3163 p = orc_program_new ();
3164 orc_program_set_name (p, "adder_orc_add_volume_s32");
3165 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_s32);
3166 orc_program_add_destination (p, 4, "d1");
3167 orc_program_add_source (p, 4, "s1");
3168 orc_program_add_constant_int64 (p, 8, 0x000000000000001bULL, "c1");
3169 orc_program_add_parameter (p, 4, "p1");
3170 orc_program_add_temporary (p, 8, "t1");
3171 orc_program_add_temporary (p, 4, "t2");
3172
3173 orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
3174 ORC_VAR_D1);
3175 orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
3176 ORC_VAR_D1);
3177 orc_program_append_2 (p, "convsssql", 0, ORC_VAR_T2, ORC_VAR_T1,
3178 ORC_VAR_D1, ORC_VAR_D1);
3179 orc_program_append_2 (p, "addssl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
3180 ORC_VAR_D1);
3181 #endif
3182
3183 orc_program_compile (p);
3184 c = orc_program_take_code (p);
3185 orc_program_free (p);
3186 }
3187 p_inited = TRUE;
3188 orc_once_mutex_unlock ();
3189 }
3190 ex->arrays[ORC_VAR_A2] = c;
3191 ex->program = 0;
3192
3193 ex->n = n;
3194 ex->arrays[ORC_VAR_D1] = d1;
3195 ex->arrays[ORC_VAR_S1] = (void *) s1;
3196 ex->params[ORC_VAR_P1] = p1;
3197
3198 func = c->exec;
3199 func (ex);
3200 }
3201 #endif
3202
3203
3204 /* adder_orc_add_volume_f32 */
3205 #ifdef DISABLE_ORC
3206 void
adder_orc_add_volume_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,float p1,int n)3207 adder_orc_add_volume_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1,
3208 float p1, int n)
3209 {
3210 int i;
3211 orc_union32 *ORC_RESTRICT ptr0;
3212 const orc_union32 *ORC_RESTRICT ptr4;
3213 orc_union32 var33;
3214 orc_union32 var34;
3215 orc_union32 var35;
3216 orc_union32 var36;
3217 orc_union32 var37;
3218
3219 ptr0 = (orc_union32 *) d1;
3220 ptr4 = (orc_union32 *) s1;
3221
3222 /* 1: loadpl */
3223 var34.f = p1;
3224
3225 for (i = 0; i < n; i++) {
3226 /* 0: loadl */
3227 var33 = ptr4[i];
3228 /* 2: mulf */
3229 {
3230 orc_union32 _src1;
3231 orc_union32 _src2;
3232 orc_union32 _dest1;
3233 _src1.i = ORC_DENORMAL (var33.i);
3234 _src2.i = ORC_DENORMAL (var34.i);
3235 _dest1.f = _src1.f * _src2.f;
3236 var37.i = ORC_DENORMAL (_dest1.i);
3237 }
3238 /* 3: loadl */
3239 var35 = ptr0[i];
3240 /* 4: addf */
3241 {
3242 orc_union32 _src1;
3243 orc_union32 _src2;
3244 orc_union32 _dest1;
3245 _src1.i = ORC_DENORMAL (var35.i);
3246 _src2.i = ORC_DENORMAL (var37.i);
3247 _dest1.f = _src1.f + _src2.f;
3248 var36.i = ORC_DENORMAL (_dest1.i);
3249 }
3250 /* 5: storel */
3251 ptr0[i] = var36;
3252 }
3253
3254 }
3255
3256 #else
3257 static void
_backup_adder_orc_add_volume_f32(OrcExecutor * ORC_RESTRICT ex)3258 _backup_adder_orc_add_volume_f32 (OrcExecutor * ORC_RESTRICT ex)
3259 {
3260 int i;
3261 int n = ex->n;
3262 orc_union32 *ORC_RESTRICT ptr0;
3263 const orc_union32 *ORC_RESTRICT ptr4;
3264 orc_union32 var33;
3265 orc_union32 var34;
3266 orc_union32 var35;
3267 orc_union32 var36;
3268 orc_union32 var37;
3269
3270 ptr0 = (orc_union32 *) ex->arrays[0];
3271 ptr4 = (orc_union32 *) ex->arrays[4];
3272
3273 /* 1: loadpl */
3274 var34.i = ex->params[24];
3275
3276 for (i = 0; i < n; i++) {
3277 /* 0: loadl */
3278 var33 = ptr4[i];
3279 /* 2: mulf */
3280 {
3281 orc_union32 _src1;
3282 orc_union32 _src2;
3283 orc_union32 _dest1;
3284 _src1.i = ORC_DENORMAL (var33.i);
3285 _src2.i = ORC_DENORMAL (var34.i);
3286 _dest1.f = _src1.f * _src2.f;
3287 var37.i = ORC_DENORMAL (_dest1.i);
3288 }
3289 /* 3: loadl */
3290 var35 = ptr0[i];
3291 /* 4: addf */
3292 {
3293 orc_union32 _src1;
3294 orc_union32 _src2;
3295 orc_union32 _dest1;
3296 _src1.i = ORC_DENORMAL (var35.i);
3297 _src2.i = ORC_DENORMAL (var37.i);
3298 _dest1.f = _src1.f + _src2.f;
3299 var36.i = ORC_DENORMAL (_dest1.i);
3300 }
3301 /* 5: storel */
3302 ptr0[i] = var36;
3303 }
3304
3305 }
3306
3307 void
adder_orc_add_volume_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,float p1,int n)3308 adder_orc_add_volume_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1,
3309 float p1, int n)
3310 {
3311 OrcExecutor _ex, *ex = &_ex;
3312 static volatile int p_inited = 0;
3313 static OrcCode *c = 0;
3314 void (*func) (OrcExecutor *);
3315
3316 if (!p_inited) {
3317 orc_once_mutex_lock ();
3318 if (!p_inited) {
3319 OrcProgram *p;
3320
3321 #if 1
3322 static const orc_uint8 bc[] = {
3323 1, 9, 24, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
3324 95, 118, 111, 108, 117, 109, 101, 95, 102, 51, 50, 11, 4, 4, 12, 4,
3325 4, 17, 4, 20, 4, 202, 32, 4, 24, 200, 0, 0, 32, 2, 0,
3326 };
3327 p = orc_program_new_from_static_bytecode (bc);
3328 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_f32);
3329 #else
3330 p = orc_program_new ();
3331 orc_program_set_name (p, "adder_orc_add_volume_f32");
3332 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_f32);
3333 orc_program_add_destination (p, 4, "d1");
3334 orc_program_add_source (p, 4, "s1");
3335 orc_program_add_parameter_float (p, 4, "p1");
3336 orc_program_add_temporary (p, 4, "t1");
3337
3338 orc_program_append_2 (p, "mulf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
3339 ORC_VAR_D1);
3340 orc_program_append_2 (p, "addf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
3341 ORC_VAR_D1);
3342 #endif
3343
3344 orc_program_compile (p);
3345 c = orc_program_take_code (p);
3346 orc_program_free (p);
3347 }
3348 p_inited = TRUE;
3349 orc_once_mutex_unlock ();
3350 }
3351 ex->arrays[ORC_VAR_A2] = c;
3352 ex->program = 0;
3353
3354 ex->n = n;
3355 ex->arrays[ORC_VAR_D1] = d1;
3356 ex->arrays[ORC_VAR_S1] = (void *) s1;
3357 {
3358 orc_union32 tmp;
3359 tmp.f = p1;
3360 ex->params[ORC_VAR_P1] = tmp.i;
3361 }
3362
3363 func = c->exec;
3364 func (ex);
3365 }
3366 #endif
3367
3368
3369 /* adder_orc_add_volume_f64 */
3370 #ifdef DISABLE_ORC
3371 void
adder_orc_add_volume_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,double p1,int n)3372 adder_orc_add_volume_f64 (double *ORC_RESTRICT d1,
3373 const double *ORC_RESTRICT s1, double p1, int n)
3374 {
3375 int i;
3376 orc_union64 *ORC_RESTRICT ptr0;
3377 const orc_union64 *ORC_RESTRICT ptr4;
3378 orc_union64 var33;
3379 orc_union64 var34;
3380 orc_union64 var35;
3381 orc_union64 var36;
3382 orc_union64 var37;
3383
3384 ptr0 = (orc_union64 *) d1;
3385 ptr4 = (orc_union64 *) s1;
3386
3387 /* 1: loadpq */
3388 var34.f = p1;
3389
3390 for (i = 0; i < n; i++) {
3391 /* 0: loadq */
3392 var33 = ptr4[i];
3393 /* 2: muld */
3394 {
3395 orc_union64 _src1;
3396 orc_union64 _src2;
3397 orc_union64 _dest1;
3398 _src1.i = ORC_DENORMAL_DOUBLE (var33.i);
3399 _src2.i = ORC_DENORMAL_DOUBLE (var34.i);
3400 _dest1.f = _src1.f * _src2.f;
3401 var37.i = ORC_DENORMAL_DOUBLE (_dest1.i);
3402 }
3403 /* 3: loadq */
3404 var35 = ptr0[i];
3405 /* 4: addd */
3406 {
3407 orc_union64 _src1;
3408 orc_union64 _src2;
3409 orc_union64 _dest1;
3410 _src1.i = ORC_DENORMAL_DOUBLE (var35.i);
3411 _src2.i = ORC_DENORMAL_DOUBLE (var37.i);
3412 _dest1.f = _src1.f + _src2.f;
3413 var36.i = ORC_DENORMAL_DOUBLE (_dest1.i);
3414 }
3415 /* 5: storeq */
3416 ptr0[i] = var36;
3417 }
3418
3419 }
3420
3421 #else
3422 static void
_backup_adder_orc_add_volume_f64(OrcExecutor * ORC_RESTRICT ex)3423 _backup_adder_orc_add_volume_f64 (OrcExecutor * ORC_RESTRICT ex)
3424 {
3425 int i;
3426 int n = ex->n;
3427 orc_union64 *ORC_RESTRICT ptr0;
3428 const orc_union64 *ORC_RESTRICT ptr4;
3429 orc_union64 var33;
3430 orc_union64 var34;
3431 orc_union64 var35;
3432 orc_union64 var36;
3433 orc_union64 var37;
3434
3435 ptr0 = (orc_union64 *) ex->arrays[0];
3436 ptr4 = (orc_union64 *) ex->arrays[4];
3437
3438 /* 1: loadpq */
3439 var34.i =
3440 (ex->params[24] & 0xffffffff) | ((orc_uint64) (ex->params[24 +
3441 (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);
3442
3443 for (i = 0; i < n; i++) {
3444 /* 0: loadq */
3445 var33 = ptr4[i];
3446 /* 2: muld */
3447 {
3448 orc_union64 _src1;
3449 orc_union64 _src2;
3450 orc_union64 _dest1;
3451 _src1.i = ORC_DENORMAL_DOUBLE (var33.i);
3452 _src2.i = ORC_DENORMAL_DOUBLE (var34.i);
3453 _dest1.f = _src1.f * _src2.f;
3454 var37.i = ORC_DENORMAL_DOUBLE (_dest1.i);
3455 }
3456 /* 3: loadq */
3457 var35 = ptr0[i];
3458 /* 4: addd */
3459 {
3460 orc_union64 _src1;
3461 orc_union64 _src2;
3462 orc_union64 _dest1;
3463 _src1.i = ORC_DENORMAL_DOUBLE (var35.i);
3464 _src2.i = ORC_DENORMAL_DOUBLE (var37.i);
3465 _dest1.f = _src1.f + _src2.f;
3466 var36.i = ORC_DENORMAL_DOUBLE (_dest1.i);
3467 }
3468 /* 5: storeq */
3469 ptr0[i] = var36;
3470 }
3471
3472 }
3473
3474 void
adder_orc_add_volume_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,double p1,int n)3475 adder_orc_add_volume_f64 (double *ORC_RESTRICT d1,
3476 const double *ORC_RESTRICT s1, double p1, int n)
3477 {
3478 OrcExecutor _ex, *ex = &_ex;
3479 static volatile int p_inited = 0;
3480 static OrcCode *c = 0;
3481 void (*func) (OrcExecutor *);
3482
3483 if (!p_inited) {
3484 orc_once_mutex_lock ();
3485 if (!p_inited) {
3486 OrcProgram *p;
3487
3488 #if 1
3489 static const orc_uint8 bc[] = {
3490 1, 9, 24, 97, 100, 100, 101, 114, 95, 111, 114, 99, 95, 97, 100, 100,
3491 95, 118, 111, 108, 117, 109, 101, 95, 102, 54, 52, 11, 8, 8, 12, 8,
3492 8, 18, 8, 20, 8, 214, 32, 4, 24, 212, 0, 0, 32, 2, 0,
3493 };
3494 p = orc_program_new_from_static_bytecode (bc);
3495 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_f64);
3496 #else
3497 p = orc_program_new ();
3498 orc_program_set_name (p, "adder_orc_add_volume_f64");
3499 orc_program_set_backup_function (p, _backup_adder_orc_add_volume_f64);
3500 orc_program_add_destination (p, 8, "d1");
3501 orc_program_add_source (p, 8, "s1");
3502 orc_program_add_parameter_double (p, 8, "p1");
3503 orc_program_add_temporary (p, 8, "t1");
3504
3505 orc_program_append_2 (p, "muld", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
3506 ORC_VAR_D1);
3507 orc_program_append_2 (p, "addd", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
3508 ORC_VAR_D1);
3509 #endif
3510
3511 orc_program_compile (p);
3512 c = orc_program_take_code (p);
3513 orc_program_free (p);
3514 }
3515 p_inited = TRUE;
3516 orc_once_mutex_unlock ();
3517 }
3518 ex->arrays[ORC_VAR_A2] = c;
3519 ex->program = 0;
3520
3521 ex->n = n;
3522 ex->arrays[ORC_VAR_D1] = d1;
3523 ex->arrays[ORC_VAR_S1] = (void *) s1;
3524 {
3525 orc_union64 tmp;
3526 tmp.f = p1;
3527 ex->params[ORC_VAR_P1] = ((orc_uint64) tmp.i) & 0xffffffff;
3528 ex->params[ORC_VAR_T1] = ((orc_uint64) tmp.i) >> 32;
3529 }
3530
3531 func = c->exec;
3532 func (ex);
3533 }
3534 #endif
3535