1 
2 /* autogenerated from gstaudiomixerorc.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 audiomixer_orc_add_s32 (gint32 * ORC_RESTRICT d1,
99     const gint32 * ORC_RESTRICT s1, int n);
100 void audiomixer_orc_add_s16 (gint16 * ORC_RESTRICT d1,
101     const gint16 * ORC_RESTRICT s1, int n);
102 void audiomixer_orc_add_s8 (gint8 * ORC_RESTRICT d1,
103     const gint8 * ORC_RESTRICT s1, int n);
104 void audiomixer_orc_add_u32 (guint32 * ORC_RESTRICT d1,
105     const guint32 * ORC_RESTRICT s1, int n);
106 void audiomixer_orc_add_u16 (guint16 * ORC_RESTRICT d1,
107     const guint16 * ORC_RESTRICT s1, int n);
108 void audiomixer_orc_add_u8 (guint8 * ORC_RESTRICT d1,
109     const guint8 * ORC_RESTRICT s1, int n);
110 void audiomixer_orc_add_f32 (float *ORC_RESTRICT d1,
111     const float *ORC_RESTRICT s1, int n);
112 void audiomixer_orc_add_f64 (double *ORC_RESTRICT d1,
113     const double *ORC_RESTRICT s1, int n);
114 void audiomixer_orc_volume_u8 (guint8 * ORC_RESTRICT d1, int p1, int n);
115 void audiomixer_orc_add_volume_u8 (guint8 * ORC_RESTRICT d1,
116     const guint8 * ORC_RESTRICT s1, int p1, int n);
117 void audiomixer_orc_add_volume_s8 (gint8 * ORC_RESTRICT d1,
118     const gint8 * ORC_RESTRICT s1, int p1, int n);
119 void audiomixer_orc_add_volume_u16 (guint16 * ORC_RESTRICT d1,
120     const guint16 * ORC_RESTRICT s1, int p1, int n);
121 void audiomixer_orc_add_volume_s16 (gint16 * ORC_RESTRICT d1,
122     const gint16 * ORC_RESTRICT s1, int p1, int n);
123 void audiomixer_orc_add_volume_u32 (guint32 * ORC_RESTRICT d1,
124     const guint32 * ORC_RESTRICT s1, int p1, int n);
125 void audiomixer_orc_add_volume_s32 (gint32 * ORC_RESTRICT d1,
126     const gint32 * ORC_RESTRICT s1, int p1, int n);
127 void audiomixer_orc_add_volume_f32 (float *ORC_RESTRICT d1,
128     const float *ORC_RESTRICT s1, float p1, int n);
129 void audiomixer_orc_add_volume_f64 (double *ORC_RESTRICT d1,
130     const double *ORC_RESTRICT s1, double p1, int n);
131 
132 
133 /* begin Orc C target preamble */
134 #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
135 #define ORC_ABS(a) ((a)<0 ? -(a) : (a))
136 #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))
137 #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))
138 #define ORC_SB_MAX 127
139 #define ORC_SB_MIN (-1-ORC_SB_MAX)
140 #define ORC_UB_MAX (orc_uint8) 255
141 #define ORC_UB_MIN 0
142 #define ORC_SW_MAX 32767
143 #define ORC_SW_MIN (-1-ORC_SW_MAX)
144 #define ORC_UW_MAX (orc_uint16)65535
145 #define ORC_UW_MIN 0
146 #define ORC_SL_MAX 2147483647
147 #define ORC_SL_MIN (-1-ORC_SL_MAX)
148 #define ORC_UL_MAX 4294967295U
149 #define ORC_UL_MIN 0
150 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)
151 #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)
152 #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)
153 #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)
154 #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)
155 #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)
156 #define ORC_SWAP_W(x) ((((x)&0xffU)<<8) | (((x)&0xff00U)>>8))
157 #define ORC_SWAP_L(x) ((((x)&0xffU)<<24) | (((x)&0xff00U)<<8) | (((x)&0xff0000U)>>8) | (((x)&0xff000000U)>>24))
158 #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))
159 #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))
160 #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))
161 #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
162 #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
163 #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
164 #ifndef ORC_RESTRICT
165 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
166 #define ORC_RESTRICT restrict
167 #elif defined(__GNUC__) && __GNUC__ >= 4
168 #define ORC_RESTRICT __restrict__
169 #else
170 #define ORC_RESTRICT
171 #endif
172 #endif
173 /* end Orc C target preamble */
174 
175 
176 
177 /* audiomixer_orc_add_s32 */
178 #ifdef DISABLE_ORC
179 void
audiomixer_orc_add_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int n)180 audiomixer_orc_add_s32 (gint32 * ORC_RESTRICT d1,
181     const gint32 * ORC_RESTRICT s1, int n)
182 {
183   int i;
184   orc_union32 *ORC_RESTRICT ptr0;
185   const orc_union32 *ORC_RESTRICT ptr4;
186   orc_union32 var32;
187   orc_union32 var33;
188   orc_union32 var34;
189 
190   ptr0 = (orc_union32 *) d1;
191   ptr4 = (orc_union32 *) s1;
192 
193 
194   for (i = 0; i < n; i++) {
195     /* 0: loadl */
196     var32 = ptr0[i];
197     /* 1: loadl */
198     var33 = ptr4[i];
199     /* 2: addssl */
200     var34.i = ORC_CLAMP_SL ((orc_int64) var32.i + (orc_int64) var33.i);
201     /* 3: storel */
202     ptr0[i] = var34;
203   }
204 
205 }
206 
207 #else
208 static void
_backup_audiomixer_orc_add_s32(OrcExecutor * ORC_RESTRICT ex)209 _backup_audiomixer_orc_add_s32 (OrcExecutor * ORC_RESTRICT ex)
210 {
211   int i;
212   int n = ex->n;
213   orc_union32 *ORC_RESTRICT ptr0;
214   const orc_union32 *ORC_RESTRICT ptr4;
215   orc_union32 var32;
216   orc_union32 var33;
217   orc_union32 var34;
218 
219   ptr0 = (orc_union32 *) ex->arrays[0];
220   ptr4 = (orc_union32 *) ex->arrays[4];
221 
222 
223   for (i = 0; i < n; i++) {
224     /* 0: loadl */
225     var32 = ptr0[i];
226     /* 1: loadl */
227     var33 = ptr4[i];
228     /* 2: addssl */
229     var34.i = ORC_CLAMP_SL ((orc_int64) var32.i + (orc_int64) var33.i);
230     /* 3: storel */
231     ptr0[i] = var34;
232   }
233 
234 }
235 
236 void
audiomixer_orc_add_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int n)237 audiomixer_orc_add_s32 (gint32 * ORC_RESTRICT d1,
238     const gint32 * ORC_RESTRICT s1, int n)
239 {
240   OrcExecutor _ex, *ex = &_ex;
241   static volatile int p_inited = 0;
242   static OrcCode *c = 0;
243   void (*func) (OrcExecutor *);
244 
245   if (!p_inited) {
246     orc_once_mutex_lock ();
247     if (!p_inited) {
248       OrcProgram *p;
249 
250 #if 1
251       static const orc_uint8 bc[] = {
252         1, 9, 22, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
253         99, 95, 97, 100, 100, 95, 115, 51, 50, 11, 4, 4, 12, 4, 4, 104,
254         0, 0, 4, 2, 0,
255       };
256       p = orc_program_new_from_static_bytecode (bc);
257       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_s32);
258 #else
259       p = orc_program_new ();
260       orc_program_set_name (p, "audiomixer_orc_add_s32");
261       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_s32);
262       orc_program_add_destination (p, 4, "d1");
263       orc_program_add_source (p, 4, "s1");
264 
265       orc_program_append_2 (p, "addssl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
266           ORC_VAR_D1);
267 #endif
268 
269       orc_program_compile (p);
270       c = orc_program_take_code (p);
271       orc_program_free (p);
272     }
273     p_inited = TRUE;
274     orc_once_mutex_unlock ();
275   }
276   ex->arrays[ORC_VAR_A2] = c;
277   ex->program = 0;
278 
279   ex->n = n;
280   ex->arrays[ORC_VAR_D1] = d1;
281   ex->arrays[ORC_VAR_S1] = (void *) s1;
282 
283   func = c->exec;
284   func (ex);
285 }
286 #endif
287 
288 
289 /* audiomixer_orc_add_s16 */
290 #ifdef DISABLE_ORC
291 void
audiomixer_orc_add_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int n)292 audiomixer_orc_add_s16 (gint16 * ORC_RESTRICT d1,
293     const gint16 * ORC_RESTRICT s1, int n)
294 {
295   int i;
296   orc_union16 *ORC_RESTRICT ptr0;
297   const orc_union16 *ORC_RESTRICT ptr4;
298   orc_union16 var32;
299   orc_union16 var33;
300   orc_union16 var34;
301 
302   ptr0 = (orc_union16 *) d1;
303   ptr4 = (orc_union16 *) s1;
304 
305 
306   for (i = 0; i < n; i++) {
307     /* 0: loadw */
308     var32 = ptr0[i];
309     /* 1: loadw */
310     var33 = ptr4[i];
311     /* 2: addssw */
312     var34.i = ORC_CLAMP_SW (var32.i + var33.i);
313     /* 3: storew */
314     ptr0[i] = var34;
315   }
316 
317 }
318 
319 #else
320 static void
_backup_audiomixer_orc_add_s16(OrcExecutor * ORC_RESTRICT ex)321 _backup_audiomixer_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex)
322 {
323   int i;
324   int n = ex->n;
325   orc_union16 *ORC_RESTRICT ptr0;
326   const orc_union16 *ORC_RESTRICT ptr4;
327   orc_union16 var32;
328   orc_union16 var33;
329   orc_union16 var34;
330 
331   ptr0 = (orc_union16 *) ex->arrays[0];
332   ptr4 = (orc_union16 *) ex->arrays[4];
333 
334 
335   for (i = 0; i < n; i++) {
336     /* 0: loadw */
337     var32 = ptr0[i];
338     /* 1: loadw */
339     var33 = ptr4[i];
340     /* 2: addssw */
341     var34.i = ORC_CLAMP_SW (var32.i + var33.i);
342     /* 3: storew */
343     ptr0[i] = var34;
344   }
345 
346 }
347 
348 void
audiomixer_orc_add_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int n)349 audiomixer_orc_add_s16 (gint16 * ORC_RESTRICT d1,
350     const gint16 * ORC_RESTRICT s1, int n)
351 {
352   OrcExecutor _ex, *ex = &_ex;
353   static volatile int p_inited = 0;
354   static OrcCode *c = 0;
355   void (*func) (OrcExecutor *);
356 
357   if (!p_inited) {
358     orc_once_mutex_lock ();
359     if (!p_inited) {
360       OrcProgram *p;
361 
362 #if 1
363       static const orc_uint8 bc[] = {
364         1, 9, 22, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
365         99, 95, 97, 100, 100, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 71,
366         0, 0, 4, 2, 0,
367       };
368       p = orc_program_new_from_static_bytecode (bc);
369       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_s16);
370 #else
371       p = orc_program_new ();
372       orc_program_set_name (p, "audiomixer_orc_add_s16");
373       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_s16);
374       orc_program_add_destination (p, 2, "d1");
375       orc_program_add_source (p, 2, "s1");
376 
377       orc_program_append_2 (p, "addssw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
378           ORC_VAR_D1);
379 #endif
380 
381       orc_program_compile (p);
382       c = orc_program_take_code (p);
383       orc_program_free (p);
384     }
385     p_inited = TRUE;
386     orc_once_mutex_unlock ();
387   }
388   ex->arrays[ORC_VAR_A2] = c;
389   ex->program = 0;
390 
391   ex->n = n;
392   ex->arrays[ORC_VAR_D1] = d1;
393   ex->arrays[ORC_VAR_S1] = (void *) s1;
394 
395   func = c->exec;
396   func (ex);
397 }
398 #endif
399 
400 
401 /* audiomixer_orc_add_s8 */
402 #ifdef DISABLE_ORC
403 void
audiomixer_orc_add_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int n)404 audiomixer_orc_add_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1,
405     int n)
406 {
407   int i;
408   orc_int8 *ORC_RESTRICT ptr0;
409   const orc_int8 *ORC_RESTRICT ptr4;
410   orc_int8 var32;
411   orc_int8 var33;
412   orc_int8 var34;
413 
414   ptr0 = (orc_int8 *) d1;
415   ptr4 = (orc_int8 *) s1;
416 
417 
418   for (i = 0; i < n; i++) {
419     /* 0: loadb */
420     var32 = ptr0[i];
421     /* 1: loadb */
422     var33 = ptr4[i];
423     /* 2: addssb */
424     var34 = ORC_CLAMP_SB (var32 + var33);
425     /* 3: storeb */
426     ptr0[i] = var34;
427   }
428 
429 }
430 
431 #else
432 static void
_backup_audiomixer_orc_add_s8(OrcExecutor * ORC_RESTRICT ex)433 _backup_audiomixer_orc_add_s8 (OrcExecutor * ORC_RESTRICT ex)
434 {
435   int i;
436   int n = ex->n;
437   orc_int8 *ORC_RESTRICT ptr0;
438   const orc_int8 *ORC_RESTRICT ptr4;
439   orc_int8 var32;
440   orc_int8 var33;
441   orc_int8 var34;
442 
443   ptr0 = (orc_int8 *) ex->arrays[0];
444   ptr4 = (orc_int8 *) ex->arrays[4];
445 
446 
447   for (i = 0; i < n; i++) {
448     /* 0: loadb */
449     var32 = ptr0[i];
450     /* 1: loadb */
451     var33 = ptr4[i];
452     /* 2: addssb */
453     var34 = ORC_CLAMP_SB (var32 + var33);
454     /* 3: storeb */
455     ptr0[i] = var34;
456   }
457 
458 }
459 
460 void
audiomixer_orc_add_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int n)461 audiomixer_orc_add_s8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1,
462     int n)
463 {
464   OrcExecutor _ex, *ex = &_ex;
465   static volatile int p_inited = 0;
466   static OrcCode *c = 0;
467   void (*func) (OrcExecutor *);
468 
469   if (!p_inited) {
470     orc_once_mutex_lock ();
471     if (!p_inited) {
472       OrcProgram *p;
473 
474 #if 1
475       static const orc_uint8 bc[] = {
476         1, 9, 21, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
477         99, 95, 97, 100, 100, 95, 115, 56, 11, 1, 1, 12, 1, 1, 34, 0,
478         0, 4, 2, 0,
479       };
480       p = orc_program_new_from_static_bytecode (bc);
481       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_s8);
482 #else
483       p = orc_program_new ();
484       orc_program_set_name (p, "audiomixer_orc_add_s8");
485       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_s8);
486       orc_program_add_destination (p, 1, "d1");
487       orc_program_add_source (p, 1, "s1");
488 
489       orc_program_append_2 (p, "addssb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
490           ORC_VAR_D1);
491 #endif
492 
493       orc_program_compile (p);
494       c = orc_program_take_code (p);
495       orc_program_free (p);
496     }
497     p_inited = TRUE;
498     orc_once_mutex_unlock ();
499   }
500   ex->arrays[ORC_VAR_A2] = c;
501   ex->program = 0;
502 
503   ex->n = n;
504   ex->arrays[ORC_VAR_D1] = d1;
505   ex->arrays[ORC_VAR_S1] = (void *) s1;
506 
507   func = c->exec;
508   func (ex);
509 }
510 #endif
511 
512 
513 /* audiomixer_orc_add_u32 */
514 #ifdef DISABLE_ORC
515 void
audiomixer_orc_add_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int n)516 audiomixer_orc_add_u32 (guint32 * ORC_RESTRICT d1,
517     const guint32 * ORC_RESTRICT s1, int n)
518 {
519   int i;
520   orc_union32 *ORC_RESTRICT ptr0;
521   const orc_union32 *ORC_RESTRICT ptr4;
522   orc_union32 var32;
523   orc_union32 var33;
524   orc_union32 var34;
525 
526   ptr0 = (orc_union32 *) d1;
527   ptr4 = (orc_union32 *) s1;
528 
529 
530   for (i = 0; i < n; i++) {
531     /* 0: loadl */
532     var32 = ptr0[i];
533     /* 1: loadl */
534     var33 = ptr4[i];
535     /* 2: addusl */
536     var34.i =
537         ORC_CLAMP_UL ((orc_int64) (orc_uint32) var32.i +
538         (orc_int64) (orc_uint32) var33.i);
539     /* 3: storel */
540     ptr0[i] = var34;
541   }
542 
543 }
544 
545 #else
546 static void
_backup_audiomixer_orc_add_u32(OrcExecutor * ORC_RESTRICT ex)547 _backup_audiomixer_orc_add_u32 (OrcExecutor * ORC_RESTRICT ex)
548 {
549   int i;
550   int n = ex->n;
551   orc_union32 *ORC_RESTRICT ptr0;
552   const orc_union32 *ORC_RESTRICT ptr4;
553   orc_union32 var32;
554   orc_union32 var33;
555   orc_union32 var34;
556 
557   ptr0 = (orc_union32 *) ex->arrays[0];
558   ptr4 = (orc_union32 *) ex->arrays[4];
559 
560 
561   for (i = 0; i < n; i++) {
562     /* 0: loadl */
563     var32 = ptr0[i];
564     /* 1: loadl */
565     var33 = ptr4[i];
566     /* 2: addusl */
567     var34.i =
568         ORC_CLAMP_UL ((orc_int64) (orc_uint32) var32.i +
569         (orc_int64) (orc_uint32) var33.i);
570     /* 3: storel */
571     ptr0[i] = var34;
572   }
573 
574 }
575 
576 void
audiomixer_orc_add_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int n)577 audiomixer_orc_add_u32 (guint32 * ORC_RESTRICT d1,
578     const guint32 * ORC_RESTRICT s1, int n)
579 {
580   OrcExecutor _ex, *ex = &_ex;
581   static volatile int p_inited = 0;
582   static OrcCode *c = 0;
583   void (*func) (OrcExecutor *);
584 
585   if (!p_inited) {
586     orc_once_mutex_lock ();
587     if (!p_inited) {
588       OrcProgram *p;
589 
590 #if 1
591       static const orc_uint8 bc[] = {
592         1, 9, 22, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
593         99, 95, 97, 100, 100, 95, 117, 51, 50, 11, 4, 4, 12, 4, 4, 105,
594         0, 0, 4, 2, 0,
595       };
596       p = orc_program_new_from_static_bytecode (bc);
597       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_u32);
598 #else
599       p = orc_program_new ();
600       orc_program_set_name (p, "audiomixer_orc_add_u32");
601       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_u32);
602       orc_program_add_destination (p, 4, "d1");
603       orc_program_add_source (p, 4, "s1");
604 
605       orc_program_append_2 (p, "addusl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
606           ORC_VAR_D1);
607 #endif
608 
609       orc_program_compile (p);
610       c = orc_program_take_code (p);
611       orc_program_free (p);
612     }
613     p_inited = TRUE;
614     orc_once_mutex_unlock ();
615   }
616   ex->arrays[ORC_VAR_A2] = c;
617   ex->program = 0;
618 
619   ex->n = n;
620   ex->arrays[ORC_VAR_D1] = d1;
621   ex->arrays[ORC_VAR_S1] = (void *) s1;
622 
623   func = c->exec;
624   func (ex);
625 }
626 #endif
627 
628 
629 /* audiomixer_orc_add_u16 */
630 #ifdef DISABLE_ORC
631 void
audiomixer_orc_add_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int n)632 audiomixer_orc_add_u16 (guint16 * ORC_RESTRICT d1,
633     const guint16 * ORC_RESTRICT s1, int n)
634 {
635   int i;
636   orc_union16 *ORC_RESTRICT ptr0;
637   const orc_union16 *ORC_RESTRICT ptr4;
638   orc_union16 var32;
639   orc_union16 var33;
640   orc_union16 var34;
641 
642   ptr0 = (orc_union16 *) d1;
643   ptr4 = (orc_union16 *) s1;
644 
645 
646   for (i = 0; i < n; i++) {
647     /* 0: loadw */
648     var32 = ptr0[i];
649     /* 1: loadw */
650     var33 = ptr4[i];
651     /* 2: addusw */
652     var34.i = ORC_CLAMP_UW ((orc_uint16) var32.i + (orc_uint16) var33.i);
653     /* 3: storew */
654     ptr0[i] = var34;
655   }
656 
657 }
658 
659 #else
660 static void
_backup_audiomixer_orc_add_u16(OrcExecutor * ORC_RESTRICT ex)661 _backup_audiomixer_orc_add_u16 (OrcExecutor * ORC_RESTRICT ex)
662 {
663   int i;
664   int n = ex->n;
665   orc_union16 *ORC_RESTRICT ptr0;
666   const orc_union16 *ORC_RESTRICT ptr4;
667   orc_union16 var32;
668   orc_union16 var33;
669   orc_union16 var34;
670 
671   ptr0 = (orc_union16 *) ex->arrays[0];
672   ptr4 = (orc_union16 *) ex->arrays[4];
673 
674 
675   for (i = 0; i < n; i++) {
676     /* 0: loadw */
677     var32 = ptr0[i];
678     /* 1: loadw */
679     var33 = ptr4[i];
680     /* 2: addusw */
681     var34.i = ORC_CLAMP_UW ((orc_uint16) var32.i + (orc_uint16) var33.i);
682     /* 3: storew */
683     ptr0[i] = var34;
684   }
685 
686 }
687 
688 void
audiomixer_orc_add_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int n)689 audiomixer_orc_add_u16 (guint16 * ORC_RESTRICT d1,
690     const guint16 * ORC_RESTRICT s1, int n)
691 {
692   OrcExecutor _ex, *ex = &_ex;
693   static volatile int p_inited = 0;
694   static OrcCode *c = 0;
695   void (*func) (OrcExecutor *);
696 
697   if (!p_inited) {
698     orc_once_mutex_lock ();
699     if (!p_inited) {
700       OrcProgram *p;
701 
702 #if 1
703       static const orc_uint8 bc[] = {
704         1, 9, 22, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
705         99, 95, 97, 100, 100, 95, 117, 49, 54, 11, 2, 2, 12, 2, 2, 72,
706         0, 0, 4, 2, 0,
707       };
708       p = orc_program_new_from_static_bytecode (bc);
709       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_u16);
710 #else
711       p = orc_program_new ();
712       orc_program_set_name (p, "audiomixer_orc_add_u16");
713       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_u16);
714       orc_program_add_destination (p, 2, "d1");
715       orc_program_add_source (p, 2, "s1");
716 
717       orc_program_append_2 (p, "addusw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
718           ORC_VAR_D1);
719 #endif
720 
721       orc_program_compile (p);
722       c = orc_program_take_code (p);
723       orc_program_free (p);
724     }
725     p_inited = TRUE;
726     orc_once_mutex_unlock ();
727   }
728   ex->arrays[ORC_VAR_A2] = c;
729   ex->program = 0;
730 
731   ex->n = n;
732   ex->arrays[ORC_VAR_D1] = d1;
733   ex->arrays[ORC_VAR_S1] = (void *) s1;
734 
735   func = c->exec;
736   func (ex);
737 }
738 #endif
739 
740 
741 /* audiomixer_orc_add_u8 */
742 #ifdef DISABLE_ORC
743 void
audiomixer_orc_add_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int n)744 audiomixer_orc_add_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
745     int n)
746 {
747   int i;
748   orc_int8 *ORC_RESTRICT ptr0;
749   const orc_int8 *ORC_RESTRICT ptr4;
750   orc_int8 var32;
751   orc_int8 var33;
752   orc_int8 var34;
753 
754   ptr0 = (orc_int8 *) d1;
755   ptr4 = (orc_int8 *) s1;
756 
757 
758   for (i = 0; i < n; i++) {
759     /* 0: loadb */
760     var32 = ptr0[i];
761     /* 1: loadb */
762     var33 = ptr4[i];
763     /* 2: addusb */
764     var34 = ORC_CLAMP_UB ((orc_uint8) var32 + (orc_uint8) var33);
765     /* 3: storeb */
766     ptr0[i] = var34;
767   }
768 
769 }
770 
771 #else
772 static void
_backup_audiomixer_orc_add_u8(OrcExecutor * ORC_RESTRICT ex)773 _backup_audiomixer_orc_add_u8 (OrcExecutor * ORC_RESTRICT ex)
774 {
775   int i;
776   int n = ex->n;
777   orc_int8 *ORC_RESTRICT ptr0;
778   const orc_int8 *ORC_RESTRICT ptr4;
779   orc_int8 var32;
780   orc_int8 var33;
781   orc_int8 var34;
782 
783   ptr0 = (orc_int8 *) ex->arrays[0];
784   ptr4 = (orc_int8 *) ex->arrays[4];
785 
786 
787   for (i = 0; i < n; i++) {
788     /* 0: loadb */
789     var32 = ptr0[i];
790     /* 1: loadb */
791     var33 = ptr4[i];
792     /* 2: addusb */
793     var34 = ORC_CLAMP_UB ((orc_uint8) var32 + (orc_uint8) var33);
794     /* 3: storeb */
795     ptr0[i] = var34;
796   }
797 
798 }
799 
800 void
audiomixer_orc_add_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int n)801 audiomixer_orc_add_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
802     int n)
803 {
804   OrcExecutor _ex, *ex = &_ex;
805   static volatile int p_inited = 0;
806   static OrcCode *c = 0;
807   void (*func) (OrcExecutor *);
808 
809   if (!p_inited) {
810     orc_once_mutex_lock ();
811     if (!p_inited) {
812       OrcProgram *p;
813 
814 #if 1
815       static const orc_uint8 bc[] = {
816         1, 9, 21, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
817         99, 95, 97, 100, 100, 95, 117, 56, 11, 1, 1, 12, 1, 1, 35, 0,
818         0, 4, 2, 0,
819       };
820       p = orc_program_new_from_static_bytecode (bc);
821       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_u8);
822 #else
823       p = orc_program_new ();
824       orc_program_set_name (p, "audiomixer_orc_add_u8");
825       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_u8);
826       orc_program_add_destination (p, 1, "d1");
827       orc_program_add_source (p, 1, "s1");
828 
829       orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
830           ORC_VAR_D1);
831 #endif
832 
833       orc_program_compile (p);
834       c = orc_program_take_code (p);
835       orc_program_free (p);
836     }
837     p_inited = TRUE;
838     orc_once_mutex_unlock ();
839   }
840   ex->arrays[ORC_VAR_A2] = c;
841   ex->program = 0;
842 
843   ex->n = n;
844   ex->arrays[ORC_VAR_D1] = d1;
845   ex->arrays[ORC_VAR_S1] = (void *) s1;
846 
847   func = c->exec;
848   func (ex);
849 }
850 #endif
851 
852 
853 /* audiomixer_orc_add_f32 */
854 #ifdef DISABLE_ORC
855 void
audiomixer_orc_add_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,int n)856 audiomixer_orc_add_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1,
857     int n)
858 {
859   int i;
860   orc_union32 *ORC_RESTRICT ptr0;
861   const orc_union32 *ORC_RESTRICT ptr4;
862   orc_union32 var32;
863   orc_union32 var33;
864   orc_union32 var34;
865 
866   ptr0 = (orc_union32 *) d1;
867   ptr4 = (orc_union32 *) s1;
868 
869 
870   for (i = 0; i < n; i++) {
871     /* 0: loadl */
872     var32 = ptr0[i];
873     /* 1: loadl */
874     var33 = ptr4[i];
875     /* 2: addf */
876     {
877       orc_union32 _src1;
878       orc_union32 _src2;
879       orc_union32 _dest1;
880       _src1.i = ORC_DENORMAL (var32.i);
881       _src2.i = ORC_DENORMAL (var33.i);
882       _dest1.f = _src1.f + _src2.f;
883       var34.i = ORC_DENORMAL (_dest1.i);
884     }
885     /* 3: storel */
886     ptr0[i] = var34;
887   }
888 
889 }
890 
891 #else
892 static void
_backup_audiomixer_orc_add_f32(OrcExecutor * ORC_RESTRICT ex)893 _backup_audiomixer_orc_add_f32 (OrcExecutor * ORC_RESTRICT ex)
894 {
895   int i;
896   int n = ex->n;
897   orc_union32 *ORC_RESTRICT ptr0;
898   const orc_union32 *ORC_RESTRICT ptr4;
899   orc_union32 var32;
900   orc_union32 var33;
901   orc_union32 var34;
902 
903   ptr0 = (orc_union32 *) ex->arrays[0];
904   ptr4 = (orc_union32 *) ex->arrays[4];
905 
906 
907   for (i = 0; i < n; i++) {
908     /* 0: loadl */
909     var32 = ptr0[i];
910     /* 1: loadl */
911     var33 = ptr4[i];
912     /* 2: addf */
913     {
914       orc_union32 _src1;
915       orc_union32 _src2;
916       orc_union32 _dest1;
917       _src1.i = ORC_DENORMAL (var32.i);
918       _src2.i = ORC_DENORMAL (var33.i);
919       _dest1.f = _src1.f + _src2.f;
920       var34.i = ORC_DENORMAL (_dest1.i);
921     }
922     /* 3: storel */
923     ptr0[i] = var34;
924   }
925 
926 }
927 
928 void
audiomixer_orc_add_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,int n)929 audiomixer_orc_add_f32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1,
930     int n)
931 {
932   OrcExecutor _ex, *ex = &_ex;
933   static volatile int p_inited = 0;
934   static OrcCode *c = 0;
935   void (*func) (OrcExecutor *);
936 
937   if (!p_inited) {
938     orc_once_mutex_lock ();
939     if (!p_inited) {
940       OrcProgram *p;
941 
942 #if 1
943       static const orc_uint8 bc[] = {
944         1, 9, 22, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
945         99, 95, 97, 100, 100, 95, 102, 51, 50, 11, 4, 4, 12, 4, 4, 200,
946         0, 0, 4, 2, 0,
947       };
948       p = orc_program_new_from_static_bytecode (bc);
949       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_f32);
950 #else
951       p = orc_program_new ();
952       orc_program_set_name (p, "audiomixer_orc_add_f32");
953       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_f32);
954       orc_program_add_destination (p, 4, "d1");
955       orc_program_add_source (p, 4, "s1");
956 
957       orc_program_append_2 (p, "addf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
958           ORC_VAR_D1);
959 #endif
960 
961       orc_program_compile (p);
962       c = orc_program_take_code (p);
963       orc_program_free (p);
964     }
965     p_inited = TRUE;
966     orc_once_mutex_unlock ();
967   }
968   ex->arrays[ORC_VAR_A2] = c;
969   ex->program = 0;
970 
971   ex->n = n;
972   ex->arrays[ORC_VAR_D1] = d1;
973   ex->arrays[ORC_VAR_S1] = (void *) s1;
974 
975   func = c->exec;
976   func (ex);
977 }
978 #endif
979 
980 
981 /* audiomixer_orc_add_f64 */
982 #ifdef DISABLE_ORC
983 void
audiomixer_orc_add_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,int n)984 audiomixer_orc_add_f64 (double *ORC_RESTRICT d1, const double *ORC_RESTRICT s1,
985     int n)
986 {
987   int i;
988   orc_union64 *ORC_RESTRICT ptr0;
989   const orc_union64 *ORC_RESTRICT ptr4;
990   orc_union64 var32;
991   orc_union64 var33;
992   orc_union64 var34;
993 
994   ptr0 = (orc_union64 *) d1;
995   ptr4 = (orc_union64 *) s1;
996 
997 
998   for (i = 0; i < n; i++) {
999     /* 0: loadq */
1000     var32 = ptr0[i];
1001     /* 1: loadq */
1002     var33 = ptr4[i];
1003     /* 2: addd */
1004     {
1005       orc_union64 _src1;
1006       orc_union64 _src2;
1007       orc_union64 _dest1;
1008       _src1.i = ORC_DENORMAL_DOUBLE (var32.i);
1009       _src2.i = ORC_DENORMAL_DOUBLE (var33.i);
1010       _dest1.f = _src1.f + _src2.f;
1011       var34.i = ORC_DENORMAL_DOUBLE (_dest1.i);
1012     }
1013     /* 3: storeq */
1014     ptr0[i] = var34;
1015   }
1016 
1017 }
1018 
1019 #else
1020 static void
_backup_audiomixer_orc_add_f64(OrcExecutor * ORC_RESTRICT ex)1021 _backup_audiomixer_orc_add_f64 (OrcExecutor * ORC_RESTRICT ex)
1022 {
1023   int i;
1024   int n = ex->n;
1025   orc_union64 *ORC_RESTRICT ptr0;
1026   const orc_union64 *ORC_RESTRICT ptr4;
1027   orc_union64 var32;
1028   orc_union64 var33;
1029   orc_union64 var34;
1030 
1031   ptr0 = (orc_union64 *) ex->arrays[0];
1032   ptr4 = (orc_union64 *) ex->arrays[4];
1033 
1034 
1035   for (i = 0; i < n; i++) {
1036     /* 0: loadq */
1037     var32 = ptr0[i];
1038     /* 1: loadq */
1039     var33 = ptr4[i];
1040     /* 2: addd */
1041     {
1042       orc_union64 _src1;
1043       orc_union64 _src2;
1044       orc_union64 _dest1;
1045       _src1.i = ORC_DENORMAL_DOUBLE (var32.i);
1046       _src2.i = ORC_DENORMAL_DOUBLE (var33.i);
1047       _dest1.f = _src1.f + _src2.f;
1048       var34.i = ORC_DENORMAL_DOUBLE (_dest1.i);
1049     }
1050     /* 3: storeq */
1051     ptr0[i] = var34;
1052   }
1053 
1054 }
1055 
1056 void
audiomixer_orc_add_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,int n)1057 audiomixer_orc_add_f64 (double *ORC_RESTRICT d1, const double *ORC_RESTRICT s1,
1058     int n)
1059 {
1060   OrcExecutor _ex, *ex = &_ex;
1061   static volatile int p_inited = 0;
1062   static OrcCode *c = 0;
1063   void (*func) (OrcExecutor *);
1064 
1065   if (!p_inited) {
1066     orc_once_mutex_lock ();
1067     if (!p_inited) {
1068       OrcProgram *p;
1069 
1070 #if 1
1071       static const orc_uint8 bc[] = {
1072         1, 9, 22, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
1073         99, 95, 97, 100, 100, 95, 102, 54, 52, 11, 8, 8, 12, 8, 8, 212,
1074         0, 0, 4, 2, 0,
1075       };
1076       p = orc_program_new_from_static_bytecode (bc);
1077       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_f64);
1078 #else
1079       p = orc_program_new ();
1080       orc_program_set_name (p, "audiomixer_orc_add_f64");
1081       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_f64);
1082       orc_program_add_destination (p, 8, "d1");
1083       orc_program_add_source (p, 8, "s1");
1084 
1085       orc_program_append_2 (p, "addd", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
1086           ORC_VAR_D1);
1087 #endif
1088 
1089       orc_program_compile (p);
1090       c = orc_program_take_code (p);
1091       orc_program_free (p);
1092     }
1093     p_inited = TRUE;
1094     orc_once_mutex_unlock ();
1095   }
1096   ex->arrays[ORC_VAR_A2] = c;
1097   ex->program = 0;
1098 
1099   ex->n = n;
1100   ex->arrays[ORC_VAR_D1] = d1;
1101   ex->arrays[ORC_VAR_S1] = (void *) s1;
1102 
1103   func = c->exec;
1104   func (ex);
1105 }
1106 #endif
1107 
1108 
1109 /* audiomixer_orc_volume_u8 */
1110 #ifdef DISABLE_ORC
1111 void
audiomixer_orc_volume_u8(guint8 * ORC_RESTRICT d1,int p1,int n)1112 audiomixer_orc_volume_u8 (guint8 * ORC_RESTRICT d1, int p1, int n)
1113 {
1114   int i;
1115   orc_int8 *ORC_RESTRICT ptr0;
1116   orc_int8 var34;
1117 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1118   volatile orc_int8 var35;
1119 #else
1120   orc_int8 var35;
1121 #endif
1122   orc_int8 var36;
1123   orc_int8 var37;
1124   orc_int8 var38;
1125   orc_union16 var39;
1126   orc_union16 var40;
1127   orc_int8 var41;
1128 
1129   ptr0 = (orc_int8 *) d1;
1130 
1131   /* 1: loadpb */
1132   var35 = 0x00000080;           /* 128 or 6.32404e-322f */
1133   /* 3: loadpb */
1134   var36 = p1;
1135 
1136   for (i = 0; i < n; i++) {
1137     /* 0: loadb */
1138     var34 = ptr0[i];
1139     /* 2: xorb */
1140     var38 = var34 ^ var35;
1141     /* 4: mulsbw */
1142     var39.i = var38 * var36;
1143     /* 5: shrsw */
1144     var40.i = var39.i >> 3;
1145     /* 6: convssswb */
1146     var41 = ORC_CLAMP_SB (var40.i);
1147     /* 7: xorb */
1148     var37 = var41 ^ var35;
1149     /* 8: storeb */
1150     ptr0[i] = var37;
1151   }
1152 
1153 }
1154 
1155 #else
1156 static void
_backup_audiomixer_orc_volume_u8(OrcExecutor * ORC_RESTRICT ex)1157 _backup_audiomixer_orc_volume_u8 (OrcExecutor * ORC_RESTRICT ex)
1158 {
1159   int i;
1160   int n = ex->n;
1161   orc_int8 *ORC_RESTRICT ptr0;
1162   orc_int8 var34;
1163 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1164   volatile orc_int8 var35;
1165 #else
1166   orc_int8 var35;
1167 #endif
1168   orc_int8 var36;
1169   orc_int8 var37;
1170   orc_int8 var38;
1171   orc_union16 var39;
1172   orc_union16 var40;
1173   orc_int8 var41;
1174 
1175   ptr0 = (orc_int8 *) ex->arrays[0];
1176 
1177   /* 1: loadpb */
1178   var35 = 0x00000080;           /* 128 or 6.32404e-322f */
1179   /* 3: loadpb */
1180   var36 = ex->params[24];
1181 
1182   for (i = 0; i < n; i++) {
1183     /* 0: loadb */
1184     var34 = ptr0[i];
1185     /* 2: xorb */
1186     var38 = var34 ^ var35;
1187     /* 4: mulsbw */
1188     var39.i = var38 * var36;
1189     /* 5: shrsw */
1190     var40.i = var39.i >> 3;
1191     /* 6: convssswb */
1192     var41 = ORC_CLAMP_SB (var40.i);
1193     /* 7: xorb */
1194     var37 = var41 ^ var35;
1195     /* 8: storeb */
1196     ptr0[i] = var37;
1197   }
1198 
1199 }
1200 
1201 void
audiomixer_orc_volume_u8(guint8 * ORC_RESTRICT d1,int p1,int n)1202 audiomixer_orc_volume_u8 (guint8 * ORC_RESTRICT d1, int p1, int n)
1203 {
1204   OrcExecutor _ex, *ex = &_ex;
1205   static volatile int p_inited = 0;
1206   static OrcCode *c = 0;
1207   void (*func) (OrcExecutor *);
1208 
1209   if (!p_inited) {
1210     orc_once_mutex_lock ();
1211     if (!p_inited) {
1212       OrcProgram *p;
1213 
1214 #if 1
1215       static const orc_uint8 bc[] = {
1216         1, 9, 24, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
1217         99, 95, 118, 111, 108, 117, 109, 101, 95, 117, 56, 11, 1, 1, 14, 1,
1218         128, 0, 0, 0, 14, 2, 3, 0, 0, 0, 16, 1, 20, 2, 20, 1,
1219         68, 33, 0, 16, 174, 32, 33, 24, 94, 32, 32, 17, 159, 33, 32, 68,
1220         0, 33, 16, 2, 0,
1221       };
1222       p = orc_program_new_from_static_bytecode (bc);
1223       orc_program_set_backup_function (p, _backup_audiomixer_orc_volume_u8);
1224 #else
1225       p = orc_program_new ();
1226       orc_program_set_name (p, "audiomixer_orc_volume_u8");
1227       orc_program_set_backup_function (p, _backup_audiomixer_orc_volume_u8);
1228       orc_program_add_destination (p, 1, "d1");
1229       orc_program_add_constant (p, 1, 0x00000080, "c1");
1230       orc_program_add_constant (p, 2, 0x00000003, "c2");
1231       orc_program_add_parameter (p, 1, "p1");
1232       orc_program_add_temporary (p, 2, "t1");
1233       orc_program_add_temporary (p, 1, "t2");
1234 
1235       orc_program_append_2 (p, "xorb", 0, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_C1,
1236           ORC_VAR_D1);
1237       orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
1238           ORC_VAR_D1);
1239       orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
1240           ORC_VAR_D1);
1241       orc_program_append_2 (p, "convssswb", 0, ORC_VAR_T2, ORC_VAR_T1,
1242           ORC_VAR_D1, ORC_VAR_D1);
1243       orc_program_append_2 (p, "xorb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_C1,
1244           ORC_VAR_D1);
1245 #endif
1246 
1247       orc_program_compile (p);
1248       c = orc_program_take_code (p);
1249       orc_program_free (p);
1250     }
1251     p_inited = TRUE;
1252     orc_once_mutex_unlock ();
1253   }
1254   ex->arrays[ORC_VAR_A2] = c;
1255   ex->program = 0;
1256 
1257   ex->n = n;
1258   ex->arrays[ORC_VAR_D1] = d1;
1259   ex->params[ORC_VAR_P1] = p1;
1260 
1261   func = c->exec;
1262   func (ex);
1263 }
1264 #endif
1265 
1266 
1267 /* audiomixer_orc_add_volume_u8 */
1268 #ifdef DISABLE_ORC
1269 void
audiomixer_orc_add_volume_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int p1,int n)1270 audiomixer_orc_add_volume_u8 (guint8 * ORC_RESTRICT d1,
1271     const guint8 * ORC_RESTRICT s1, int p1, int n)
1272 {
1273   int i;
1274   orc_int8 *ORC_RESTRICT ptr0;
1275   const orc_int8 *ORC_RESTRICT ptr4;
1276   orc_int8 var34;
1277 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1278   volatile orc_int8 var35;
1279 #else
1280   orc_int8 var35;
1281 #endif
1282   orc_int8 var36;
1283   orc_int8 var37;
1284   orc_int8 var38;
1285   orc_int8 var39;
1286   orc_union16 var40;
1287   orc_union16 var41;
1288   orc_int8 var42;
1289   orc_int8 var43;
1290 
1291   ptr0 = (orc_int8 *) d1;
1292   ptr4 = (orc_int8 *) s1;
1293 
1294   /* 1: loadpb */
1295   var35 = 0x00000080;           /* 128 or 6.32404e-322f */
1296   /* 3: loadpb */
1297   var36 = p1;
1298 
1299   for (i = 0; i < n; i++) {
1300     /* 0: loadb */
1301     var34 = ptr4[i];
1302     /* 2: xorb */
1303     var39 = var34 ^ var35;
1304     /* 4: mulsbw */
1305     var40.i = var39 * var36;
1306     /* 5: shrsw */
1307     var41.i = var40.i >> 3;
1308     /* 6: convssswb */
1309     var42 = ORC_CLAMP_SB (var41.i);
1310     /* 7: xorb */
1311     var43 = var42 ^ var35;
1312     /* 8: loadb */
1313     var37 = ptr0[i];
1314     /* 9: addusb */
1315     var38 = ORC_CLAMP_UB ((orc_uint8) var37 + (orc_uint8) var43);
1316     /* 10: storeb */
1317     ptr0[i] = var38;
1318   }
1319 
1320 }
1321 
1322 #else
1323 static void
_backup_audiomixer_orc_add_volume_u8(OrcExecutor * ORC_RESTRICT ex)1324 _backup_audiomixer_orc_add_volume_u8 (OrcExecutor * ORC_RESTRICT ex)
1325 {
1326   int i;
1327   int n = ex->n;
1328   orc_int8 *ORC_RESTRICT ptr0;
1329   const orc_int8 *ORC_RESTRICT ptr4;
1330   orc_int8 var34;
1331 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1332   volatile orc_int8 var35;
1333 #else
1334   orc_int8 var35;
1335 #endif
1336   orc_int8 var36;
1337   orc_int8 var37;
1338   orc_int8 var38;
1339   orc_int8 var39;
1340   orc_union16 var40;
1341   orc_union16 var41;
1342   orc_int8 var42;
1343   orc_int8 var43;
1344 
1345   ptr0 = (orc_int8 *) ex->arrays[0];
1346   ptr4 = (orc_int8 *) ex->arrays[4];
1347 
1348   /* 1: loadpb */
1349   var35 = 0x00000080;           /* 128 or 6.32404e-322f */
1350   /* 3: loadpb */
1351   var36 = ex->params[24];
1352 
1353   for (i = 0; i < n; i++) {
1354     /* 0: loadb */
1355     var34 = ptr4[i];
1356     /* 2: xorb */
1357     var39 = var34 ^ var35;
1358     /* 4: mulsbw */
1359     var40.i = var39 * var36;
1360     /* 5: shrsw */
1361     var41.i = var40.i >> 3;
1362     /* 6: convssswb */
1363     var42 = ORC_CLAMP_SB (var41.i);
1364     /* 7: xorb */
1365     var43 = var42 ^ var35;
1366     /* 8: loadb */
1367     var37 = ptr0[i];
1368     /* 9: addusb */
1369     var38 = ORC_CLAMP_UB ((orc_uint8) var37 + (orc_uint8) var43);
1370     /* 10: storeb */
1371     ptr0[i] = var38;
1372   }
1373 
1374 }
1375 
1376 void
audiomixer_orc_add_volume_u8(guint8 * ORC_RESTRICT d1,const guint8 * ORC_RESTRICT s1,int p1,int n)1377 audiomixer_orc_add_volume_u8 (guint8 * ORC_RESTRICT d1,
1378     const guint8 * ORC_RESTRICT s1, int p1, int n)
1379 {
1380   OrcExecutor _ex, *ex = &_ex;
1381   static volatile int p_inited = 0;
1382   static OrcCode *c = 0;
1383   void (*func) (OrcExecutor *);
1384 
1385   if (!p_inited) {
1386     orc_once_mutex_lock ();
1387     if (!p_inited) {
1388       OrcProgram *p;
1389 
1390 #if 1
1391       static const orc_uint8 bc[] = {
1392         1, 9, 28, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
1393         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 117, 56, 11,
1394         1, 1, 12, 1, 1, 14, 1, 128, 0, 0, 0, 14, 2, 3, 0, 0,
1395         0, 16, 1, 20, 2, 20, 1, 68, 33, 4, 16, 174, 32, 33, 24, 94,
1396         32, 32, 17, 159, 33, 32, 68, 33, 33, 16, 35, 0, 0, 33, 2, 0,
1397 
1398       };
1399       p = orc_program_new_from_static_bytecode (bc);
1400       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_volume_u8);
1401 #else
1402       p = orc_program_new ();
1403       orc_program_set_name (p, "audiomixer_orc_add_volume_u8");
1404       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_volume_u8);
1405       orc_program_add_destination (p, 1, "d1");
1406       orc_program_add_source (p, 1, "s1");
1407       orc_program_add_constant (p, 1, 0x00000080, "c1");
1408       orc_program_add_constant (p, 2, 0x00000003, "c2");
1409       orc_program_add_parameter (p, 1, "p1");
1410       orc_program_add_temporary (p, 2, "t1");
1411       orc_program_add_temporary (p, 1, "t2");
1412 
1413       orc_program_append_2 (p, "xorb", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C1,
1414           ORC_VAR_D1);
1415       orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
1416           ORC_VAR_D1);
1417       orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
1418           ORC_VAR_D1);
1419       orc_program_append_2 (p, "convssswb", 0, ORC_VAR_T2, ORC_VAR_T1,
1420           ORC_VAR_D1, ORC_VAR_D1);
1421       orc_program_append_2 (p, "xorb", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
1422           ORC_VAR_D1);
1423       orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
1424           ORC_VAR_D1);
1425 #endif
1426 
1427       orc_program_compile (p);
1428       c = orc_program_take_code (p);
1429       orc_program_free (p);
1430     }
1431     p_inited = TRUE;
1432     orc_once_mutex_unlock ();
1433   }
1434   ex->arrays[ORC_VAR_A2] = c;
1435   ex->program = 0;
1436 
1437   ex->n = n;
1438   ex->arrays[ORC_VAR_D1] = d1;
1439   ex->arrays[ORC_VAR_S1] = (void *) s1;
1440   ex->params[ORC_VAR_P1] = p1;
1441 
1442   func = c->exec;
1443   func (ex);
1444 }
1445 #endif
1446 
1447 
1448 /* audiomixer_orc_add_volume_s8 */
1449 #ifdef DISABLE_ORC
1450 void
audiomixer_orc_add_volume_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int p1,int n)1451 audiomixer_orc_add_volume_s8 (gint8 * ORC_RESTRICT d1,
1452     const gint8 * ORC_RESTRICT s1, int p1, int n)
1453 {
1454   int i;
1455   orc_int8 *ORC_RESTRICT ptr0;
1456   const orc_int8 *ORC_RESTRICT ptr4;
1457   orc_int8 var34;
1458   orc_int8 var35;
1459   orc_int8 var36;
1460   orc_int8 var37;
1461   orc_union16 var38;
1462   orc_union16 var39;
1463   orc_int8 var40;
1464 
1465   ptr0 = (orc_int8 *) d1;
1466   ptr4 = (orc_int8 *) s1;
1467 
1468   /* 1: loadpb */
1469   var35 = p1;
1470 
1471   for (i = 0; i < n; i++) {
1472     /* 0: loadb */
1473     var34 = ptr4[i];
1474     /* 2: mulsbw */
1475     var38.i = var34 * var35;
1476     /* 3: shrsw */
1477     var39.i = var38.i >> 3;
1478     /* 4: convssswb */
1479     var40 = ORC_CLAMP_SB (var39.i);
1480     /* 5: loadb */
1481     var36 = ptr0[i];
1482     /* 6: addssb */
1483     var37 = ORC_CLAMP_SB (var36 + var40);
1484     /* 7: storeb */
1485     ptr0[i] = var37;
1486   }
1487 
1488 }
1489 
1490 #else
1491 static void
_backup_audiomixer_orc_add_volume_s8(OrcExecutor * ORC_RESTRICT ex)1492 _backup_audiomixer_orc_add_volume_s8 (OrcExecutor * ORC_RESTRICT ex)
1493 {
1494   int i;
1495   int n = ex->n;
1496   orc_int8 *ORC_RESTRICT ptr0;
1497   const orc_int8 *ORC_RESTRICT ptr4;
1498   orc_int8 var34;
1499   orc_int8 var35;
1500   orc_int8 var36;
1501   orc_int8 var37;
1502   orc_union16 var38;
1503   orc_union16 var39;
1504   orc_int8 var40;
1505 
1506   ptr0 = (orc_int8 *) ex->arrays[0];
1507   ptr4 = (orc_int8 *) ex->arrays[4];
1508 
1509   /* 1: loadpb */
1510   var35 = ex->params[24];
1511 
1512   for (i = 0; i < n; i++) {
1513     /* 0: loadb */
1514     var34 = ptr4[i];
1515     /* 2: mulsbw */
1516     var38.i = var34 * var35;
1517     /* 3: shrsw */
1518     var39.i = var38.i >> 3;
1519     /* 4: convssswb */
1520     var40 = ORC_CLAMP_SB (var39.i);
1521     /* 5: loadb */
1522     var36 = ptr0[i];
1523     /* 6: addssb */
1524     var37 = ORC_CLAMP_SB (var36 + var40);
1525     /* 7: storeb */
1526     ptr0[i] = var37;
1527   }
1528 
1529 }
1530 
1531 void
audiomixer_orc_add_volume_s8(gint8 * ORC_RESTRICT d1,const gint8 * ORC_RESTRICT s1,int p1,int n)1532 audiomixer_orc_add_volume_s8 (gint8 * ORC_RESTRICT d1,
1533     const gint8 * ORC_RESTRICT s1, int p1, int n)
1534 {
1535   OrcExecutor _ex, *ex = &_ex;
1536   static volatile int p_inited = 0;
1537   static OrcCode *c = 0;
1538   void (*func) (OrcExecutor *);
1539 
1540   if (!p_inited) {
1541     orc_once_mutex_lock ();
1542     if (!p_inited) {
1543       OrcProgram *p;
1544 
1545 #if 1
1546       static const orc_uint8 bc[] = {
1547         1, 9, 28, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
1548         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 115, 56, 11,
1549         1, 1, 12, 1, 1, 14, 2, 3, 0, 0, 0, 16, 1, 20, 2, 20,
1550         1, 174, 32, 4, 24, 94, 32, 32, 16, 159, 33, 32, 34, 0, 0, 33,
1551         2, 0,
1552       };
1553       p = orc_program_new_from_static_bytecode (bc);
1554       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_volume_s8);
1555 #else
1556       p = orc_program_new ();
1557       orc_program_set_name (p, "audiomixer_orc_add_volume_s8");
1558       orc_program_set_backup_function (p, _backup_audiomixer_orc_add_volume_s8);
1559       orc_program_add_destination (p, 1, "d1");
1560       orc_program_add_source (p, 1, "s1");
1561       orc_program_add_constant (p, 2, 0x00000003, "c1");
1562       orc_program_add_parameter (p, 1, "p1");
1563       orc_program_add_temporary (p, 2, "t1");
1564       orc_program_add_temporary (p, 1, "t2");
1565 
1566       orc_program_append_2 (p, "mulsbw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
1567           ORC_VAR_D1);
1568       orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
1569           ORC_VAR_D1);
1570       orc_program_append_2 (p, "convssswb", 0, ORC_VAR_T2, ORC_VAR_T1,
1571           ORC_VAR_D1, ORC_VAR_D1);
1572       orc_program_append_2 (p, "addssb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
1573           ORC_VAR_D1);
1574 #endif
1575 
1576       orc_program_compile (p);
1577       c = orc_program_take_code (p);
1578       orc_program_free (p);
1579     }
1580     p_inited = TRUE;
1581     orc_once_mutex_unlock ();
1582   }
1583   ex->arrays[ORC_VAR_A2] = c;
1584   ex->program = 0;
1585 
1586   ex->n = n;
1587   ex->arrays[ORC_VAR_D1] = d1;
1588   ex->arrays[ORC_VAR_S1] = (void *) s1;
1589   ex->params[ORC_VAR_P1] = p1;
1590 
1591   func = c->exec;
1592   func (ex);
1593 }
1594 #endif
1595 
1596 
1597 /* audiomixer_orc_add_volume_u16 */
1598 #ifdef DISABLE_ORC
1599 void
audiomixer_orc_add_volume_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int p1,int n)1600 audiomixer_orc_add_volume_u16 (guint16 * ORC_RESTRICT d1,
1601     const guint16 * ORC_RESTRICT s1, int p1, int n)
1602 {
1603   int i;
1604   orc_union16 *ORC_RESTRICT ptr0;
1605   const orc_union16 *ORC_RESTRICT ptr4;
1606   orc_union16 var34;
1607 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1608   volatile orc_union16 var35;
1609 #else
1610   orc_union16 var35;
1611 #endif
1612   orc_union16 var36;
1613   orc_union16 var37;
1614   orc_union16 var38;
1615   orc_union16 var39;
1616   orc_union32 var40;
1617   orc_union32 var41;
1618   orc_union16 var42;
1619   orc_union16 var43;
1620 
1621   ptr0 = (orc_union16 *) d1;
1622   ptr4 = (orc_union16 *) s1;
1623 
1624   /* 1: loadpw */
1625   var35.i = 0x00008000;         /* 32768 or 1.61895e-319f */
1626   /* 3: loadpw */
1627   var36.i = p1;
1628 
1629   for (i = 0; i < n; i++) {
1630     /* 0: loadw */
1631     var34 = ptr4[i];
1632     /* 2: xorw */
1633     var39.i = var34.i ^ var35.i;
1634     /* 4: mulswl */
1635     var40.i = var39.i * var36.i;
1636     /* 5: shrsl */
1637     var41.i = var40.i >> 11;
1638     /* 6: convssslw */
1639     var42.i = ORC_CLAMP_SW (var41.i);
1640     /* 7: xorw */
1641     var43.i = var42.i ^ var35.i;
1642     /* 8: loadw */
1643     var37 = ptr0[i];
1644     /* 9: addusw */
1645     var38.i = ORC_CLAMP_UW ((orc_uint16) var37.i + (orc_uint16) var43.i);
1646     /* 10: storew */
1647     ptr0[i] = var38;
1648   }
1649 
1650 }
1651 
1652 #else
1653 static void
_backup_audiomixer_orc_add_volume_u16(OrcExecutor * ORC_RESTRICT ex)1654 _backup_audiomixer_orc_add_volume_u16 (OrcExecutor * ORC_RESTRICT ex)
1655 {
1656   int i;
1657   int n = ex->n;
1658   orc_union16 *ORC_RESTRICT ptr0;
1659   const orc_union16 *ORC_RESTRICT ptr4;
1660   orc_union16 var34;
1661 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1662   volatile orc_union16 var35;
1663 #else
1664   orc_union16 var35;
1665 #endif
1666   orc_union16 var36;
1667   orc_union16 var37;
1668   orc_union16 var38;
1669   orc_union16 var39;
1670   orc_union32 var40;
1671   orc_union32 var41;
1672   orc_union16 var42;
1673   orc_union16 var43;
1674 
1675   ptr0 = (orc_union16 *) ex->arrays[0];
1676   ptr4 = (orc_union16 *) ex->arrays[4];
1677 
1678   /* 1: loadpw */
1679   var35.i = 0x00008000;         /* 32768 or 1.61895e-319f */
1680   /* 3: loadpw */
1681   var36.i = ex->params[24];
1682 
1683   for (i = 0; i < n; i++) {
1684     /* 0: loadw */
1685     var34 = ptr4[i];
1686     /* 2: xorw */
1687     var39.i = var34.i ^ var35.i;
1688     /* 4: mulswl */
1689     var40.i = var39.i * var36.i;
1690     /* 5: shrsl */
1691     var41.i = var40.i >> 11;
1692     /* 6: convssslw */
1693     var42.i = ORC_CLAMP_SW (var41.i);
1694     /* 7: xorw */
1695     var43.i = var42.i ^ var35.i;
1696     /* 8: loadw */
1697     var37 = ptr0[i];
1698     /* 9: addusw */
1699     var38.i = ORC_CLAMP_UW ((orc_uint16) var37.i + (orc_uint16) var43.i);
1700     /* 10: storew */
1701     ptr0[i] = var38;
1702   }
1703 
1704 }
1705 
1706 void
audiomixer_orc_add_volume_u16(guint16 * ORC_RESTRICT d1,const guint16 * ORC_RESTRICT s1,int p1,int n)1707 audiomixer_orc_add_volume_u16 (guint16 * ORC_RESTRICT d1,
1708     const guint16 * ORC_RESTRICT s1, int p1, int n)
1709 {
1710   OrcExecutor _ex, *ex = &_ex;
1711   static volatile int p_inited = 0;
1712   static OrcCode *c = 0;
1713   void (*func) (OrcExecutor *);
1714 
1715   if (!p_inited) {
1716     orc_once_mutex_lock ();
1717     if (!p_inited) {
1718       OrcProgram *p;
1719 
1720 #if 1
1721       static const orc_uint8 bc[] = {
1722         1, 9, 29, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
1723         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 117, 49, 54,
1724         11, 2, 2, 12, 2, 2, 14, 2, 0, 128, 0, 0, 14, 4, 11, 0,
1725         0, 0, 16, 2, 20, 4, 20, 2, 101, 33, 4, 16, 176, 32, 33, 24,
1726         125, 32, 32, 17, 165, 33, 32, 101, 33, 33, 16, 72, 0, 0, 33, 2,
1727         0,
1728       };
1729       p = orc_program_new_from_static_bytecode (bc);
1730       orc_program_set_backup_function (p,
1731           _backup_audiomixer_orc_add_volume_u16);
1732 #else
1733       p = orc_program_new ();
1734       orc_program_set_name (p, "audiomixer_orc_add_volume_u16");
1735       orc_program_set_backup_function (p,
1736           _backup_audiomixer_orc_add_volume_u16);
1737       orc_program_add_destination (p, 2, "d1");
1738       orc_program_add_source (p, 2, "s1");
1739       orc_program_add_constant (p, 2, 0x00008000, "c1");
1740       orc_program_add_constant (p, 4, 0x0000000b, "c2");
1741       orc_program_add_parameter (p, 2, "p1");
1742       orc_program_add_temporary (p, 4, "t1");
1743       orc_program_add_temporary (p, 2, "t2");
1744 
1745       orc_program_append_2 (p, "xorw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C1,
1746           ORC_VAR_D1);
1747       orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
1748           ORC_VAR_D1);
1749       orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
1750           ORC_VAR_D1);
1751       orc_program_append_2 (p, "convssslw", 0, ORC_VAR_T2, ORC_VAR_T1,
1752           ORC_VAR_D1, ORC_VAR_D1);
1753       orc_program_append_2 (p, "xorw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
1754           ORC_VAR_D1);
1755       orc_program_append_2 (p, "addusw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
1756           ORC_VAR_D1);
1757 #endif
1758 
1759       orc_program_compile (p);
1760       c = orc_program_take_code (p);
1761       orc_program_free (p);
1762     }
1763     p_inited = TRUE;
1764     orc_once_mutex_unlock ();
1765   }
1766   ex->arrays[ORC_VAR_A2] = c;
1767   ex->program = 0;
1768 
1769   ex->n = n;
1770   ex->arrays[ORC_VAR_D1] = d1;
1771   ex->arrays[ORC_VAR_S1] = (void *) s1;
1772   ex->params[ORC_VAR_P1] = p1;
1773 
1774   func = c->exec;
1775   func (ex);
1776 }
1777 #endif
1778 
1779 
1780 /* audiomixer_orc_add_volume_s16 */
1781 #ifdef DISABLE_ORC
1782 void
audiomixer_orc_add_volume_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int p1,int n)1783 audiomixer_orc_add_volume_s16 (gint16 * ORC_RESTRICT d1,
1784     const gint16 * ORC_RESTRICT s1, int p1, int n)
1785 {
1786   int i;
1787   orc_union16 *ORC_RESTRICT ptr0;
1788   const orc_union16 *ORC_RESTRICT ptr4;
1789   orc_union16 var34;
1790   orc_union16 var35;
1791   orc_union16 var36;
1792   orc_union16 var37;
1793   orc_union32 var38;
1794   orc_union32 var39;
1795   orc_union16 var40;
1796 
1797   ptr0 = (orc_union16 *) d1;
1798   ptr4 = (orc_union16 *) s1;
1799 
1800   /* 1: loadpw */
1801   var35.i = p1;
1802 
1803   for (i = 0; i < n; i++) {
1804     /* 0: loadw */
1805     var34 = ptr4[i];
1806     /* 2: mulswl */
1807     var38.i = var34.i * var35.i;
1808     /* 3: shrsl */
1809     var39.i = var38.i >> 11;
1810     /* 4: convssslw */
1811     var40.i = ORC_CLAMP_SW (var39.i);
1812     /* 5: loadw */
1813     var36 = ptr0[i];
1814     /* 6: addssw */
1815     var37.i = ORC_CLAMP_SW (var36.i + var40.i);
1816     /* 7: storew */
1817     ptr0[i] = var37;
1818   }
1819 
1820 }
1821 
1822 #else
1823 static void
_backup_audiomixer_orc_add_volume_s16(OrcExecutor * ORC_RESTRICT ex)1824 _backup_audiomixer_orc_add_volume_s16 (OrcExecutor * ORC_RESTRICT ex)
1825 {
1826   int i;
1827   int n = ex->n;
1828   orc_union16 *ORC_RESTRICT ptr0;
1829   const orc_union16 *ORC_RESTRICT ptr4;
1830   orc_union16 var34;
1831   orc_union16 var35;
1832   orc_union16 var36;
1833   orc_union16 var37;
1834   orc_union32 var38;
1835   orc_union32 var39;
1836   orc_union16 var40;
1837 
1838   ptr0 = (orc_union16 *) ex->arrays[0];
1839   ptr4 = (orc_union16 *) ex->arrays[4];
1840 
1841   /* 1: loadpw */
1842   var35.i = ex->params[24];
1843 
1844   for (i = 0; i < n; i++) {
1845     /* 0: loadw */
1846     var34 = ptr4[i];
1847     /* 2: mulswl */
1848     var38.i = var34.i * var35.i;
1849     /* 3: shrsl */
1850     var39.i = var38.i >> 11;
1851     /* 4: convssslw */
1852     var40.i = ORC_CLAMP_SW (var39.i);
1853     /* 5: loadw */
1854     var36 = ptr0[i];
1855     /* 6: addssw */
1856     var37.i = ORC_CLAMP_SW (var36.i + var40.i);
1857     /* 7: storew */
1858     ptr0[i] = var37;
1859   }
1860 
1861 }
1862 
1863 void
audiomixer_orc_add_volume_s16(gint16 * ORC_RESTRICT d1,const gint16 * ORC_RESTRICT s1,int p1,int n)1864 audiomixer_orc_add_volume_s16 (gint16 * ORC_RESTRICT d1,
1865     const gint16 * ORC_RESTRICT s1, int p1, int n)
1866 {
1867   OrcExecutor _ex, *ex = &_ex;
1868   static volatile int p_inited = 0;
1869   static OrcCode *c = 0;
1870   void (*func) (OrcExecutor *);
1871 
1872   if (!p_inited) {
1873     orc_once_mutex_lock ();
1874     if (!p_inited) {
1875       OrcProgram *p;
1876 
1877 #if 1
1878       static const orc_uint8 bc[] = {
1879         1, 9, 29, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
1880         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 115, 49, 54,
1881         11, 2, 2, 12, 2, 2, 14, 4, 11, 0, 0, 0, 16, 2, 20, 4,
1882         20, 2, 176, 32, 4, 24, 125, 32, 32, 16, 165, 33, 32, 71, 0, 0,
1883         33, 2, 0,
1884       };
1885       p = orc_program_new_from_static_bytecode (bc);
1886       orc_program_set_backup_function (p,
1887           _backup_audiomixer_orc_add_volume_s16);
1888 #else
1889       p = orc_program_new ();
1890       orc_program_set_name (p, "audiomixer_orc_add_volume_s16");
1891       orc_program_set_backup_function (p,
1892           _backup_audiomixer_orc_add_volume_s16);
1893       orc_program_add_destination (p, 2, "d1");
1894       orc_program_add_source (p, 2, "s1");
1895       orc_program_add_constant (p, 4, 0x0000000b, "c1");
1896       orc_program_add_parameter (p, 2, "p1");
1897       orc_program_add_temporary (p, 4, "t1");
1898       orc_program_add_temporary (p, 2, "t2");
1899 
1900       orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
1901           ORC_VAR_D1);
1902       orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
1903           ORC_VAR_D1);
1904       orc_program_append_2 (p, "convssslw", 0, ORC_VAR_T2, ORC_VAR_T1,
1905           ORC_VAR_D1, ORC_VAR_D1);
1906       orc_program_append_2 (p, "addssw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
1907           ORC_VAR_D1);
1908 #endif
1909 
1910       orc_program_compile (p);
1911       c = orc_program_take_code (p);
1912       orc_program_free (p);
1913     }
1914     p_inited = TRUE;
1915     orc_once_mutex_unlock ();
1916   }
1917   ex->arrays[ORC_VAR_A2] = c;
1918   ex->program = 0;
1919 
1920   ex->n = n;
1921   ex->arrays[ORC_VAR_D1] = d1;
1922   ex->arrays[ORC_VAR_S1] = (void *) s1;
1923   ex->params[ORC_VAR_P1] = p1;
1924 
1925   func = c->exec;
1926   func (ex);
1927 }
1928 #endif
1929 
1930 
1931 /* audiomixer_orc_add_volume_u32 */
1932 #ifdef DISABLE_ORC
1933 void
audiomixer_orc_add_volume_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int p1,int n)1934 audiomixer_orc_add_volume_u32 (guint32 * ORC_RESTRICT d1,
1935     const guint32 * ORC_RESTRICT s1, int p1, int n)
1936 {
1937   int i;
1938   orc_union32 *ORC_RESTRICT ptr0;
1939   const orc_union32 *ORC_RESTRICT ptr4;
1940   orc_union32 var34;
1941 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1942   volatile orc_union32 var35;
1943 #else
1944   orc_union32 var35;
1945 #endif
1946   orc_union32 var36;
1947   orc_union32 var37;
1948   orc_union32 var38;
1949   orc_union32 var39;
1950   orc_union64 var40;
1951   orc_union64 var41;
1952   orc_union32 var42;
1953   orc_union32 var43;
1954 
1955   ptr0 = (orc_union32 *) d1;
1956   ptr4 = (orc_union32 *) s1;
1957 
1958   /* 1: loadpl */
1959   var35.i = 0x80000000;         /* -2147483648 or 1.061e-314f */
1960   /* 3: loadpl */
1961   var36.i = p1;
1962 
1963   for (i = 0; i < n; i++) {
1964     /* 0: loadl */
1965     var34 = ptr4[i];
1966     /* 2: xorl */
1967     var39.i = var34.i ^ var35.i;
1968     /* 4: mulslq */
1969     var40.i = ((orc_int64) var39.i) * ((orc_int64) var36.i);
1970     /* 5: shrsq */
1971     var41.i = var40.i >> 27;
1972     /* 6: convsssql */
1973     var42.i = ORC_CLAMP_SL (var41.i);
1974     /* 7: xorl */
1975     var43.i = var42.i ^ var35.i;
1976     /* 8: loadl */
1977     var37 = ptr0[i];
1978     /* 9: addusl */
1979     var38.i =
1980         ORC_CLAMP_UL ((orc_int64) (orc_uint32) var37.i +
1981         (orc_int64) (orc_uint32) var43.i);
1982     /* 10: storel */
1983     ptr0[i] = var38;
1984   }
1985 
1986 }
1987 
1988 #else
1989 static void
_backup_audiomixer_orc_add_volume_u32(OrcExecutor * ORC_RESTRICT ex)1990 _backup_audiomixer_orc_add_volume_u32 (OrcExecutor * ORC_RESTRICT ex)
1991 {
1992   int i;
1993   int n = ex->n;
1994   orc_union32 *ORC_RESTRICT ptr0;
1995   const orc_union32 *ORC_RESTRICT ptr4;
1996   orc_union32 var34;
1997 #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
1998   volatile orc_union32 var35;
1999 #else
2000   orc_union32 var35;
2001 #endif
2002   orc_union32 var36;
2003   orc_union32 var37;
2004   orc_union32 var38;
2005   orc_union32 var39;
2006   orc_union64 var40;
2007   orc_union64 var41;
2008   orc_union32 var42;
2009   orc_union32 var43;
2010 
2011   ptr0 = (orc_union32 *) ex->arrays[0];
2012   ptr4 = (orc_union32 *) ex->arrays[4];
2013 
2014   /* 1: loadpl */
2015   var35.i = 0x80000000;         /* -2147483648 or 1.061e-314f */
2016   /* 3: loadpl */
2017   var36.i = ex->params[24];
2018 
2019   for (i = 0; i < n; i++) {
2020     /* 0: loadl */
2021     var34 = ptr4[i];
2022     /* 2: xorl */
2023     var39.i = var34.i ^ var35.i;
2024     /* 4: mulslq */
2025     var40.i = ((orc_int64) var39.i) * ((orc_int64) var36.i);
2026     /* 5: shrsq */
2027     var41.i = var40.i >> 27;
2028     /* 6: convsssql */
2029     var42.i = ORC_CLAMP_SL (var41.i);
2030     /* 7: xorl */
2031     var43.i = var42.i ^ var35.i;
2032     /* 8: loadl */
2033     var37 = ptr0[i];
2034     /* 9: addusl */
2035     var38.i =
2036         ORC_CLAMP_UL ((orc_int64) (orc_uint32) var37.i +
2037         (orc_int64) (orc_uint32) var43.i);
2038     /* 10: storel */
2039     ptr0[i] = var38;
2040   }
2041 
2042 }
2043 
2044 void
audiomixer_orc_add_volume_u32(guint32 * ORC_RESTRICT d1,const guint32 * ORC_RESTRICT s1,int p1,int n)2045 audiomixer_orc_add_volume_u32 (guint32 * ORC_RESTRICT d1,
2046     const guint32 * ORC_RESTRICT s1, int p1, int n)
2047 {
2048   OrcExecutor _ex, *ex = &_ex;
2049   static volatile int p_inited = 0;
2050   static OrcCode *c = 0;
2051   void (*func) (OrcExecutor *);
2052 
2053   if (!p_inited) {
2054     orc_once_mutex_lock ();
2055     if (!p_inited) {
2056       OrcProgram *p;
2057 
2058 #if 1
2059       static const orc_uint8 bc[] = {
2060         1, 9, 29, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
2061         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 117, 51, 50,
2062         11, 4, 4, 12, 4, 4, 14, 4, 0, 0, 0, 128, 15, 8, 27, 0,
2063         0, 0, 0, 0, 0, 0, 16, 4, 20, 8, 20, 4, 132, 33, 4, 16,
2064         178, 32, 33, 24, 147, 32, 32, 17, 170, 33, 32, 132, 33, 33, 16, 105,
2065         0, 0, 33, 2, 0,
2066       };
2067       p = orc_program_new_from_static_bytecode (bc);
2068       orc_program_set_backup_function (p,
2069           _backup_audiomixer_orc_add_volume_u32);
2070 #else
2071       p = orc_program_new ();
2072       orc_program_set_name (p, "audiomixer_orc_add_volume_u32");
2073       orc_program_set_backup_function (p,
2074           _backup_audiomixer_orc_add_volume_u32);
2075       orc_program_add_destination (p, 4, "d1");
2076       orc_program_add_source (p, 4, "s1");
2077       orc_program_add_constant (p, 4, 0x80000000, "c1");
2078       orc_program_add_constant_int64 (p, 8, 0x000000000000001bULL, "c2");
2079       orc_program_add_parameter (p, 4, "p1");
2080       orc_program_add_temporary (p, 8, "t1");
2081       orc_program_add_temporary (p, 4, "t2");
2082 
2083       orc_program_append_2 (p, "xorl", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_C1,
2084           ORC_VAR_D1);
2085       orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_P1,
2086           ORC_VAR_D1);
2087       orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
2088           ORC_VAR_D1);
2089       orc_program_append_2 (p, "convsssql", 0, ORC_VAR_T2, ORC_VAR_T1,
2090           ORC_VAR_D1, ORC_VAR_D1);
2091       orc_program_append_2 (p, "xorl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
2092           ORC_VAR_D1);
2093       orc_program_append_2 (p, "addusl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
2094           ORC_VAR_D1);
2095 #endif
2096 
2097       orc_program_compile (p);
2098       c = orc_program_take_code (p);
2099       orc_program_free (p);
2100     }
2101     p_inited = TRUE;
2102     orc_once_mutex_unlock ();
2103   }
2104   ex->arrays[ORC_VAR_A2] = c;
2105   ex->program = 0;
2106 
2107   ex->n = n;
2108   ex->arrays[ORC_VAR_D1] = d1;
2109   ex->arrays[ORC_VAR_S1] = (void *) s1;
2110   ex->params[ORC_VAR_P1] = p1;
2111 
2112   func = c->exec;
2113   func (ex);
2114 }
2115 #endif
2116 
2117 
2118 /* audiomixer_orc_add_volume_s32 */
2119 #ifdef DISABLE_ORC
2120 void
audiomixer_orc_add_volume_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int p1,int n)2121 audiomixer_orc_add_volume_s32 (gint32 * ORC_RESTRICT d1,
2122     const gint32 * ORC_RESTRICT s1, int p1, int n)
2123 {
2124   int i;
2125   orc_union32 *ORC_RESTRICT ptr0;
2126   const orc_union32 *ORC_RESTRICT ptr4;
2127   orc_union32 var34;
2128   orc_union32 var35;
2129   orc_union32 var36;
2130   orc_union32 var37;
2131   orc_union64 var38;
2132   orc_union64 var39;
2133   orc_union32 var40;
2134 
2135   ptr0 = (orc_union32 *) d1;
2136   ptr4 = (orc_union32 *) s1;
2137 
2138   /* 1: loadpl */
2139   var35.i = p1;
2140 
2141   for (i = 0; i < n; i++) {
2142     /* 0: loadl */
2143     var34 = ptr4[i];
2144     /* 2: mulslq */
2145     var38.i = ((orc_int64) var34.i) * ((orc_int64) var35.i);
2146     /* 3: shrsq */
2147     var39.i = var38.i >> 27;
2148     /* 4: convsssql */
2149     var40.i = ORC_CLAMP_SL (var39.i);
2150     /* 5: loadl */
2151     var36 = ptr0[i];
2152     /* 6: addssl */
2153     var37.i = ORC_CLAMP_SL ((orc_int64) var36.i + (orc_int64) var40.i);
2154     /* 7: storel */
2155     ptr0[i] = var37;
2156   }
2157 
2158 }
2159 
2160 #else
2161 static void
_backup_audiomixer_orc_add_volume_s32(OrcExecutor * ORC_RESTRICT ex)2162 _backup_audiomixer_orc_add_volume_s32 (OrcExecutor * ORC_RESTRICT ex)
2163 {
2164   int i;
2165   int n = ex->n;
2166   orc_union32 *ORC_RESTRICT ptr0;
2167   const orc_union32 *ORC_RESTRICT ptr4;
2168   orc_union32 var34;
2169   orc_union32 var35;
2170   orc_union32 var36;
2171   orc_union32 var37;
2172   orc_union64 var38;
2173   orc_union64 var39;
2174   orc_union32 var40;
2175 
2176   ptr0 = (orc_union32 *) ex->arrays[0];
2177   ptr4 = (orc_union32 *) ex->arrays[4];
2178 
2179   /* 1: loadpl */
2180   var35.i = ex->params[24];
2181 
2182   for (i = 0; i < n; i++) {
2183     /* 0: loadl */
2184     var34 = ptr4[i];
2185     /* 2: mulslq */
2186     var38.i = ((orc_int64) var34.i) * ((orc_int64) var35.i);
2187     /* 3: shrsq */
2188     var39.i = var38.i >> 27;
2189     /* 4: convsssql */
2190     var40.i = ORC_CLAMP_SL (var39.i);
2191     /* 5: loadl */
2192     var36 = ptr0[i];
2193     /* 6: addssl */
2194     var37.i = ORC_CLAMP_SL ((orc_int64) var36.i + (orc_int64) var40.i);
2195     /* 7: storel */
2196     ptr0[i] = var37;
2197   }
2198 
2199 }
2200 
2201 void
audiomixer_orc_add_volume_s32(gint32 * ORC_RESTRICT d1,const gint32 * ORC_RESTRICT s1,int p1,int n)2202 audiomixer_orc_add_volume_s32 (gint32 * ORC_RESTRICT d1,
2203     const gint32 * ORC_RESTRICT s1, int p1, int n)
2204 {
2205   OrcExecutor _ex, *ex = &_ex;
2206   static volatile int p_inited = 0;
2207   static OrcCode *c = 0;
2208   void (*func) (OrcExecutor *);
2209 
2210   if (!p_inited) {
2211     orc_once_mutex_lock ();
2212     if (!p_inited) {
2213       OrcProgram *p;
2214 
2215 #if 1
2216       static const orc_uint8 bc[] = {
2217         1, 9, 29, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
2218         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 115, 51, 50,
2219         11, 4, 4, 12, 4, 4, 15, 8, 27, 0, 0, 0, 0, 0, 0, 0,
2220         16, 4, 20, 8, 20, 4, 178, 32, 4, 24, 147, 32, 32, 16, 170, 33,
2221         32, 104, 0, 0, 33, 2, 0,
2222       };
2223       p = orc_program_new_from_static_bytecode (bc);
2224       orc_program_set_backup_function (p,
2225           _backup_audiomixer_orc_add_volume_s32);
2226 #else
2227       p = orc_program_new ();
2228       orc_program_set_name (p, "audiomixer_orc_add_volume_s32");
2229       orc_program_set_backup_function (p,
2230           _backup_audiomixer_orc_add_volume_s32);
2231       orc_program_add_destination (p, 4, "d1");
2232       orc_program_add_source (p, 4, "s1");
2233       orc_program_add_constant_int64 (p, 8, 0x000000000000001bULL, "c1");
2234       orc_program_add_parameter (p, 4, "p1");
2235       orc_program_add_temporary (p, 8, "t1");
2236       orc_program_add_temporary (p, 4, "t2");
2237 
2238       orc_program_append_2 (p, "mulslq", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
2239           ORC_VAR_D1);
2240       orc_program_append_2 (p, "shrsq", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
2241           ORC_VAR_D1);
2242       orc_program_append_2 (p, "convsssql", 0, ORC_VAR_T2, ORC_VAR_T1,
2243           ORC_VAR_D1, ORC_VAR_D1);
2244       orc_program_append_2 (p, "addssl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2,
2245           ORC_VAR_D1);
2246 #endif
2247 
2248       orc_program_compile (p);
2249       c = orc_program_take_code (p);
2250       orc_program_free (p);
2251     }
2252     p_inited = TRUE;
2253     orc_once_mutex_unlock ();
2254   }
2255   ex->arrays[ORC_VAR_A2] = c;
2256   ex->program = 0;
2257 
2258   ex->n = n;
2259   ex->arrays[ORC_VAR_D1] = d1;
2260   ex->arrays[ORC_VAR_S1] = (void *) s1;
2261   ex->params[ORC_VAR_P1] = p1;
2262 
2263   func = c->exec;
2264   func (ex);
2265 }
2266 #endif
2267 
2268 
2269 /* audiomixer_orc_add_volume_f32 */
2270 #ifdef DISABLE_ORC
2271 void
audiomixer_orc_add_volume_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,float p1,int n)2272 audiomixer_orc_add_volume_f32 (float *ORC_RESTRICT d1,
2273     const float *ORC_RESTRICT s1, float p1, int n)
2274 {
2275   int i;
2276   orc_union32 *ORC_RESTRICT ptr0;
2277   const orc_union32 *ORC_RESTRICT ptr4;
2278   orc_union32 var33;
2279   orc_union32 var34;
2280   orc_union32 var35;
2281   orc_union32 var36;
2282   orc_union32 var37;
2283 
2284   ptr0 = (orc_union32 *) d1;
2285   ptr4 = (orc_union32 *) s1;
2286 
2287   /* 1: loadpl */
2288   var34.f = p1;
2289 
2290   for (i = 0; i < n; i++) {
2291     /* 0: loadl */
2292     var33 = ptr4[i];
2293     /* 2: mulf */
2294     {
2295       orc_union32 _src1;
2296       orc_union32 _src2;
2297       orc_union32 _dest1;
2298       _src1.i = ORC_DENORMAL (var33.i);
2299       _src2.i = ORC_DENORMAL (var34.i);
2300       _dest1.f = _src1.f * _src2.f;
2301       var37.i = ORC_DENORMAL (_dest1.i);
2302     }
2303     /* 3: loadl */
2304     var35 = ptr0[i];
2305     /* 4: addf */
2306     {
2307       orc_union32 _src1;
2308       orc_union32 _src2;
2309       orc_union32 _dest1;
2310       _src1.i = ORC_DENORMAL (var35.i);
2311       _src2.i = ORC_DENORMAL (var37.i);
2312       _dest1.f = _src1.f + _src2.f;
2313       var36.i = ORC_DENORMAL (_dest1.i);
2314     }
2315     /* 5: storel */
2316     ptr0[i] = var36;
2317   }
2318 
2319 }
2320 
2321 #else
2322 static void
_backup_audiomixer_orc_add_volume_f32(OrcExecutor * ORC_RESTRICT ex)2323 _backup_audiomixer_orc_add_volume_f32 (OrcExecutor * ORC_RESTRICT ex)
2324 {
2325   int i;
2326   int n = ex->n;
2327   orc_union32 *ORC_RESTRICT ptr0;
2328   const orc_union32 *ORC_RESTRICT ptr4;
2329   orc_union32 var33;
2330   orc_union32 var34;
2331   orc_union32 var35;
2332   orc_union32 var36;
2333   orc_union32 var37;
2334 
2335   ptr0 = (orc_union32 *) ex->arrays[0];
2336   ptr4 = (orc_union32 *) ex->arrays[4];
2337 
2338   /* 1: loadpl */
2339   var34.i = ex->params[24];
2340 
2341   for (i = 0; i < n; i++) {
2342     /* 0: loadl */
2343     var33 = ptr4[i];
2344     /* 2: mulf */
2345     {
2346       orc_union32 _src1;
2347       orc_union32 _src2;
2348       orc_union32 _dest1;
2349       _src1.i = ORC_DENORMAL (var33.i);
2350       _src2.i = ORC_DENORMAL (var34.i);
2351       _dest1.f = _src1.f * _src2.f;
2352       var37.i = ORC_DENORMAL (_dest1.i);
2353     }
2354     /* 3: loadl */
2355     var35 = ptr0[i];
2356     /* 4: addf */
2357     {
2358       orc_union32 _src1;
2359       orc_union32 _src2;
2360       orc_union32 _dest1;
2361       _src1.i = ORC_DENORMAL (var35.i);
2362       _src2.i = ORC_DENORMAL (var37.i);
2363       _dest1.f = _src1.f + _src2.f;
2364       var36.i = ORC_DENORMAL (_dest1.i);
2365     }
2366     /* 5: storel */
2367     ptr0[i] = var36;
2368   }
2369 
2370 }
2371 
2372 void
audiomixer_orc_add_volume_f32(float * ORC_RESTRICT d1,const float * ORC_RESTRICT s1,float p1,int n)2373 audiomixer_orc_add_volume_f32 (float *ORC_RESTRICT d1,
2374     const float *ORC_RESTRICT s1, float p1, int n)
2375 {
2376   OrcExecutor _ex, *ex = &_ex;
2377   static volatile int p_inited = 0;
2378   static OrcCode *c = 0;
2379   void (*func) (OrcExecutor *);
2380 
2381   if (!p_inited) {
2382     orc_once_mutex_lock ();
2383     if (!p_inited) {
2384       OrcProgram *p;
2385 
2386 #if 1
2387       static const orc_uint8 bc[] = {
2388         1, 9, 29, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
2389         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 102, 51, 50,
2390         11, 4, 4, 12, 4, 4, 17, 4, 20, 4, 202, 32, 4, 24, 200, 0,
2391         0, 32, 2, 0,
2392       };
2393       p = orc_program_new_from_static_bytecode (bc);
2394       orc_program_set_backup_function (p,
2395           _backup_audiomixer_orc_add_volume_f32);
2396 #else
2397       p = orc_program_new ();
2398       orc_program_set_name (p, "audiomixer_orc_add_volume_f32");
2399       orc_program_set_backup_function (p,
2400           _backup_audiomixer_orc_add_volume_f32);
2401       orc_program_add_destination (p, 4, "d1");
2402       orc_program_add_source (p, 4, "s1");
2403       orc_program_add_parameter_float (p, 4, "p1");
2404       orc_program_add_temporary (p, 4, "t1");
2405 
2406       orc_program_append_2 (p, "mulf", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
2407           ORC_VAR_D1);
2408       orc_program_append_2 (p, "addf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
2409           ORC_VAR_D1);
2410 #endif
2411 
2412       orc_program_compile (p);
2413       c = orc_program_take_code (p);
2414       orc_program_free (p);
2415     }
2416     p_inited = TRUE;
2417     orc_once_mutex_unlock ();
2418   }
2419   ex->arrays[ORC_VAR_A2] = c;
2420   ex->program = 0;
2421 
2422   ex->n = n;
2423   ex->arrays[ORC_VAR_D1] = d1;
2424   ex->arrays[ORC_VAR_S1] = (void *) s1;
2425   {
2426     orc_union32 tmp;
2427     tmp.f = p1;
2428     ex->params[ORC_VAR_P1] = tmp.i;
2429   }
2430 
2431   func = c->exec;
2432   func (ex);
2433 }
2434 #endif
2435 
2436 
2437 /* audiomixer_orc_add_volume_f64 */
2438 #ifdef DISABLE_ORC
2439 void
audiomixer_orc_add_volume_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,double p1,int n)2440 audiomixer_orc_add_volume_f64 (double *ORC_RESTRICT d1,
2441     const double *ORC_RESTRICT s1, double p1, int n)
2442 {
2443   int i;
2444   orc_union64 *ORC_RESTRICT ptr0;
2445   const orc_union64 *ORC_RESTRICT ptr4;
2446   orc_union64 var33;
2447   orc_union64 var34;
2448   orc_union64 var35;
2449   orc_union64 var36;
2450   orc_union64 var37;
2451 
2452   ptr0 = (orc_union64 *) d1;
2453   ptr4 = (orc_union64 *) s1;
2454 
2455   /* 1: loadpq */
2456   var34.f = p1;
2457 
2458   for (i = 0; i < n; i++) {
2459     /* 0: loadq */
2460     var33 = ptr4[i];
2461     /* 2: muld */
2462     {
2463       orc_union64 _src1;
2464       orc_union64 _src2;
2465       orc_union64 _dest1;
2466       _src1.i = ORC_DENORMAL_DOUBLE (var33.i);
2467       _src2.i = ORC_DENORMAL_DOUBLE (var34.i);
2468       _dest1.f = _src1.f * _src2.f;
2469       var37.i = ORC_DENORMAL_DOUBLE (_dest1.i);
2470     }
2471     /* 3: loadq */
2472     var35 = ptr0[i];
2473     /* 4: addd */
2474     {
2475       orc_union64 _src1;
2476       orc_union64 _src2;
2477       orc_union64 _dest1;
2478       _src1.i = ORC_DENORMAL_DOUBLE (var35.i);
2479       _src2.i = ORC_DENORMAL_DOUBLE (var37.i);
2480       _dest1.f = _src1.f + _src2.f;
2481       var36.i = ORC_DENORMAL_DOUBLE (_dest1.i);
2482     }
2483     /* 5: storeq */
2484     ptr0[i] = var36;
2485   }
2486 
2487 }
2488 
2489 #else
2490 static void
_backup_audiomixer_orc_add_volume_f64(OrcExecutor * ORC_RESTRICT ex)2491 _backup_audiomixer_orc_add_volume_f64 (OrcExecutor * ORC_RESTRICT ex)
2492 {
2493   int i;
2494   int n = ex->n;
2495   orc_union64 *ORC_RESTRICT ptr0;
2496   const orc_union64 *ORC_RESTRICT ptr4;
2497   orc_union64 var33;
2498   orc_union64 var34;
2499   orc_union64 var35;
2500   orc_union64 var36;
2501   orc_union64 var37;
2502 
2503   ptr0 = (orc_union64 *) ex->arrays[0];
2504   ptr4 = (orc_union64 *) ex->arrays[4];
2505 
2506   /* 1: loadpq */
2507   var34.i =
2508       (ex->params[24] & 0xffffffff) | ((orc_uint64) (ex->params[24 +
2509               (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);
2510 
2511   for (i = 0; i < n; i++) {
2512     /* 0: loadq */
2513     var33 = ptr4[i];
2514     /* 2: muld */
2515     {
2516       orc_union64 _src1;
2517       orc_union64 _src2;
2518       orc_union64 _dest1;
2519       _src1.i = ORC_DENORMAL_DOUBLE (var33.i);
2520       _src2.i = ORC_DENORMAL_DOUBLE (var34.i);
2521       _dest1.f = _src1.f * _src2.f;
2522       var37.i = ORC_DENORMAL_DOUBLE (_dest1.i);
2523     }
2524     /* 3: loadq */
2525     var35 = ptr0[i];
2526     /* 4: addd */
2527     {
2528       orc_union64 _src1;
2529       orc_union64 _src2;
2530       orc_union64 _dest1;
2531       _src1.i = ORC_DENORMAL_DOUBLE (var35.i);
2532       _src2.i = ORC_DENORMAL_DOUBLE (var37.i);
2533       _dest1.f = _src1.f + _src2.f;
2534       var36.i = ORC_DENORMAL_DOUBLE (_dest1.i);
2535     }
2536     /* 5: storeq */
2537     ptr0[i] = var36;
2538   }
2539 
2540 }
2541 
2542 void
audiomixer_orc_add_volume_f64(double * ORC_RESTRICT d1,const double * ORC_RESTRICT s1,double p1,int n)2543 audiomixer_orc_add_volume_f64 (double *ORC_RESTRICT d1,
2544     const double *ORC_RESTRICT s1, double p1, int n)
2545 {
2546   OrcExecutor _ex, *ex = &_ex;
2547   static volatile int p_inited = 0;
2548   static OrcCode *c = 0;
2549   void (*func) (OrcExecutor *);
2550 
2551   if (!p_inited) {
2552     orc_once_mutex_lock ();
2553     if (!p_inited) {
2554       OrcProgram *p;
2555 
2556 #if 1
2557       static const orc_uint8 bc[] = {
2558         1, 9, 29, 97, 117, 100, 105, 111, 109, 105, 120, 101, 114, 95, 111, 114,
2559         99, 95, 97, 100, 100, 95, 118, 111, 108, 117, 109, 101, 95, 102, 54, 52,
2560         11, 8, 8, 12, 8, 8, 18, 8, 20, 8, 214, 32, 4, 24, 212, 0,
2561         0, 32, 2, 0,
2562       };
2563       p = orc_program_new_from_static_bytecode (bc);
2564       orc_program_set_backup_function (p,
2565           _backup_audiomixer_orc_add_volume_f64);
2566 #else
2567       p = orc_program_new ();
2568       orc_program_set_name (p, "audiomixer_orc_add_volume_f64");
2569       orc_program_set_backup_function (p,
2570           _backup_audiomixer_orc_add_volume_f64);
2571       orc_program_add_destination (p, 8, "d1");
2572       orc_program_add_source (p, 8, "s1");
2573       orc_program_add_parameter_double (p, 8, "p1");
2574       orc_program_add_temporary (p, 8, "t1");
2575 
2576       orc_program_append_2 (p, "muld", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_P1,
2577           ORC_VAR_D1);
2578       orc_program_append_2 (p, "addd", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1,
2579           ORC_VAR_D1);
2580 #endif
2581 
2582       orc_program_compile (p);
2583       c = orc_program_take_code (p);
2584       orc_program_free (p);
2585     }
2586     p_inited = TRUE;
2587     orc_once_mutex_unlock ();
2588   }
2589   ex->arrays[ORC_VAR_A2] = c;
2590   ex->program = 0;
2591 
2592   ex->n = n;
2593   ex->arrays[ORC_VAR_D1] = d1;
2594   ex->arrays[ORC_VAR_S1] = (void *) s1;
2595   {
2596     orc_union64 tmp;
2597     tmp.f = p1;
2598     ex->params[ORC_VAR_P1] = ((orc_uint64) tmp.i) & 0xffffffff;
2599     ex->params[ORC_VAR_T1] = ((orc_uint64) tmp.i) >> 32;
2600   }
2601 
2602   func = c->exec;
2603   func (ex);
2604 }
2605 #endif
2606