2 SuperCollider real time audio synthesis system
3 Copyright (c) 2002 James McCartney. All rights reserved.
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "SC_PlugIn.h"
26 // hypotf is c99, but not c++
27 #define hypotf _hypotf
31 #include "simd_binary_arithmetic.hpp"
32 #include "simd_math.hpp"
33 #include "simd_memory.hpp"
35 #if defined (__GNUC__) && !(defined(__clang__))
36 #define inline_functions __attribute__ ((flatten))
38 #define inline_functions
41 using nova::slope_argument
;
43 #define NOVA_BINARY_WRAPPER(SCNAME, NOVANAME) \
44 inline_functions void SCNAME##_aa_nova(BinaryOpUGen *unit, int inNumSamples) \
46 nova::NOVANAME##_vec_simd(OUT(0), IN(0), IN(1), inNumSamples); \
49 inline_functions void SCNAME##_aa_nova_64(BinaryOpUGen *unit, int inNumSamples) \
51 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), IN(1)); \
54 inline_functions void SCNAME##_ia_nova(BinaryOpUGen *unit, int inNumSamples) \
58 nova::NOVANAME##_vec_simd(OUT(0), xa, IN(1), inNumSamples); \
62 inline_functions void SCNAME##_ia_nova_64(BinaryOpUGen *unit, int inNumSamples) \
66 nova::NOVANAME##_vec_simd<64>(OUT(0), xa, IN(1)); \
70 inline_functions void SCNAME##_ai_nova(BinaryOpUGen *unit, int inNumSamples) \
74 nova::NOVANAME##_vec_simd(OUT(0), IN(0), xb, inNumSamples); \
78 inline_functions void SCNAME##_ai_nova_64(BinaryOpUGen *unit, int inNumSamples) \
82 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), xb); \
86 #define NOVA_BINARY_WRAPPER_K(SCNAME, NOVANAME) \
87 inline_functions void SCNAME##_aa_nova(BinaryOpUGen *unit, int inNumSamples) \
89 nova::NOVANAME##_vec_simd(OUT(0), IN(0), IN(1), inNumSamples); \
92 inline_functions void SCNAME##_aa_nova_64(BinaryOpUGen *unit, int inNumSamples) \
94 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), IN(1)); \
97 inline_functions void SCNAME##_ia_nova(BinaryOpUGen *unit, int inNumSamples) \
101 nova::NOVANAME##_vec_simd(OUT(0), xa, IN(1), inNumSamples); \
105 inline_functions void SCNAME##_ia_nova_64(BinaryOpUGen *unit, int inNumSamples) \
107 float xa = ZIN0(0); \
109 nova::NOVANAME##_vec_simd<64>(OUT(0), xa, IN(1)); \
113 inline_functions void SCNAME##_ai_nova(BinaryOpUGen *unit, int inNumSamples) \
115 float xb = ZIN0(1); \
117 nova::NOVANAME##_vec_simd(OUT(0), IN(0), xb, inNumSamples); \
121 inline_functions void SCNAME##_ai_nova_64(BinaryOpUGen *unit, int inNumSamples) \
123 float xb = ZIN0(1); \
125 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), xb); \
129 inline_functions void SCNAME##_ak_nova(BinaryOpUGen *unit, int inNumSamples) \
131 float xb = unit->mPrevB; \
132 float next_b = ZIN0(1); \
134 if (xb == next_b) { \
135 nova::NOVANAME##_vec_simd(OUT(0), IN(0), xb, inNumSamples); \
137 float slope = CALCSLOPE(next_b, xb); \
138 nova::NOVANAME##_vec_simd(OUT(0), IN(0), slope_argument(xb, slope), inNumSamples); \
139 unit->mPrevB = next_b; \
143 inline_functions void SCNAME##_ak_nova_64(BinaryOpUGen *unit, int inNumSamples) \
145 float xb = unit->mPrevB; \
146 float next_b = ZIN0(1); \
148 if (xb == next_b) { \
149 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), xb); \
151 float slope = CALCSLOPE(next_b, xb); \
152 nova::NOVANAME##_vec_simd(OUT(0), IN(0), slope_argument(xb, slope), inNumSamples); \
153 unit->mPrevB = next_b; \
157 inline_functions void SCNAME##_ka_nova(BinaryOpUGen *unit, int inNumSamples) \
159 float xa = unit->mPrevA; \
160 float next_a = ZIN0(0); \
162 if (xa == next_a) { \
163 nova::NOVANAME##_vec_simd(OUT(0), xa, IN(1), inNumSamples); \
165 float slope = CALCSLOPE(next_a, xa); \
166 nova::NOVANAME##_vec_simd(OUT(0), slope_argument(xa, slope), IN(1), inNumSamples); \
167 unit->mPrevA = next_a; \
170 inline_functions void SCNAME##_ka_nova_64(BinaryOpUGen *unit, int inNumSamples) \
172 float xa = unit->mPrevA; \
173 float next_a = ZIN0(0); \
175 if (xa == next_a) { \
176 nova::NOVANAME##_vec_simd<64>(OUT(0), xa, IN(1)); \
178 float slope = CALCSLOPE(next_a, xa); \
179 nova::NOVANAME##_vec_simd(OUT(0), slope_argument(xa, slope), IN(1), inNumSamples); \
180 unit->mPrevA = next_a; \
187 using namespace std
; // for math functions
189 static InterfaceTable
*ft
;
191 //////////////////////////////////////////////////////////////////////////////////////////////////
194 /* special binary math operators */
229 opRing1
, // a * (b + 1) == a * b + a
230 opRing2
, // a * b + a + b
232 opRing4
, // a*a*b - a*b*b
233 opDifSqr
, // a*a - b*b
234 opSumSqr
, // a*a + b*b
235 opSqrSum
, // (a + b)^2
236 opSqrDif
, // (a - b)^2
253 inline float sc_andt(float a
, float b
)
255 return int(a
) & int(b
);
258 inline float sc_ort(float a
, float b
)
260 return int(a
) | int(b
);
263 inline float sc_xort(float a
, float b
)
265 return int(a
) ^ int(b
);
268 inline float sc_rst(float a
, float b
)
270 return int(a
) >> int(b
);
273 inline float sc_lst(float a
, float b
)
275 return int(a
) << int(b
);
278 struct BinaryOpUGen
: public Unit
280 float mPrevA
, mPrevB
;
283 typedef void (*BinaryOpFunc
)(BinaryOpUGen
*unit
, int inNumSamples
);
288 void BinaryOpUGen_Ctor(BinaryOpUGen
*unit
);
290 //void zero_d(BinaryOpUGen *unit, int inNumSamples);
291 void zero_1(BinaryOpUGen
*unit
, int inNumSamples
);
292 void zero_aa(BinaryOpUGen
*unit
, int inNumSamples
);
293 void firstarg_d(BinaryOpUGen
*unit
, int inNumSamples
);
294 void firstarg_1(BinaryOpUGen
*unit
, int inNumSamples
);
295 void firstarg_aa(BinaryOpUGen
*unit
, int inNumSamples
);
296 void secondarg_d(BinaryOpUGen
*unit
, int inNumSamples
);
297 void secondarg_1(BinaryOpUGen
*unit
, int inNumSamples
);
298 void secondarg_aa(BinaryOpUGen
*unit
, int inNumSamples
);
299 void add_d(BinaryOpUGen
*unit
, int inNumSamples
);
300 void add_1(BinaryOpUGen
*unit
, int inNumSamples
);
301 void add_aa(BinaryOpUGen
*unit
, int inNumSamples
);
302 void add_ak(BinaryOpUGen
*unit
, int inNumSamples
);
303 void add_ka(BinaryOpUGen
*unit
, int inNumSamples
);
304 void add_ai(BinaryOpUGen
*unit
, int inNumSamples
);
305 void add_ia(BinaryOpUGen
*unit
, int inNumSamples
);
306 void sub_d(BinaryOpUGen
*unit
, int inNumSamples
);
307 void sub_1(BinaryOpUGen
*unit
, int inNumSamples
);
308 void sub_aa(BinaryOpUGen
*unit
, int inNumSamples
);
309 void sub_ak(BinaryOpUGen
*unit
, int inNumSamples
);
310 void sub_ka(BinaryOpUGen
*unit
, int inNumSamples
);
311 void sub_ai(BinaryOpUGen
*unit
, int inNumSamples
);
312 void sub_ia(BinaryOpUGen
*unit
, int inNumSamples
);
313 void mul_d(BinaryOpUGen
*unit
, int inNumSamples
);
314 void mul_1(BinaryOpUGen
*unit
, int inNumSamples
);
315 void mul_aa(BinaryOpUGen
*unit
, int inNumSamples
);
316 void mul_ak(BinaryOpUGen
*unit
, int inNumSamples
);
317 void mul_ka(BinaryOpUGen
*unit
, int inNumSamples
);
318 void mul_ai(BinaryOpUGen
*unit
, int inNumSamples
);
319 void mul_ia(BinaryOpUGen
*unit
, int inNumSamples
);
320 void div_d(BinaryOpUGen
*unit
, int inNumSamples
);
321 void div_1(BinaryOpUGen
*unit
, int inNumSamples
);
322 void div_aa(BinaryOpUGen
*unit
, int inNumSamples
);
323 void div_ak(BinaryOpUGen
*unit
, int inNumSamples
);
324 void div_ka(BinaryOpUGen
*unit
, int inNumSamples
);
325 void div_ai(BinaryOpUGen
*unit
, int inNumSamples
);
326 void div_ia(BinaryOpUGen
*unit
, int inNumSamples
);
327 void mod_d(BinaryOpUGen
*unit
, int inNumSamples
);
328 void mod_1(BinaryOpUGen
*unit
, int inNumSamples
);
329 void mod_aa(BinaryOpUGen
*unit
, int inNumSamples
);
330 void mod_ak(BinaryOpUGen
*unit
, int inNumSamples
);
331 void mod_ka(BinaryOpUGen
*unit
, int inNumSamples
);
332 void mod_ai(BinaryOpUGen
*unit
, int inNumSamples
);
333 void mod_ia(BinaryOpUGen
*unit
, int inNumSamples
);
334 void max_d(BinaryOpUGen
*unit
, int inNumSamples
);
335 void max_1(BinaryOpUGen
*unit
, int inNumSamples
);
336 void max_aa(BinaryOpUGen
*unit
, int inNumSamples
);
337 void max_ak(BinaryOpUGen
*unit
, int inNumSamples
);
338 void max_ka(BinaryOpUGen
*unit
, int inNumSamples
);
339 void max_ai(BinaryOpUGen
*unit
, int inNumSamples
);
340 void max_ia(BinaryOpUGen
*unit
, int inNumSamples
);
341 void min_d(BinaryOpUGen
*unit
, int inNumSamples
);
342 void min_1(BinaryOpUGen
*unit
, int inNumSamples
);
343 void min_aa(BinaryOpUGen
*unit
, int inNumSamples
);
344 void min_ak(BinaryOpUGen
*unit
, int inNumSamples
);
345 void min_ka(BinaryOpUGen
*unit
, int inNumSamples
);
346 void min_ai(BinaryOpUGen
*unit
, int inNumSamples
);
347 void min_ia(BinaryOpUGen
*unit
, int inNumSamples
);
349 void and_d(BinaryOpUGen
*unit
, int inNumSamples
);
350 void and_1(BinaryOpUGen
*unit
, int inNumSamples
);
351 void and_aa(BinaryOpUGen
*unit
, int inNumSamples
);
352 void and_ak(BinaryOpUGen
*unit
, int inNumSamples
);
353 void and_ka(BinaryOpUGen
*unit
, int inNumSamples
);
354 void and_ai(BinaryOpUGen
*unit
, int inNumSamples
);
355 void and_ia(BinaryOpUGen
*unit
, int inNumSamples
);
357 void or_d(BinaryOpUGen
*unit
, int inNumSamples
);
358 void or_1(BinaryOpUGen
*unit
, int inNumSamples
);
359 void or_aa(BinaryOpUGen
*unit
, int inNumSamples
);
360 void or_ak(BinaryOpUGen
*unit
, int inNumSamples
);
361 void or_ka(BinaryOpUGen
*unit
, int inNumSamples
);
362 void or_ai(BinaryOpUGen
*unit
, int inNumSamples
);
363 void or_ia(BinaryOpUGen
*unit
, int inNumSamples
);
365 void xor_d(BinaryOpUGen
*unit
, int inNumSamples
);
366 void xor_1(BinaryOpUGen
*unit
, int inNumSamples
);
367 void xor_aa(BinaryOpUGen
*unit
, int inNumSamples
);
368 void xor_ak(BinaryOpUGen
*unit
, int inNumSamples
);
369 void xor_ka(BinaryOpUGen
*unit
, int inNumSamples
);
370 void xor_ai(BinaryOpUGen
*unit
, int inNumSamples
);
371 void xor_ia(BinaryOpUGen
*unit
, int inNumSamples
);
373 void amclip_d(BinaryOpUGen
*unit
, int inNumSamples
);
374 void amclip_1(BinaryOpUGen
*unit
, int inNumSamples
);
375 void amclip_aa(BinaryOpUGen
*unit
, int inNumSamples
);
376 void amclip_ak(BinaryOpUGen
*unit
, int inNumSamples
);
377 void amclip_ka(BinaryOpUGen
*unit
, int inNumSamples
);
378 void amclip_ai(BinaryOpUGen
*unit
, int inNumSamples
);
379 void amclip_ia(BinaryOpUGen
*unit
, int inNumSamples
);
380 void scaleneg_d(BinaryOpUGen
*unit
, int inNumSamples
);
381 void scaleneg_1(BinaryOpUGen
*unit
, int inNumSamples
);
382 void scaleneg_aa(BinaryOpUGen
*unit
, int inNumSamples
);
383 void scaleneg_ak(BinaryOpUGen
*unit
, int inNumSamples
);
384 void scaleneg_ka(BinaryOpUGen
*unit
, int inNumSamples
);
385 void scaleneg_ai(BinaryOpUGen
*unit
, int inNumSamples
);
386 void scaleneg_ia(BinaryOpUGen
*unit
, int inNumSamples
);
387 void pow_d(BinaryOpUGen
*unit
, int inNumSamples
);
388 void pow_1(BinaryOpUGen
*unit
, int inNumSamples
);
389 void pow_aa(BinaryOpUGen
*unit
, int inNumSamples
);
390 void pow_ak(BinaryOpUGen
*unit
, int inNumSamples
);
391 void pow_ka(BinaryOpUGen
*unit
, int inNumSamples
);
392 void pow_ai(BinaryOpUGen
*unit
, int inNumSamples
);
393 void pow_ia(BinaryOpUGen
*unit
, int inNumSamples
);
394 void ring1_d(BinaryOpUGen
*unit
, int inNumSamples
);
395 void ring1_1(BinaryOpUGen
*unit
, int inNumSamples
);
396 void ring1_aa(BinaryOpUGen
*unit
, int inNumSamples
);
397 void ring1_ak(BinaryOpUGen
*unit
, int inNumSamples
);
398 void ring1_ka(BinaryOpUGen
*unit
, int inNumSamples
);
399 void ring1_ai(BinaryOpUGen
*unit
, int inNumSamples
);
400 void ring1_ia(BinaryOpUGen
*unit
, int inNumSamples
);
401 void ring2_d(BinaryOpUGen
*unit
, int inNumSamples
);
402 void ring2_1(BinaryOpUGen
*unit
, int inNumSamples
);
403 void ring2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
404 void ring2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
405 void ring2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
406 void ring2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
407 void ring2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
408 void ring3_d(BinaryOpUGen
*unit
, int inNumSamples
);
409 void ring3_1(BinaryOpUGen
*unit
, int inNumSamples
);
410 void ring3_aa(BinaryOpUGen
*unit
, int inNumSamples
);
411 void ring3_ak(BinaryOpUGen
*unit
, int inNumSamples
);
412 void ring3_ka(BinaryOpUGen
*unit
, int inNumSamples
);
413 void ring3_ai(BinaryOpUGen
*unit
, int inNumSamples
);
414 void ring3_ia(BinaryOpUGen
*unit
, int inNumSamples
);
415 void ring4_d(BinaryOpUGen
*unit
, int inNumSamples
);
416 void ring4_1(BinaryOpUGen
*unit
, int inNumSamples
);
417 void ring4_aa(BinaryOpUGen
*unit
, int inNumSamples
);
418 void ring4_ak(BinaryOpUGen
*unit
, int inNumSamples
);
419 void ring4_ka(BinaryOpUGen
*unit
, int inNumSamples
);
420 void ring4_ai(BinaryOpUGen
*unit
, int inNumSamples
);
421 void ring4_ia(BinaryOpUGen
*unit
, int inNumSamples
);
422 void thresh_d(BinaryOpUGen
*unit
, int inNumSamples
);
423 void thresh_1(BinaryOpUGen
*unit
, int inNumSamples
);
424 void thresh_aa(BinaryOpUGen
*unit
, int inNumSamples
);
425 void thresh_ak(BinaryOpUGen
*unit
, int inNumSamples
);
426 void thresh_ka(BinaryOpUGen
*unit
, int inNumSamples
);
427 void thresh_ai(BinaryOpUGen
*unit
, int inNumSamples
);
428 void thresh_ia(BinaryOpUGen
*unit
, int inNumSamples
);
429 void clip2_d(BinaryOpUGen
*unit
, int inNumSamples
);
430 void clip2_1(BinaryOpUGen
*unit
, int inNumSamples
);
431 void clip2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
432 void clip2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
433 void clip2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
434 void clip2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
435 void clip2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
436 void fold2_d(BinaryOpUGen
*unit
, int inNumSamples
);
437 void fold2_1(BinaryOpUGen
*unit
, int inNumSamples
);
438 void fold2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
439 void fold2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
440 void fold2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
441 void fold2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
442 void fold2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
443 void wrap2_d(BinaryOpUGen
*unit
, int inNumSamples
);
444 void wrap2_1(BinaryOpUGen
*unit
, int inNumSamples
);
445 void wrap2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
446 void wrap2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
447 void wrap2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
448 void wrap2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
449 void wrap2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
450 void excess_d(BinaryOpUGen
*unit
, int inNumSamples
);
451 void excess_1(BinaryOpUGen
*unit
, int inNumSamples
);
452 void excess_aa(BinaryOpUGen
*unit
, int inNumSamples
);
453 void excess_ak(BinaryOpUGen
*unit
, int inNumSamples
);
454 void excess_ka(BinaryOpUGen
*unit
, int inNumSamples
);
455 void excess_ai(BinaryOpUGen
*unit
, int inNumSamples
);
456 void excess_ia(BinaryOpUGen
*unit
, int inNumSamples
);
457 void lt_d(BinaryOpUGen
*unit
, int inNumSamples
);
458 void lt_1(BinaryOpUGen
*unit
, int inNumSamples
);
459 void lt_aa(BinaryOpUGen
*unit
, int inNumSamples
);
460 void lt_ak(BinaryOpUGen
*unit
, int inNumSamples
);
461 void lt_ka(BinaryOpUGen
*unit
, int inNumSamples
);
462 void lt_ai(BinaryOpUGen
*unit
, int inNumSamples
);
463 void lt_ia(BinaryOpUGen
*unit
, int inNumSamples
);
464 void le_d(BinaryOpUGen
*unit
, int inNumSamples
);
465 void le_1(BinaryOpUGen
*unit
, int inNumSamples
);
466 void le_aa(BinaryOpUGen
*unit
, int inNumSamples
);
467 void le_ak(BinaryOpUGen
*unit
, int inNumSamples
);
468 void le_ka(BinaryOpUGen
*unit
, int inNumSamples
);
469 void le_ai(BinaryOpUGen
*unit
, int inNumSamples
);
470 void le_ia(BinaryOpUGen
*unit
, int inNumSamples
);
471 void gt_d(BinaryOpUGen
*unit
, int inNumSamples
);
472 void gt_1(BinaryOpUGen
*unit
, int inNumSamples
);
473 void gt_aa(BinaryOpUGen
*unit
, int inNumSamples
);
474 void gt_ak(BinaryOpUGen
*unit
, int inNumSamples
);
475 void gt_ka(BinaryOpUGen
*unit
, int inNumSamples
);
476 void gt_ai(BinaryOpUGen
*unit
, int inNumSamples
);
477 void gt_ia(BinaryOpUGen
*unit
, int inNumSamples
);
478 void ge_d(BinaryOpUGen
*unit
, int inNumSamples
);
479 void ge_1(BinaryOpUGen
*unit
, int inNumSamples
);
480 void ge_aa(BinaryOpUGen
*unit
, int inNumSamples
);
481 void ge_ak(BinaryOpUGen
*unit
, int inNumSamples
);
482 void ge_ka(BinaryOpUGen
*unit
, int inNumSamples
);
483 void ge_ai(BinaryOpUGen
*unit
, int inNumSamples
);
484 void ge_ia(BinaryOpUGen
*unit
, int inNumSamples
);
485 void eq_d(BinaryOpUGen
*unit
, int inNumSamples
);
486 void eq_1(BinaryOpUGen
*unit
, int inNumSamples
);
487 void eq_aa(BinaryOpUGen
*unit
, int inNumSamples
);
488 void eq_ak(BinaryOpUGen
*unit
, int inNumSamples
);
489 void eq_ka(BinaryOpUGen
*unit
, int inNumSamples
);
490 void eq_ai(BinaryOpUGen
*unit
, int inNumSamples
);
491 void eq_ia(BinaryOpUGen
*unit
, int inNumSamples
);
492 void neq_d(BinaryOpUGen
*unit
, int inNumSamples
);
493 void neq_1(BinaryOpUGen
*unit
, int inNumSamples
);
494 void neq_aa(BinaryOpUGen
*unit
, int inNumSamples
);
495 void neq_ak(BinaryOpUGen
*unit
, int inNumSamples
);
496 void neq_ka(BinaryOpUGen
*unit
, int inNumSamples
);
497 void neq_ai(BinaryOpUGen
*unit
, int inNumSamples
);
498 void neq_ia(BinaryOpUGen
*unit
, int inNumSamples
);
499 void sumsqr_d(BinaryOpUGen
*unit
, int inNumSamples
);
500 void sumsqr_1(BinaryOpUGen
*unit
, int inNumSamples
);
501 void sumsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
);
502 void sumsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
);
503 void sumsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
);
504 void sumsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
);
505 void sumsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
);
506 void difsqr_d(BinaryOpUGen
*unit
, int inNumSamples
);
507 void difsqr_1(BinaryOpUGen
*unit
, int inNumSamples
);
508 void difsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
);
509 void difsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
);
510 void difsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
);
511 void difsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
);
512 void difsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
);
513 void sqrsum_d(BinaryOpUGen
*unit
, int inNumSamples
);
514 void sqrsum_1(BinaryOpUGen
*unit
, int inNumSamples
);
515 void sqrsum_aa(BinaryOpUGen
*unit
, int inNumSamples
);
516 void sqrsum_ak(BinaryOpUGen
*unit
, int inNumSamples
);
517 void sqrsum_ka(BinaryOpUGen
*unit
, int inNumSamples
);
518 void sqrsum_ai(BinaryOpUGen
*unit
, int inNumSamples
);
519 void sqrsum_ia(BinaryOpUGen
*unit
, int inNumSamples
);
520 void sqrdif_d(BinaryOpUGen
*unit
, int inNumSamples
);
521 void sqrdif_1(BinaryOpUGen
*unit
, int inNumSamples
);
522 void sqrdif_aa(BinaryOpUGen
*unit
, int inNumSamples
);
523 void sqrdif_ak(BinaryOpUGen
*unit
, int inNumSamples
);
524 void sqrdif_ka(BinaryOpUGen
*unit
, int inNumSamples
);
525 void sqrdif_ai(BinaryOpUGen
*unit
, int inNumSamples
);
526 void sqrdif_ia(BinaryOpUGen
*unit
, int inNumSamples
);
527 void absdif_d(BinaryOpUGen
*unit
, int inNumSamples
);
528 void absdif_1(BinaryOpUGen
*unit
, int inNumSamples
);
529 void absdif_aa(BinaryOpUGen
*unit
, int inNumSamples
);
530 void absdif_ak(BinaryOpUGen
*unit
, int inNumSamples
);
531 void absdif_ka(BinaryOpUGen
*unit
, int inNumSamples
);
532 void absdif_ai(BinaryOpUGen
*unit
, int inNumSamples
);
533 void absdif_ia(BinaryOpUGen
*unit
, int inNumSamples
);
534 void round_d(BinaryOpUGen
*unit
, int inNumSamples
);
535 void round_1(BinaryOpUGen
*unit
, int inNumSamples
);
536 void round_aa(BinaryOpUGen
*unit
, int inNumSamples
);
537 void round_ak(BinaryOpUGen
*unit
, int inNumSamples
);
538 void round_ka(BinaryOpUGen
*unit
, int inNumSamples
);
539 void round_ai(BinaryOpUGen
*unit
, int inNumSamples
);
540 void round_ia(BinaryOpUGen
*unit
, int inNumSamples
);
541 void roundUp_d(BinaryOpUGen
*unit
, int inNumSamples
);
542 void roundUp_1(BinaryOpUGen
*unit
, int inNumSamples
);
543 void roundUp_aa(BinaryOpUGen
*unit
, int inNumSamples
);
544 void roundUp_ak(BinaryOpUGen
*unit
, int inNumSamples
);
545 void roundUp_ka(BinaryOpUGen
*unit
, int inNumSamples
);
546 void roundUp_ai(BinaryOpUGen
*unit
, int inNumSamples
);
547 void roundUp_ia(BinaryOpUGen
*unit
, int inNumSamples
);
548 void trunc_d(BinaryOpUGen
*unit
, int inNumSamples
);
549 void trunc_1(BinaryOpUGen
*unit
, int inNumSamples
);
550 void trunc_aa(BinaryOpUGen
*unit
, int inNumSamples
);
551 void trunc_ak(BinaryOpUGen
*unit
, int inNumSamples
);
552 void trunc_ka(BinaryOpUGen
*unit
, int inNumSamples
);
553 void trunc_ai(BinaryOpUGen
*unit
, int inNumSamples
);
554 void trunc_ia(BinaryOpUGen
*unit
, int inNumSamples
);
555 void atan2_d(BinaryOpUGen
*unit
, int inNumSamples
);
556 void atan2_1(BinaryOpUGen
*unit
, int inNumSamples
);
557 void atan2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
558 void atan2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
559 void atan2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
560 void atan2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
561 void atan2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
562 void hypot_d(BinaryOpUGen
*unit
, int inNumSamples
);
563 void hypot_1(BinaryOpUGen
*unit
, int inNumSamples
);
564 void hypot_aa(BinaryOpUGen
*unit
, int inNumSamples
);
565 void hypot_ak(BinaryOpUGen
*unit
, int inNumSamples
);
566 void hypot_ka(BinaryOpUGen
*unit
, int inNumSamples
);
567 void hypot_ai(BinaryOpUGen
*unit
, int inNumSamples
);
568 void hypot_ia(BinaryOpUGen
*unit
, int inNumSamples
);
569 void hypotx_d(BinaryOpUGen
*unit
, int inNumSamples
);
570 void hypotx_1(BinaryOpUGen
*unit
, int inNumSamples
);
571 void hypotx_aa(BinaryOpUGen
*unit
, int inNumSamples
);
572 void hypotx_ak(BinaryOpUGen
*unit
, int inNumSamples
);
573 void hypotx_ka(BinaryOpUGen
*unit
, int inNumSamples
);
574 void hypotx_ai(BinaryOpUGen
*unit
, int inNumSamples
);
575 void hypotx_ia(BinaryOpUGen
*unit
, int inNumSamples
);
578 ////////////////////////////////////////////////////////////////////////////////////////////////////////
580 static bool ChooseOperatorFunc(BinaryOpUGen
*unit
);
582 void BinaryOpUGen_Ctor(BinaryOpUGen
*unit
)
584 unit
->mPrevA
= ZIN0(0);
585 unit
->mPrevB
= ZIN0(1);
586 bool initialized
= ChooseOperatorFunc(unit
);
587 if (unit
->mCalcRate
== calc_DemandRate
) {
591 (unit
->mCalcFunc
)(unit
, 1);
596 void zero_d(BinaryOpUGen *unit, int inNumSamples)
599 float a = DEMANDINPUT_A(0, inNumSamples);
600 float b = DEMANDINPUT_A(1, inNumSamples);
601 OUT0(0) = sc_isnan(a) || sc_isnan(b) ? NAN : 0.f;
609 void firstarg_d(BinaryOpUGen
*unit
, int inNumSamples
)
612 float a
= DEMANDINPUT_A(0, inNumSamples
);
613 float b
= DEMANDINPUT_A(1, inNumSamples
);
614 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
;
621 void secondarg_d(BinaryOpUGen
*unit
, int inNumSamples
)
624 float a
= DEMANDINPUT_A(0, inNumSamples
);
625 float b
= DEMANDINPUT_A(1, inNumSamples
);
626 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: b
;
633 void add_d(BinaryOpUGen
*unit
, int inNumSamples
)
636 float a
= DEMANDINPUT_A(0, inNumSamples
);
637 float b
= DEMANDINPUT_A(1, inNumSamples
);
638 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
+ b
;
645 void sub_d(BinaryOpUGen
*unit
, int inNumSamples
)
648 float a
= DEMANDINPUT_A(0, inNumSamples
);
649 float b
= DEMANDINPUT_A(1, inNumSamples
);
650 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
- b
;
657 void mul_d(BinaryOpUGen
*unit
, int inNumSamples
)
660 float a
= DEMANDINPUT_A(0, inNumSamples
);
661 float b
= DEMANDINPUT_A(1, inNumSamples
);
662 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* b
;
669 void div_d(BinaryOpUGen
*unit
, int inNumSamples
)
672 float a
= DEMANDINPUT_A(0, inNumSamples
);
673 float b
= DEMANDINPUT_A(1, inNumSamples
);
674 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
/ b
;
681 void mod_d(BinaryOpUGen
*unit
, int inNumSamples
)
684 float a
= DEMANDINPUT_A(0, inNumSamples
);
685 float b
= DEMANDINPUT_A(1, inNumSamples
);
686 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_mod(a
, b
);
693 void max_d(BinaryOpUGen
*unit
, int inNumSamples
)
696 float a
= DEMANDINPUT_A(0, inNumSamples
);
697 float b
= DEMANDINPUT_A(1, inNumSamples
);
698 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_max(a
, b
);
705 void min_d(BinaryOpUGen
*unit
, int inNumSamples
)
708 float a
= DEMANDINPUT_A(0, inNumSamples
);
709 float b
= DEMANDINPUT_A(1, inNumSamples
);
710 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_min(a
, b
);
717 void and_d(BinaryOpUGen
*unit
, int inNumSamples
)
720 float a
= DEMANDINPUT_A(0, inNumSamples
);
721 float b
= DEMANDINPUT_A(1, inNumSamples
);
722 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_andt(a
, b
);
729 void or_d(BinaryOpUGen
*unit
, int inNumSamples
)
732 float a
= DEMANDINPUT_A(0, inNumSamples
);
733 float b
= DEMANDINPUT_A(1, inNumSamples
);
734 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_ort(a
, b
);
741 void xor_d(BinaryOpUGen
*unit
, int inNumSamples
)
744 float a
= DEMANDINPUT_A(0, inNumSamples
);
745 float b
= DEMANDINPUT_A(1, inNumSamples
);
746 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_xort(a
, b
);
753 void rightShift_d(BinaryOpUGen
*unit
, int inNumSamples
)
756 float a
= DEMANDINPUT_A(0, inNumSamples
);
757 float b
= DEMANDINPUT_A(1, inNumSamples
);
758 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_rst(a
, b
);
765 void leftShift_d(BinaryOpUGen
*unit
, int inNumSamples
)
768 float a
= DEMANDINPUT_A(0, inNumSamples
);
769 float b
= DEMANDINPUT_A(1, inNumSamples
);
770 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_lst(a
, b
);
777 void amclip_d(BinaryOpUGen
*unit
, int inNumSamples
)
780 float a
= DEMANDINPUT_A(0, inNumSamples
);
781 float b
= DEMANDINPUT_A(1, inNumSamples
);
782 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_amclip(a
, b
);
789 void scaleneg_d(BinaryOpUGen
*unit
, int inNumSamples
)
792 float a
= DEMANDINPUT_A(0, inNumSamples
);
793 float b
= DEMANDINPUT_A(1, inNumSamples
);
794 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_scaleneg(a
, b
);
801 void pow_d(BinaryOpUGen
*unit
, int inNumSamples
)
804 float a
= DEMANDINPUT_A(0, inNumSamples
);
805 float b
= DEMANDINPUT_A(1, inNumSamples
);
806 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
< 0.f
? -pow(-a
, b
) : pow(a
, b
));
813 void ring1_d(BinaryOpUGen
*unit
, int inNumSamples
)
816 float a
= DEMANDINPUT_A(0, inNumSamples
);
817 float b
= DEMANDINPUT_A(1, inNumSamples
);
818 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* b
+ a
;
825 void ring2_d(BinaryOpUGen
*unit
, int inNumSamples
)
828 float a
= DEMANDINPUT_A(0, inNumSamples
);
829 float b
= DEMANDINPUT_A(1, inNumSamples
);
830 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* b
+ a
+ b
;
837 void ring3_d(BinaryOpUGen
*unit
, int inNumSamples
)
840 float a
= DEMANDINPUT_A(0, inNumSamples
);
841 float b
= DEMANDINPUT_A(1, inNumSamples
);
842 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
* b
;
849 void ring4_d(BinaryOpUGen
*unit
, int inNumSamples
)
852 float a
= DEMANDINPUT_A(0, inNumSamples
);
853 float b
= DEMANDINPUT_A(1, inNumSamples
);
854 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
* b
- a
* b
* b
;
861 void thresh_d(BinaryOpUGen
*unit
, int inNumSamples
)
864 float a
= DEMANDINPUT_A(0, inNumSamples
);
865 float b
= DEMANDINPUT_A(1, inNumSamples
);
866 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_thresh(a
, b
);
873 void clip2_d(BinaryOpUGen
*unit
, int inNumSamples
)
876 float a
= DEMANDINPUT_A(0, inNumSamples
);
877 float b
= DEMANDINPUT_A(1, inNumSamples
);
878 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_clip2(a
, b
);
885 void excess_d(BinaryOpUGen
*unit
, int inNumSamples
)
888 float a
= DEMANDINPUT_A(0, inNumSamples
);
889 float b
= DEMANDINPUT_A(1, inNumSamples
);
890 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_excess(a
, b
);
897 void lt_d(BinaryOpUGen
*unit
, int inNumSamples
)
900 float a
= DEMANDINPUT_A(0, inNumSamples
);
901 float b
= DEMANDINPUT_A(1, inNumSamples
);
902 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
< b
? 1.f
: 0.f
);
909 void gt_d(BinaryOpUGen
*unit
, int inNumSamples
)
912 float a
= DEMANDINPUT_A(0, inNumSamples
);
913 float b
= DEMANDINPUT_A(1, inNumSamples
);
914 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
> b
? 1.f
: 0.f
);
921 void le_d(BinaryOpUGen
*unit
, int inNumSamples
)
924 float a
= DEMANDINPUT_A(0, inNumSamples
);
925 float b
= DEMANDINPUT_A(1, inNumSamples
);
926 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
<= b
? 1.f
: 0.f
);
933 void ge_d(BinaryOpUGen
*unit
, int inNumSamples
)
936 float a
= DEMANDINPUT_A(0, inNumSamples
);
937 float b
= DEMANDINPUT_A(1, inNumSamples
);
938 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
>= b
? 1.f
: 0.f
);
945 void eq_d(BinaryOpUGen
*unit
, int inNumSamples
)
948 float a
= DEMANDINPUT_A(0, inNumSamples
);
949 float b
= DEMANDINPUT_A(1, inNumSamples
);
950 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
== b
? 1.f
: 0.f
);
957 void neq_d(BinaryOpUGen
*unit
, int inNumSamples
)
960 float a
= DEMANDINPUT_A(0, inNumSamples
);
961 float b
= DEMANDINPUT_A(1, inNumSamples
);
962 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
!= b
? 1.f
: 0.f
);
969 void sumsqr_d(BinaryOpUGen
*unit
, int inNumSamples
)
972 float a
= DEMANDINPUT_A(0, inNumSamples
);
973 float b
= DEMANDINPUT_A(1, inNumSamples
);
974 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
+ b
* b
;
981 void difsqr_d(BinaryOpUGen
*unit
, int inNumSamples
)
984 float a
= DEMANDINPUT_A(0, inNumSamples
);
985 float b
= DEMANDINPUT_A(1, inNumSamples
);
986 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
- b
* b
;
993 void sqrsum_d(BinaryOpUGen
*unit
, int inNumSamples
)
996 float a
= DEMANDINPUT_A(0, inNumSamples
);
997 float b
= DEMANDINPUT_A(1, inNumSamples
);
999 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (z
= a
+ b
, z
* z
);
1006 void sqrdif_d(BinaryOpUGen
*unit
, int inNumSamples
)
1009 float a
= DEMANDINPUT_A(0, inNumSamples
);
1010 float b
= DEMANDINPUT_A(1, inNumSamples
);
1012 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (z
= a
- b
, z
* z
);
1019 void absdif_d(BinaryOpUGen
*unit
, int inNumSamples
)
1022 float a
= DEMANDINPUT_A(0, inNumSamples
);
1023 float b
= DEMANDINPUT_A(1, inNumSamples
);
1024 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: fabs(a
- b
);
1031 void round_d(BinaryOpUGen
*unit
, int inNumSamples
)
1034 float a
= DEMANDINPUT_A(0, inNumSamples
);
1035 float b
= DEMANDINPUT_A(1, inNumSamples
);
1036 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_round(a
, b
);
1043 void roundUp_d(BinaryOpUGen
*unit
, int inNumSamples
)
1046 float a
= DEMANDINPUT_A(0, inNumSamples
);
1047 float b
= DEMANDINPUT_A(1, inNumSamples
);
1048 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_roundUp(a
, b
);
1055 void trunc_d(BinaryOpUGen
*unit
, int inNumSamples
)
1058 float a
= DEMANDINPUT_A(0, inNumSamples
);
1059 float b
= DEMANDINPUT_A(1, inNumSamples
);
1060 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_trunc(a
, b
);
1067 void fold2_d(BinaryOpUGen
*unit
, int inNumSamples
)
1070 float a
= DEMANDINPUT_A(0, inNumSamples
);
1071 float b
= DEMANDINPUT_A(1, inNumSamples
);
1072 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_fold2(a
, b
);
1079 void wrap2_d(BinaryOpUGen
*unit
, int inNumSamples
)
1082 float a
= DEMANDINPUT_A(0, inNumSamples
);
1083 float b
= DEMANDINPUT_A(1, inNumSamples
);
1084 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_wrap2(a
, b
);
1091 void atan2_d(BinaryOpUGen
*unit
, int inNumSamples
)
1094 float a
= DEMANDINPUT_A(0, inNumSamples
);
1095 float b
= DEMANDINPUT_A(1, inNumSamples
);
1096 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: atan2(a
, b
);
1103 void hypot_d(BinaryOpUGen
*unit
, int inNumSamples
)
1106 float a
= DEMANDINPUT_A(0, inNumSamples
);
1107 float b
= DEMANDINPUT_A(1, inNumSamples
);
1108 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: hypot(a
, b
);
1115 void hypotx_d(BinaryOpUGen
*unit
, int inNumSamples
)
1118 float a
= DEMANDINPUT_A(0, inNumSamples
);
1119 float b
= DEMANDINPUT_A(1, inNumSamples
);
1120 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_hypotx(a
, b
);
1129 void zero_1(BinaryOpUGen
*unit
, int inNumSamples
)
1134 void firstarg_1(BinaryOpUGen
*unit
, int inNumSamples
)
1139 void secondarg_1(BinaryOpUGen
*unit
, int inNumSamples
)
1144 void add_1(BinaryOpUGen
*unit
, int inNumSamples
)
1146 ZOUT0(0) = ZIN0(0) + ZIN0(1);
1149 void sub_1(BinaryOpUGen
*unit
, int inNumSamples
)
1151 ZOUT0(0) = ZIN0(0) - ZIN0(1);
1154 void mul_1(BinaryOpUGen
*unit
, int inNumSamples
)
1156 ZOUT0(0) = ZIN0(0) * ZIN0(1);
1159 void div_1(BinaryOpUGen
*unit
, int inNumSamples
)
1161 ZOUT0(0) = ZIN0(0) / ZIN0(1);
1164 void mod_1(BinaryOpUGen
*unit
, int inNumSamples
)
1168 ZOUT0(0) = sc_mod(xa
, xb
);
1171 void max_1(BinaryOpUGen
*unit
, int inNumSamples
)
1175 ZOUT0(0) = sc_max(xa
, xb
);
1178 void min_1(BinaryOpUGen
*unit
, int inNumSamples
)
1182 ZOUT0(0) = sc_min(xa
, xb
);
1185 void and_1(BinaryOpUGen
*unit
, int inNumSamples
)
1189 ZOUT0(0) = sc_andt(xa
, xb
);
1192 void or_1(BinaryOpUGen
*unit
, int inNumSamples
)
1196 ZOUT0(0) = sc_ort(xa
, xb
);
1199 void xor_1(BinaryOpUGen
*unit
, int inNumSamples
)
1203 ZOUT0(0) = sc_xort(xa
, xb
);
1206 void rightShift_1(BinaryOpUGen
*unit
, int inNumSamples
)
1210 ZOUT0(0) = sc_rst(xa
, xb
);
1213 void leftShift_1(BinaryOpUGen
*unit
, int inNumSamples
)
1217 ZOUT0(0) = sc_lst(xa
, xb
);
1220 void amclip_1(BinaryOpUGen
*unit
, int inNumSamples
)
1224 ZOUT0(0) = sc_amclip(xa
, xb
);
1227 void scaleneg_1(BinaryOpUGen
*unit
, int inNumSamples
)
1231 ZOUT0(0) = xa
>= 0.f
? xa
: xa
* xb
;
1234 void pow_1(BinaryOpUGen
*unit
, int inNumSamples
)
1238 ZOUT0(0) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
1242 void ring1_1(BinaryOpUGen
*unit
, int inNumSamples
)
1246 ZOUT0(0) = xa
* xb
+ xa
;
1249 void ring2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1253 ZOUT0(0) = xa
* xb
+ xa
+ xb
;
1256 void ring3_1(BinaryOpUGen
*unit
, int inNumSamples
)
1260 ZOUT0(0) = xa
* xa
* xb
;
1263 void ring4_1(BinaryOpUGen
*unit
, int inNumSamples
)
1267 ZOUT0(0) = xa
* xa
* xb
- xa
* xb
* xb
;
1270 void thresh_1(BinaryOpUGen
*unit
, int inNumSamples
)
1274 ZOUT0(0) = xa
< xb
? 0.f
: xa
;
1277 void clip2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1281 ZOUT0(0) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
1284 void excess_1(BinaryOpUGen
*unit
, int inNumSamples
)
1288 ZOUT0(0) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
1291 void lt_1(BinaryOpUGen
*unit
, int inNumSamples
)
1295 ZOUT0(0) = xa
< xb
? 1.f
: 0.f
;
1298 void le_1(BinaryOpUGen
*unit
, int inNumSamples
)
1302 ZOUT0(0) = xa
<= xb
? 1.f
: 0.f
;
1305 void gt_1(BinaryOpUGen
*unit
, int inNumSamples
)
1309 ZOUT0(0) = xa
> xb
? 1.f
: 0.f
;
1312 void ge_1(BinaryOpUGen
*unit
, int inNumSamples
)
1316 ZOUT0(0) = xa
>= xb
? 1.f
: 0.f
;
1319 void eq_1(BinaryOpUGen
*unit
, int inNumSamples
)
1323 ZOUT0(0) = xa
== xb
? 1.f
: 0.f
;
1326 void neq_1(BinaryOpUGen
*unit
, int inNumSamples
)
1330 ZOUT0(0) = xa
!= xb
? 1.f
: 0.f
;
1334 void sumsqr_1(BinaryOpUGen
*unit
, int inNumSamples
)
1338 ZOUT0(0) = xa
* xa
+ xb
* xb
;
1341 void difsqr_1(BinaryOpUGen
*unit
, int inNumSamples
)
1345 ZOUT0(0) = xa
* xa
- xb
* xb
;
1348 void sqrsum_1(BinaryOpUGen
*unit
, int inNumSamples
)
1352 float sum
= xa
+ xb
;
1353 ZOUT0(0) = sum
* sum
;
1356 void sqrdif_1(BinaryOpUGen
*unit
, int inNumSamples
)
1360 float dif
= xa
- xb
;
1361 ZOUT0(0) = dif
* dif
;
1364 void absdif_1(BinaryOpUGen
*unit
, int inNumSamples
)
1368 ZOUT0(0) = fabs(xa
- xb
);
1371 void round_1(BinaryOpUGen
*unit
, int inNumSamples
)
1375 ZOUT0(0) = sc_round(xa
, xb
);
1378 void roundUp_1(BinaryOpUGen
*unit
, int inNumSamples
)
1382 ZOUT0(0) = sc_roundUp(xa
, xb
);
1385 void trunc_1(BinaryOpUGen
*unit
, int inNumSamples
)
1389 ZOUT0(0) = sc_trunc(xa
, xb
);
1392 void fold2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1396 ZOUT0(0) = sc_fold(xa
, -xb
, xb
);
1399 void wrap2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1403 ZOUT0(0) = sc_wrap(xa
, -xb
, xb
);
1406 void atan2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1410 ZOUT0(0) = atan2(xa
, xb
);
1413 void hypot_1(BinaryOpUGen
*unit
, int inNumSamples
)
1417 ZOUT0(0) = hypot(xa
, xb
);
1420 void hypotx_1(BinaryOpUGen
*unit
, int inNumSamples
)
1424 ZOUT0(0) = sc_hypotx(xa
, xb
);
1429 void zero_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1431 float *out
= OUT(0);
1433 ZClear(inNumSamples
, out
);
1436 void firstarg_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1438 float *out
= OUT(0);
1441 ZCopy(inNumSamples
, out
, a
);
1445 inline_functions
void firstarg_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1447 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1451 void secondarg_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1453 float *out
= OUT(0);
1456 ZCopy(inNumSamples
, out
, b
);
1460 inline_functions
void secondarg_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1462 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1466 void add_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1468 float *out
= ZOUT(0);
1473 ZXP(out
) = ZXP(a
) + ZXP(b
);
1477 void add_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1479 float *out
= ZOUT(0);
1481 float xb
= unit
->mPrevB
;
1482 float next_b
= ZIN0(1);
1486 ZCopy(inNumSamples
, out
, a
);
1488 float *out
= ZOUT(0);
1491 ZXP(out
) = ZXP(a
) + xb
;
1495 float slope
= CALCSLOPE(next_b
, xb
);
1497 ZXP(out
) = ZXP(a
) + xb
;
1505 void add_ka(BinaryOpUGen
*unit
, int inNumSamples
)
1507 float *out
= ZOUT(0);
1508 float xa
= unit
->mPrevA
;
1510 float next_a
= ZIN0(0);
1514 ZCopy(inNumSamples
, out
, b
);
1517 ZXP(out
) = xa
+ ZXP(b
);
1521 float slope
= CALCSLOPE(next_a
, xa
);
1523 ZXP(out
) = xa
+ ZXP(b
);
1530 void add_ia(BinaryOpUGen
*unit
, int inNumSamples
)
1532 float *out
= ZOUT(0);
1537 ZXP(out
) = xa
+ ZXP(b
);
1542 void add_ai(BinaryOpUGen
*unit
, int inNumSamples
)
1544 float *out
= ZOUT(0);
1549 ZXP(out
) = ZXP(a
) + xb
;
1555 NOVA_BINARY_WRAPPER(add
, plus
)
1557 inline_functions
void add_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1559 float xb
= unit
->mPrevB
;
1560 float next_b
= ZIN0(1);
1564 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1566 nova::plus_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
1568 float slope
= CALCSLOPE(next_b
, xb
);
1569 nova::plus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1570 unit
->mPrevB
= next_b
;
1574 inline_functions
void add_ak_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1576 float xb
= unit
->mPrevB
;
1577 float next_b
= ZIN0(1);
1581 nova::copyvec_simd
<64>(OUT(0), IN(0));
1583 nova::plus_vec_simd
<64>(OUT(0), IN(0), xb
);
1585 float slope
= CALCSLOPE(next_b
, xb
);
1586 nova::plus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1587 unit
->mPrevB
= next_b
;
1592 inline_functions
void add_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1594 float xa
= unit
->mPrevA
;
1595 float next_a
= ZIN0(0);
1599 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1601 nova::plus_vec_simd(OUT(0), IN(1), xa
, inNumSamples
);
1603 float slope
= CALCSLOPE(next_a
, xa
);
1604 nova::plus_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1605 unit
->mPrevA
= next_a
;
1609 inline_functions
void add_ka_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1611 float xa
= unit
->mPrevA
;
1612 float next_a
= ZIN0(0);
1616 nova::copyvec_simd
<64>(OUT(0), IN(1));
1618 nova::plus_vec_simd
<64>(OUT(0), IN(1), xa
);
1620 float slope
= CALCSLOPE(next_a
, xa
);
1621 nova::plus_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1622 unit
->mPrevA
= next_a
;
1630 /////////////////////////
1634 void sub_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1636 float *out
= ZOUT(0);
1641 ZXP(out
) = ZXP(a
) - ZXP(b
);
1645 void sub_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1647 float *out
= ZOUT(0);
1649 float xb
= unit
->mPrevB
;
1650 float next_b
= ZIN0(1);
1654 ZCopy(inNumSamples
, out
, a
);
1657 ZXP(out
) = ZXP(a
) - xb
;
1661 float slope
= CALCSLOPE(next_b
, xb
);
1663 ZXP(out
) = ZXP(a
) - xb
;
1670 void sub_ka(BinaryOpUGen
*unit
, int inNumSamples
)
1672 float *out
= ZOUT(0);
1673 float xa
= unit
->mPrevA
;
1675 float next_a
= ZIN0(0);
1679 ZCopy(inNumSamples
, out
, b
);
1682 ZXP(out
) = xa
- ZXP(b
);
1686 float slope
= CALCSLOPE(next_a
, xa
);
1688 ZXP(out
) = xa
- ZXP(b
);
1696 void sub_ia(BinaryOpUGen
*unit
, int inNumSamples
)
1698 float *out
= ZOUT(0);
1703 ZXP(out
) = xa
- ZXP(b
);
1708 void sub_ai(BinaryOpUGen
*unit
, int inNumSamples
)
1710 float *out
= ZOUT(0);
1715 ZXP(out
) = ZXP(a
) - xb
;
1721 NOVA_BINARY_WRAPPER(sub
, minus
)
1723 inline_functions
void sub_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1725 float xb
= unit
->mPrevB
;
1726 float next_b
= ZIN0(1);
1730 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1732 nova::minus_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
1734 float slope
= CALCSLOPE(next_b
, xb
);
1735 nova::minus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1736 unit
->mPrevB
= next_b
;
1740 inline_functions
void sub_ak_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1742 float xb
= unit
->mPrevB
;
1743 float next_b
= ZIN0(1);
1747 nova::copyvec_aa_simd
<64>(OUT(0), IN(0));
1749 nova::minus_vec_simd
<64>(OUT(0), IN(0), xb
);
1751 float slope
= CALCSLOPE(next_b
, xb
);
1752 nova::minus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1753 unit
->mPrevB
= next_b
;
1757 inline_functions
void sub_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1759 float xa
= unit
->mPrevA
;
1760 float next_a
= ZIN0(0);
1764 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1766 nova::minus_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
1768 float slope
= CALCSLOPE(next_a
, xa
);
1769 nova::minus_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
1770 unit
->mPrevA
= next_a
;
1774 inline_functions
void sub_ka_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1776 float xa
= unit
->mPrevA
;
1777 float next_a
= ZIN0(0);
1781 nova::copyvec_simd
<64>(OUT(0), IN(1));
1783 nova::minus_vec_simd
<64>(OUT(0), xa
, IN(1));
1785 float slope
= CALCSLOPE(next_a
, xa
);
1786 nova::minus_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
1787 unit
->mPrevA
= next_a
;
1795 void mul_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1797 float *out
= ZOUT(0);
1802 ZXP(out
) = ZXP(a
) * ZXP(b
);
1806 void mul_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1808 float *out
= ZOUT(0);
1810 float xb
= unit
->mPrevB
;
1811 float next_b
= ZIN0(1);
1815 ZClear(inNumSamples
, out
);
1816 } else if (xb
== 1.f
) {
1817 ZCopy(inNumSamples
, out
, a
);
1820 ZXP(out
) = ZXP(a
) * xb
;
1824 float slope
= CALCSLOPE(next_b
, xb
);
1826 ZXP(out
) = ZXP(a
) * xb
;
1833 void mul_ka(BinaryOpUGen
*unit
, int inNumSamples
)
1835 float *out
= ZOUT(0);
1836 float xa
= unit
->mPrevA
;
1838 float next_a
= ZIN0(0);
1842 ZClear(inNumSamples
, out
);
1843 } else if (xa
== 1.f
) {
1844 ZCopy(inNumSamples
, out
, b
);
1847 ZXP(out
) = xa
* ZXP(b
);
1851 float slope
= CALCSLOPE(next_a
, xa
);
1853 ZXP(out
) = xa
* ZXP(b
);
1861 void mul_ai(BinaryOpUGen
*unit
, int inNumSamples
)
1863 float *out
= ZOUT(0);
1868 ZXP(out
) = ZXP(a
) * xb
;
1873 void mul_ia(BinaryOpUGen
*unit
, int inNumSamples
)
1875 float *out
= ZOUT(0);
1880 ZXP(out
) = xa
* ZXP(b
);
1886 NOVA_BINARY_WRAPPER(mul
, times
)
1888 inline_functions
void mul_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1890 float xa
= unit
->mPrevA
;
1891 float next_a
= ZIN0(0);
1895 nova::zerovec_simd(OUT(0), inNumSamples
);
1897 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1899 nova::times_vec_simd(OUT(0), IN(1), xa
, inNumSamples
);
1901 float slope
= CALCSLOPE(next_a
, xa
);
1902 unit
->mPrevA
= next_a
;
1904 nova::times_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1908 inline_functions
void mul_ka_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1910 float xa
= unit
->mPrevA
;
1911 float next_a
= ZIN0(0);
1915 nova::zerovec_simd
<64>(OUT(0));
1917 nova::copyvec_simd
<64>(OUT(0), IN(1));
1919 nova::times_vec_simd
<64>(OUT(0), IN(1), xa
);
1921 float slope
= CALCSLOPE(next_a
, xa
);
1922 unit
->mPrevA
= next_a
;
1924 nova::times_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1928 inline_functions
void mul_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1930 float xb
= unit
->mPrevB
;
1931 float next_b
= ZIN0(1);
1935 nova::zerovec_simd(OUT(0), inNumSamples
);
1937 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1939 nova::times_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
1941 float slope
= CALCSLOPE(next_b
, xb
);
1942 unit
->mPrevB
= next_b
;
1944 nova::times_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1948 inline_functions
void mul_ak_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1950 float xb
= unit
->mPrevB
;
1951 float next_b
= ZIN0(1);
1955 nova::zerovec_simd
<64>(OUT(0));
1957 nova::copyvec_simd
<64>(OUT(0), IN(0));
1959 nova::times_vec_simd
<64>(OUT(0), IN(0), xb
);
1961 float slope
= CALCSLOPE(next_b
, xb
);
1962 unit
->mPrevB
= next_b
;
1964 nova::times_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1971 void div_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1973 float *out
= ZOUT(0);
1978 ZXP(out
) = ZXP(a
) / ZXP(b
);
1982 void div_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1984 float *out
= ZOUT(0);
1986 float xb
= unit
->mPrevB
;
1987 float next_b
= ZIN0(1);
1991 ZClear(inNumSamples
, out
);
1992 } else if (xb
== 1.f
) {
1993 ZCopy(inNumSamples
, out
, a
);
1995 float recip
= 1.f
/ xb
;
1997 ZXP(out
) = ZXP(a
) * recip
;
2001 float slope
= CALCSLOPE(next_b
, xb
);
2003 ZXP(out
) = ZXP(a
) / xb
;
2010 void div_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2012 float *out
= ZOUT(0);
2013 float xa
= unit
->mPrevA
;
2015 float next_a
= ZIN0(0);
2019 ZClear(inNumSamples
, out
);
2022 ZXP(out
) = xa
/ ZXP(b
);
2026 float slope
= CALCSLOPE(next_a
, xa
);
2028 ZXP(out
) = xa
/ ZXP(b
);
2035 void div_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2037 float *out
= ZOUT(0);
2042 ZXP(out
) = xa
/ ZXP(b
);
2048 void div_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2050 float *out
= ZOUT(0);
2054 float rxb
= 1.f
/ xb
;
2056 ZXP(out
) = ZXP(a
) * rxb
;
2062 inline_functions
void div_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2064 nova::over_vec_simd(OUT(0), IN(0), IN(1), inNumSamples
);
2067 inline_functions
void div_ia_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2071 nova::over_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
2075 inline_functions
void div_ai_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2079 nova::times_vec_simd(OUT(0), IN(0), 1.f
/xb
, inNumSamples
);
2083 inline_functions
void div_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2085 float xb
= unit
->mPrevB
;
2086 float next_b
= ZIN0(1);
2090 nova::zerovec_simd(OUT(0), inNumSamples
);
2092 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
2094 float recip
= 1.f
/ xb
;
2095 nova::times_vec_simd(OUT(0), IN(0), recip
, inNumSamples
);
2098 float slope
= CALCSLOPE(next_b
, xb
);
2099 nova::over_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
2100 unit
->mPrevB
= next_b
;
2104 inline_functions
void div_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2106 float xa
= unit
->mPrevA
;
2107 float next_a
= ZIN0(0);
2111 nova::zerovec_simd(OUT(0), inNumSamples
);
2113 nova::over_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
2115 float slope
= CALCSLOPE(next_a
, xa
);
2116 nova::over_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
2127 void mod_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2129 float *out
= ZOUT(0);
2136 ZXP(out
) = sc_mod(xa
, xb
);
2140 void mod_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2142 float *out
= ZOUT(0);
2144 float xb
= unit
->mPrevB
;
2145 float next_b
= ZIN0(1);
2149 ZCopy(inNumSamples
, out
, a
);
2152 ZXP(out
) = sc_mod(ZXP(a
), xb
);
2156 float slope
= CALCSLOPE(next_b
, xb
);
2158 ZXP(out
) = sc_mod(ZXP(a
), xb
);
2165 void mod_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2167 float *out
= ZOUT(0);
2168 float xa
= unit
->mPrevA
;
2170 float next_a
= ZIN0(0);
2174 ZClear(inNumSamples
, out
);
2177 ZXP(out
) = sc_mod(xa
, ZXP(b
));
2181 float slope
= CALCSLOPE(next_a
, xa
);
2183 ZXP(out
) = sc_mod(xa
, ZXP(b
));
2191 void mod_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2193 float *out
= ZOUT(0);
2198 ZXP(out
) = sc_mod(xa
, ZXP(b
));
2204 void mod_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2206 float *out
= ZOUT(0);
2211 ZXP(out
) = sc_mod(ZXP(a
), xb
);
2218 void max_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2220 float *out
= ZOUT(0);
2227 ZXP(out
) = sc_max(xa
, xb
);
2231 void max_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2233 float *out
= ZOUT(0);
2235 float xb
= unit
->mPrevB
;
2236 float next_b
= ZIN0(1);
2241 ZXP(out
) = sc_max(xa
, xb
);
2244 float slope
= CALCSLOPE(next_b
, xb
);
2247 ZXP(out
) = sc_max(xa
, xb
);
2254 void max_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2256 float *out
= ZOUT(0);
2257 float xa
= unit
->mPrevA
;
2259 float next_a
= ZIN0(0);
2264 ZXP(out
) = sc_max(xa
, xb
);
2267 float slope
= CALCSLOPE(next_a
, xa
);
2270 ZXP(out
) = sc_max(xa
, xb
);
2277 void max_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2279 float *out
= ZOUT(0);
2285 ZXP(out
) = sc_max(xa
, xb
);
2291 void max_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2293 float *out
= ZOUT(0);
2299 ZXP(out
) = sc_max(xa
, xb
);
2305 NOVA_BINARY_WRAPPER_K(max
, max
)
2311 void min_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2313 float *out
= ZOUT(0);
2320 ZXP(out
) = sc_min(xa
, xb
);
2324 void min_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2326 float *out
= ZOUT(0);
2328 float xb
= unit
->mPrevB
;
2329 float next_b
= ZIN0(1);
2334 ZXP(out
) = sc_min(xa
, xb
);
2337 float slope
= CALCSLOPE(next_b
, xb
);
2340 ZXP(out
) = sc_min(xa
, xb
);
2347 void min_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2349 float *out
= ZOUT(0);
2350 float xa
= unit
->mPrevA
;
2352 float next_a
= ZIN0(0);
2357 ZXP(out
) = sc_min(xa
, xb
);
2360 float slope
= CALCSLOPE(next_a
, xa
);
2363 ZXP(out
) = sc_min(xa
, xb
);
2370 void min_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2372 float *out
= ZOUT(0);
2378 ZXP(out
) = sc_min(xa
, xb
);
2384 void min_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2386 float *out
= ZOUT(0);
2392 ZXP(out
) = sc_min(xa
, xb
);
2399 NOVA_BINARY_WRAPPER_K(min
, min
)
2403 void and_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2405 float *out
= ZOUT(0);
2412 ZXP(out
) = sc_andt(xa
, xb
) ;
2416 void and_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2418 float *out
= ZOUT(0);
2420 float xb
= unit
->mPrevB
;
2421 float next_b
= ZIN0(1);
2426 ZXP(out
) = sc_andt(xa
, xb
);
2429 float slope
= CALCSLOPE(next_b
, xb
);
2432 ZXP(out
) = sc_andt(xa
, xb
);
2439 void and_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2441 float *out
= ZOUT(0);
2442 float xa
= unit
->mPrevA
;
2444 float next_a
= ZIN0(0);
2449 ZXP(out
) = sc_andt(xa
, xb
);
2452 float slope
= CALCSLOPE(next_a
, xa
);
2455 ZXP(out
) = sc_andt(xa
, xb
);
2462 void and_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2464 float *out
= ZOUT(0);
2470 ZXP(out
) = sc_andt(xa
, xb
);
2476 void and_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2478 float *out
= ZOUT(0);
2484 ZXP(out
) = sc_andt(xa
, xb
);
2495 void or_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2497 float *out
= ZOUT(0);
2504 ZXP(out
) = sc_ort(xa
, xb
) ;
2508 void or_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2510 float *out
= ZOUT(0);
2512 float xb
= unit
->mPrevB
;
2513 float next_b
= ZIN0(1);
2518 ZXP(out
) = sc_ort(xa
, xb
);
2521 float slope
= CALCSLOPE(next_b
, xb
);
2524 ZXP(out
) = sc_ort(xa
, xb
);
2531 void or_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2533 float *out
= ZOUT(0);
2534 float xa
= unit
->mPrevA
;
2536 float next_a
= ZIN0(0);
2541 ZXP(out
) = sc_ort(xa
, xb
);
2544 float slope
= CALCSLOPE(next_a
, xa
);
2547 ZXP(out
) = sc_ort(xa
, xb
);
2554 void or_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2556 float *out
= ZOUT(0);
2562 ZXP(out
) = sc_ort(xa
, xb
);
2568 void or_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2570 float *out
= ZOUT(0);
2576 ZXP(out
) = sc_ort(xa
, xb
);
2587 void xor_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2589 float *out
= ZOUT(0);
2596 ZXP(out
) = sc_xort(xa
, xb
) ;
2600 void xor_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2602 float *out
= ZOUT(0);
2604 float xb
= unit
->mPrevB
;
2605 float next_b
= ZIN0(1);
2610 ZXP(out
) = sc_xort(xa
, xb
);
2613 float slope
= CALCSLOPE(next_b
, xb
);
2616 ZXP(out
) = sc_xort(xa
, xb
);
2623 void xor_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2625 float *out
= ZOUT(0);
2626 float xa
= unit
->mPrevA
;
2628 float next_a
= ZIN0(0);
2633 ZXP(out
) = sc_xort(xa
, xb
);
2636 float slope
= CALCSLOPE(next_a
, xa
);
2639 ZXP(out
) = sc_xort(xa
, xb
);
2646 void xor_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2648 float *out
= ZOUT(0);
2654 ZXP(out
) = sc_xort(xa
, xb
);
2660 void xor_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2662 float *out
= ZOUT(0);
2668 ZXP(out
) = sc_xort(xa
, xb
);
2676 void rightShift_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2678 float *out
= ZOUT(0);
2685 ZXP(out
) = sc_rst(xa
, xb
) ;
2689 void rightShift_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2691 float *out
= ZOUT(0);
2693 float xb
= unit
->mPrevB
;
2694 float next_b
= ZIN0(1);
2699 ZXP(out
) = sc_rst(xa
, xb
);
2702 float slope
= CALCSLOPE(next_b
, xb
);
2705 ZXP(out
) = sc_rst(xa
, xb
);
2712 void rightShift_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2714 float *out
= ZOUT(0);
2715 float xa
= unit
->mPrevA
;
2717 float next_a
= ZIN0(0);
2722 ZXP(out
) = sc_rst(xa
, xb
);
2725 float slope
= CALCSLOPE(next_a
, xa
);
2728 ZXP(out
) = sc_rst(xa
, xb
);
2735 void rightShift_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2737 float *out
= ZOUT(0);
2743 ZXP(out
) = sc_rst(xa
, xb
);
2749 void rightShift_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2751 float *out
= ZOUT(0);
2757 ZXP(out
) = sc_rst(xa
, xb
);
2764 void leftShift_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2766 float *out
= ZOUT(0);
2773 ZXP(out
) = sc_lst(xa
, xb
) ;
2777 void leftShift_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2779 float *out
= ZOUT(0);
2781 float xb
= unit
->mPrevB
;
2782 float next_b
= ZIN0(1);
2787 ZXP(out
) = sc_lst(xa
, xb
);
2790 float slope
= CALCSLOPE(next_b
, xb
);
2793 ZXP(out
) = sc_lst(xa
, xb
);
2800 void leftShift_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2802 float *out
= ZOUT(0);
2803 float xa
= unit
->mPrevA
;
2805 float next_a
= ZIN0(0);
2810 ZXP(out
) = sc_lst(xa
, xb
);
2813 float slope
= CALCSLOPE(next_a
, xa
);
2816 ZXP(out
) = sc_lst(xa
, xb
);
2823 void leftShift_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2825 float *out
= ZOUT(0);
2831 ZXP(out
) = sc_lst(xa
, xb
);
2837 void leftShift_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2839 float *out
= ZOUT(0);
2845 ZXP(out
) = sc_lst(xa
, xb
);
2854 void amclip_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2856 float *out
= ZOUT(0);
2863 ZXP(out
) = sc_amclip(xa
, xb
);
2867 void amclip_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2869 float *out
= ZOUT(0);
2871 float xb
= unit
->mPrevB
;
2872 float next_b
= ZIN0(1);
2877 ZXP(out
) = ZXP(a
) * xb
;
2880 ZClear(inNumSamples
, out
);
2883 float slope
= CALCSLOPE(next_b
, xb
);
2886 ZXP(out
) = sc_amclip(xa
, xb
);
2893 void amclip_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2895 float *out
= ZOUT(0);
2896 float xa
= unit
->mPrevA
;
2898 float next_a
= ZIN0(0);
2903 ZXP(out
) = sc_amclip(xa
, xb
);
2906 float slope
= CALCSLOPE(next_a
, xa
);
2909 ZXP(out
) = sc_amclip(xa
, xb
);
2916 void amclip_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2918 float *out
= ZOUT(0);
2924 ZXP(out
) = sc_amclip(xa
, xb
);
2930 void amclip_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2932 float *out
= ZOUT(0);
2938 ZXP(out
) = sc_amclip(xa
, xb
);
2945 void scaleneg_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2947 float *out
= ZOUT(0);
2954 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
2958 void scaleneg_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2960 float *out
= ZOUT(0);
2962 float xb
= unit
->mPrevB
;
2963 float next_b
= ZIN0(1);
2968 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
2971 float slope
= CALCSLOPE(next_b
, xb
);
2974 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
2981 void scaleneg_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2983 float *out
= ZOUT(0);
2984 float xa
= unit
->mPrevA
;
2986 float next_a
= ZIN0(0);
2995 ZXP(out
) = xa
* ZXP(b
);
2999 float slope
= CALCSLOPE(next_a
, xa
);
3002 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
3009 void scaleneg_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3011 float *out
= ZOUT(0);
3017 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
3023 void scaleneg_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3025 float *out
= ZOUT(0);
3031 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
3039 void pow_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3041 float *out
= ZOUT(0);
3048 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3053 void pow_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3055 float *out
= ZOUT(0);
3057 float xb
= unit
->mPrevB
;
3058 float next_b
= ZIN0(1);
3063 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3066 float slope
= CALCSLOPE(next_b
, xb
);
3069 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3076 void pow_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3078 float *out
= ZOUT(0);
3079 float xa
= unit
->mPrevA
;
3081 float next_a
= ZIN0(0);
3087 ZXP(out
) = pow(xa
, xb
);
3092 ZXP(out
) = -pow(-xa
, xb
);
3096 float slope
= CALCSLOPE(next_a
, xa
);
3099 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3106 void pow_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3108 float *out
= ZOUT(0);
3114 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3120 void pow_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3122 float *out
= ZOUT(0);
3128 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3134 inline_functions
void pow_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3136 nova::spow_vec_simd(OUT(0), IN(0), IN(1), inNumSamples
);
3139 inline_functions
void pow_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3141 float *out
= ZOUT(0);
3143 float xb
= unit
->mPrevB
;
3144 float next_b
= ZIN0(1);
3147 nova::spow_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
3149 float slope
= CALCSLOPE(next_b
, xb
);
3152 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3159 inline_functions
void pow_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3161 float *out
= ZOUT(0);
3162 float xa
= unit
->mPrevA
;
3164 float next_a
= ZIN0(0);
3168 nova::pow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3170 nova::spow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3173 float slope
= CALCSLOPE(next_a
, xa
);
3176 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3184 inline_functions
void pow_ia_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3188 nova::pow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3190 nova::spow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3195 inline_functions
void pow_ai_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3198 nova::spow_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
3204 void ring1_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3206 float *out
= ZOUT(0);
3213 ZXP(out
) = xa
* xb
+ xa
;
3217 void ring1_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3219 float *out
= ZOUT(0);
3221 float xb
= unit
->mPrevB
;
3222 float next_b
= ZIN0(1);
3226 ZCopy(inNumSamples
, out
, a
);
3227 } else if (xb
== 1.f
) {
3235 ZXP(out
) = xa
* xb
+ xa
;
3239 float slope
= CALCSLOPE(next_b
, xb
);
3242 ZXP(out
) = xa
* xb
+ xa
;
3249 void ring1_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3251 float *out
= ZOUT(0);
3252 float xa
= unit
->mPrevA
;
3254 float next_a
= ZIN0(0);
3264 ZXP(out
) = xa
* xb
+ xa
;
3268 float slope
= CALCSLOPE(next_a
, xa
);
3271 ZXP(out
) = xa
* xb
+ xa
;
3278 void ring1_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3280 float *out
= ZOUT(0);
3286 ZXP(out
) = xa
* xb
+ xa
;
3292 void ring1_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3294 float *out
= ZOUT(0);
3300 ZXP(out
) = xa
* xb
+ xa
;
3308 void ring2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3310 float *out
= ZOUT(0);
3317 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3321 void ring2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3323 float *out
= ZOUT(0);
3325 float xb
= unit
->mPrevB
;
3326 float next_b
= ZIN0(1);
3330 ZCopy(inNumSamples
, out
, a
);
3334 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3338 float slope
= CALCSLOPE(next_b
, xb
);
3341 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3348 void ring2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3350 float *out
= ZOUT(0);
3351 float xa
= unit
->mPrevA
;
3353 float next_a
= ZIN0(0);
3357 ZCopy(inNumSamples
, out
, b
);
3361 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3365 float slope
= CALCSLOPE(next_a
, xa
);
3368 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3375 void ring2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3377 float *out
= ZOUT(0);
3383 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3389 void ring2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3391 float *out
= ZOUT(0);
3397 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3405 void ring3_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3407 float *out
= ZOUT(0);
3414 ZXP(out
) = xa
* xa
* xb
;
3418 void ring3_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3420 float *out
= ZOUT(0);
3422 float xb
= unit
->mPrevB
;
3423 float next_b
= ZIN0(1);
3427 ZClear(inNumSamples
, out
);
3428 } else if (xb
== 1.f
) {
3436 ZXP(out
) = xa
* xa
* xb
;
3440 float slope
= CALCSLOPE(next_b
, xb
);
3443 ZXP(out
) = xa
* xa
* xb
;
3450 void ring3_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3452 float *out
= ZOUT(0);
3453 float xa
= unit
->mPrevA
;
3455 float next_a
= ZIN0(0);
3459 ZClear(inNumSamples
, out
);
3460 } else if (xa
== 1.f
) {
3461 ZCopy(inNumSamples
, out
, b
);
3465 ZXP(out
) = xa
* xa
* xb
;
3469 float slope
= CALCSLOPE(next_a
, xa
);
3472 ZXP(out
) = xa
* xa
* xb
;
3479 void ring3_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3481 float *out
= ZOUT(0);
3487 ZXP(out
) = xa
* xa
* xb
;
3493 void ring3_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3495 float *out
= ZOUT(0);
3501 ZXP(out
) = xa
* xa
* xb
;
3508 void ring4_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3510 float *out
= ZOUT(0);
3517 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3521 void ring4_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3523 float *out
= ZOUT(0);
3525 float xb
= unit
->mPrevB
;
3526 float next_b
= ZIN0(1);
3530 ZClear(inNumSamples
, out
);
3531 } else if (xb
== 1.f
) {
3534 ZXP(out
) = xa
* xa
- xa
;
3539 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3543 float slope
= CALCSLOPE(next_b
, xb
);
3546 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3553 void ring4_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3555 float *out
= ZOUT(0);
3556 float xa
= unit
->mPrevA
;
3558 float next_a
= ZIN0(0);
3562 ZClear(inNumSamples
, out
);
3563 } else if (xa
== 1.f
) {
3566 ZXP(out
) = xb
- xb
* xb
;
3571 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3575 float slope
= CALCSLOPE(next_a
, xa
);
3578 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3585 void ring4_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3587 float *out
= ZOUT(0);
3593 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3599 void ring4_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3601 float *out
= ZOUT(0);
3607 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3614 void thresh_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3616 float *out
= ZOUT(0);
3623 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3627 void thresh_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3629 float *out
= ZOUT(0);
3631 float xb
= unit
->mPrevB
;
3632 float next_b
= ZIN0(1);
3637 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3640 float slope
= CALCSLOPE(next_b
, xb
);
3643 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3650 void thresh_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3652 float *out
= ZOUT(0);
3653 float xa
= unit
->mPrevA
;
3655 float next_a
= ZIN0(0);
3660 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3663 float slope
= CALCSLOPE(next_a
, xa
);
3666 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3673 void thresh_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3675 float *out
= ZOUT(0);
3681 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3687 void thresh_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3689 float *out
= ZOUT(0);
3695 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3702 void clip2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3704 float *out
= ZOUT(0);
3711 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3715 void clip2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3717 float *out
= ZOUT(0);
3719 float xb
= unit
->mPrevB
;
3720 float next_b
= ZIN0(1);
3725 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3728 float slope
= CALCSLOPE(next_b
, xb
);
3731 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3738 void clip2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3740 float *out
= ZOUT(0);
3741 float xa
= unit
->mPrevA
;
3743 float next_a
= ZIN0(0);
3748 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3751 float slope
= CALCSLOPE(next_a
, xa
);
3754 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3761 void clip2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3763 float *out
= ZOUT(0);
3769 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3775 void clip2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3777 float *out
= ZOUT(0);
3783 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3790 NOVA_BINARY_WRAPPER_K(clip2
, clip2
)
3794 void excess_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3796 float *out
= ZOUT(0);
3803 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3807 void excess_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3809 float *out
= ZOUT(0);
3811 float xb
= unit
->mPrevB
;
3812 float next_b
= ZIN0(1);
3817 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3820 float slope
= CALCSLOPE(next_b
, xb
);
3823 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3830 void excess_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3832 float *out
= ZOUT(0);
3833 float xa
= unit
->mPrevA
;
3835 float next_a
= ZIN0(0);
3840 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3843 float slope
= CALCSLOPE(next_a
, xa
);
3846 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3853 void excess_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3855 float *out
= ZOUT(0);
3861 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3867 void excess_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3869 float *out
= ZOUT(0);
3875 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3882 void lt_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3884 float *out
= ZOUT(0);
3891 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3896 NOVA_BINARY_WRAPPER_K(lt
, less
)
3900 void lt_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3902 float *out
= ZOUT(0);
3904 float xb
= unit
->mPrevB
;
3905 float next_b
= ZIN0(1);
3910 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3913 float slope
= CALCSLOPE(next_b
, xb
);
3916 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3923 void lt_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3925 float *out
= ZOUT(0);
3926 float xa
= unit
->mPrevA
;
3928 float next_a
= ZIN0(0);
3933 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3936 float slope
= CALCSLOPE(next_a
, xa
);
3939 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3946 void lt_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3948 float *out
= ZOUT(0);
3954 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3960 void lt_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3962 float *out
= ZOUT(0);
3968 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3975 void le_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3977 float *out
= ZOUT(0);
3984 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
3989 NOVA_BINARY_WRAPPER_K(le
, less_equal
)
3992 void le_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3994 float *out
= ZOUT(0);
3996 float xb
= unit
->mPrevB
;
3997 float next_b
= ZIN0(1);
4002 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4005 float slope
= CALCSLOPE(next_b
, xb
);
4008 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4015 void le_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4017 float *out
= ZOUT(0);
4018 float xa
= unit
->mPrevA
;
4020 float next_a
= ZIN0(0);
4025 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4028 float slope
= CALCSLOPE(next_a
, xa
);
4031 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4038 void le_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4040 float *out
= ZOUT(0);
4046 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4052 void le_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4054 float *out
= ZOUT(0);
4060 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4067 void gt_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4069 float *out
= ZOUT(0);
4076 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4081 NOVA_BINARY_WRAPPER_K(gt
, greater
)
4085 void gt_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4087 float *out
= ZOUT(0);
4089 float xb
= unit
->mPrevB
;
4090 float next_b
= ZIN0(1);
4095 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4098 float slope
= CALCSLOPE(next_b
, xb
);
4101 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4108 void gt_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4110 float *out
= ZOUT(0);
4111 float xa
= unit
->mPrevA
;
4113 float next_a
= ZIN0(0);
4118 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4121 float slope
= CALCSLOPE(next_a
, xa
);
4124 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4131 void gt_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4133 float *out
= ZOUT(0);
4139 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4145 void gt_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4147 float *out
= ZOUT(0);
4153 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4160 void ge_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4162 float *out
= ZOUT(0);
4169 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4174 NOVA_BINARY_WRAPPER_K(ge
, greater_equal
)
4178 void ge_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4180 float *out
= ZOUT(0);
4182 float xb
= unit
->mPrevB
;
4183 float next_b
= ZIN0(1);
4188 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4191 float slope
= CALCSLOPE(next_b
, xb
);
4194 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4201 void ge_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4203 float *out
= ZOUT(0);
4204 float xa
= unit
->mPrevA
;
4206 float next_a
= ZIN0(0);
4211 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4214 float slope
= CALCSLOPE(next_a
, xa
);
4217 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4224 void ge_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4226 float *out
= ZOUT(0);
4232 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4238 void ge_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4240 float *out
= ZOUT(0);
4246 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4253 void eq_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4255 float *out
= ZOUT(0);
4262 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4267 NOVA_BINARY_WRAPPER_K(eq
, equal
)
4270 void eq_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4272 float *out
= ZOUT(0);
4274 float xb
= unit
->mPrevB
;
4275 float next_b
= ZIN0(1);
4280 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4283 float slope
= CALCSLOPE(next_b
, xb
);
4286 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4293 void eq_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4295 float *out
= ZOUT(0);
4296 float xa
= unit
->mPrevA
;
4298 float next_a
= ZIN0(0);
4303 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4306 float slope
= CALCSLOPE(next_a
, xa
);
4309 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4316 void eq_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4318 float *out
= ZOUT(0);
4324 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4330 void eq_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4332 float *out
= ZOUT(0);
4338 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4345 void neq_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4347 float *out
= ZOUT(0);
4354 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4359 NOVA_BINARY_WRAPPER_K(neq
, notequal
)
4363 void neq_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4365 float *out
= ZOUT(0);
4367 float xb
= unit
->mPrevB
;
4368 float next_b
= ZIN0(1);
4373 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4376 float slope
= CALCSLOPE(next_b
, xb
);
4379 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4386 void neq_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4388 float *out
= ZOUT(0);
4389 float xa
= unit
->mPrevA
;
4391 float next_a
= ZIN0(0);
4396 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4399 float slope
= CALCSLOPE(next_a
, xa
);
4402 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4409 void neq_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4411 float *out
= ZOUT(0);
4417 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4423 void neq_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4425 float *out
= ZOUT(0);
4431 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4437 void sumsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4439 float *out
= ZOUT(0);
4446 ZXP(out
) = xa
* xa
+ xb
* xb
;
4450 void sumsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4452 float *out
= ZOUT(0);
4454 float xb
= unit
->mPrevB
;
4455 float next_b
= ZIN0(1);
4460 ZXP(out
) = xa
* xa
+ xb
* xb
;
4463 float slope
= CALCSLOPE(next_b
, xb
);
4466 ZXP(out
) = xa
* xa
+ xb
* xb
;
4473 void sumsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4475 float *out
= ZOUT(0);
4476 float xa
= unit
->mPrevA
;
4478 float next_a
= ZIN0(0);
4483 ZXP(out
) = xa
* xa
+ xb
* xb
;
4486 float slope
= CALCSLOPE(next_a
, xa
);
4489 ZXP(out
) = xa
* xa
+ xb
* xb
;
4497 void sumsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4499 float *out
= ZOUT(0);
4505 ZXP(out
) = xa
* xa
+ xb
* xb
;
4511 void sumsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4513 float *out
= ZOUT(0);
4519 ZXP(out
) = xa
* xa
+ xb
* xb
;
4526 void difsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4528 float *out
= ZOUT(0);
4535 ZXP(out
) = xa
* xa
- xb
* xb
;
4539 void difsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4541 float *out
= ZOUT(0);
4543 float xb
= unit
->mPrevB
;
4544 float next_b
= ZIN0(1);
4549 ZXP(out
) = xa
* xa
- xb
* xb
;
4552 float slope
= CALCSLOPE(next_b
, xb
);
4555 ZXP(out
) = xa
* xa
- xb
* xb
;
4562 void difsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4564 float *out
= ZOUT(0);
4565 float xa
= unit
->mPrevA
;
4567 float next_a
= ZIN0(0);
4572 ZXP(out
) = xa
* xa
- xb
* xb
;
4575 float slope
= CALCSLOPE(next_a
, xa
);
4578 ZXP(out
) = xa
* xa
- xb
* xb
;
4585 void difsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4587 float *out
= ZOUT(0);
4593 ZXP(out
) = xa
* xa
- xb
* xb
;
4599 void difsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4601 float *out
= ZOUT(0);
4607 ZXP(out
) = xa
* xa
- xb
* xb
;
4613 void sqrsum_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4615 float *out
= ZOUT(0);
4620 float sum
= ZXP(a
) + ZXP(b
);
4621 ZXP(out
) = sum
* sum
;
4625 void sqrsum_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4627 float *out
= ZOUT(0);
4629 float xb
= unit
->mPrevB
;
4630 float next_b
= ZIN0(1);
4635 float sum
= xa
+ xb
;
4636 ZXP(out
) = sum
* sum
;
4639 float slope
= CALCSLOPE(next_b
, xb
);
4642 float sum
= xa
+ xb
;
4643 ZXP(out
) = sum
* sum
;
4650 void sqrsum_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4652 float *out
= ZOUT(0);
4653 float xa
= unit
->mPrevA
;
4655 float next_a
= ZIN0(0);
4660 float sum
= xa
+ xb
;
4661 ZXP(out
) = sum
* sum
;
4664 float slope
= CALCSLOPE(next_a
, xa
);
4667 float sum
= xa
+ xb
;
4668 ZXP(out
) = sum
* sum
;
4675 void sqrsum_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4677 float *out
= ZOUT(0);
4683 float sum
= xa
+ xb
;
4684 ZXP(out
) = sum
* sum
;
4690 void sqrsum_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4692 float *out
= ZOUT(0);
4698 float sum
= xa
+ xb
;
4699 ZXP(out
) = sum
* sum
;
4705 void sqrdif_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4707 float *out
= ZOUT(0);
4712 float dif
= ZXP(a
) - ZXP(b
);
4713 ZXP(out
) = dif
* dif
;
4717 void sqrdif_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4719 float *out
= ZOUT(0);
4721 float xb
= unit
->mPrevB
;
4722 float next_b
= ZIN0(1);
4727 float dif
= xa
- xb
;
4728 ZXP(out
) = dif
* dif
;
4731 float slope
= CALCSLOPE(next_b
, xb
);
4734 float dif
= xa
- xb
;
4735 ZXP(out
) = dif
* dif
;
4742 void sqrdif_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4744 float *out
= ZOUT(0);
4745 float xa
= unit
->mPrevA
;
4747 float next_a
= ZIN0(0);
4752 float dif
= xa
- xb
;
4753 ZXP(out
) = dif
* dif
;
4756 float slope
= CALCSLOPE(next_a
, xa
);
4759 float dif
= xa
- xb
;
4760 ZXP(out
) = dif
* dif
;
4768 void sqrdif_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4770 float *out
= ZOUT(0);
4776 float dif
= xa
- xb
;
4777 ZXP(out
) = dif
* dif
;
4783 void sqrdif_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4785 float *out
= ZOUT(0);
4791 float dif
= xa
- xb
;
4792 ZXP(out
) = dif
* dif
;
4798 void absdif_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4800 float *out
= ZOUT(0);
4805 float dif
= ZXP(a
) - ZXP(b
);
4806 ZXP(out
) = fabs(dif
);
4810 void absdif_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4812 float *out
= ZOUT(0);
4814 float xb
= unit
->mPrevB
;
4815 float next_b
= ZIN0(1);
4820 float dif
= xa
- xb
;
4821 ZXP(out
) = fabs(dif
);
4824 float slope
= CALCSLOPE(next_b
, xb
);
4827 float dif
= xa
- xb
;
4828 ZXP(out
) = fabs(dif
);
4835 void absdif_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4837 float *out
= ZOUT(0);
4838 float xa
= unit
->mPrevA
;
4840 float next_a
= ZIN0(0);
4845 float dif
= xa
- xb
;
4846 ZXP(out
) = fabs(dif
);
4849 float slope
= CALCSLOPE(next_a
, xa
);
4852 float dif
= xa
- xb
;
4853 ZXP(out
) = fabs(dif
);
4860 void absdif_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4862 float *out
= ZOUT(0);
4868 float dif
= xa
- xb
;
4869 ZXP(out
) = fabs(dif
);
4875 void absdif_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4877 float *out
= ZOUT(0);
4883 float dif
= xa
- xb
;
4884 ZXP(out
) = fabs(dif
);
4890 void round_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4892 float *out
= ZOUT(0);
4899 ZXP(out
) = sc_round(xa
, xb
);
4903 void round_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4905 float *out
= ZOUT(0);
4907 float xb
= unit
->mPrevB
;
4908 float next_b
= ZIN0(1);
4913 ZXP(out
) = sc_round(xa
, xb
);
4916 float slope
= CALCSLOPE(next_b
, xb
);
4919 ZXP(out
) = sc_round(xa
, xb
);
4926 void round_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4928 float *out
= ZOUT(0);
4929 float xa
= unit
->mPrevA
;
4931 float next_a
= ZIN0(0);
4936 ZXP(out
) = sc_round(xa
, xb
);
4939 float slope
= CALCSLOPE(next_a
, xa
);
4942 ZXP(out
) = sc_round(xa
, xb
);
4950 void round_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4952 float *out
= ZOUT(0);
4958 ZXP(out
) = sc_round(xa
, xb
);
4964 void round_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4966 float *out
= ZOUT(0);
4972 ZXP(out
) = sc_round(xa
, xb
);
4980 void roundUp_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4982 float *out
= ZOUT(0);
4989 ZXP(out
) = sc_roundUp(xa
, xb
);
4993 void roundUp_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4995 float *out
= ZOUT(0);
4997 float xb
= unit
->mPrevB
;
4998 float next_b
= ZIN0(1);
5003 ZXP(out
) = sc_roundUp(xa
, xb
);
5006 float slope
= CALCSLOPE(next_b
, xb
);
5009 ZXP(out
) = sc_roundUp(xa
, xb
);
5016 void roundUp_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5018 float *out
= ZOUT(0);
5019 float xa
= unit
->mPrevA
;
5021 float next_a
= ZIN0(0);
5026 ZXP(out
) = sc_roundUp(xa
, xb
);
5029 float slope
= CALCSLOPE(next_a
, xa
);
5032 ZXP(out
) = sc_roundUp(xa
, xb
);
5040 void roundUp_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5042 float *out
= ZOUT(0);
5048 ZXP(out
) = sc_roundUp(xa
, xb
);
5054 void roundUp_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5056 float *out
= ZOUT(0);
5062 ZXP(out
) = sc_roundUp(xa
, xb
);
5069 void trunc_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5071 float *out
= ZOUT(0);
5078 ZXP(out
) = sc_trunc(xa
, xb
);
5082 void trunc_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5084 float *out
= ZOUT(0);
5086 float xb
= unit
->mPrevB
;
5087 float next_b
= ZIN0(1);
5092 ZXP(out
) = sc_trunc(xa
, xb
);
5095 float slope
= CALCSLOPE(next_b
, xb
);
5098 ZXP(out
) = sc_trunc(xa
, xb
);
5105 void trunc_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5107 float *out
= ZOUT(0);
5108 float xa
= unit
->mPrevA
;
5110 float next_a
= ZIN0(0);
5115 ZXP(out
) = sc_trunc(xa
, xb
);
5118 float slope
= CALCSLOPE(next_a
, xa
);
5121 ZXP(out
) = sc_trunc(xa
, xb
);
5128 void trunc_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5130 float *out
= ZOUT(0);
5136 ZXP(out
) = sc_trunc(xa
, xb
);
5142 void trunc_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5144 float *out
= ZOUT(0);
5150 ZXP(out
) = sc_trunc(xa
, xb
);
5157 void fold2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5159 float *out
= ZOUT(0);
5166 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5170 void fold2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5172 float *out
= ZOUT(0);
5174 float xb
= unit
->mPrevB
;
5175 float next_b
= ZIN0(1);
5180 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5183 float slope
= CALCSLOPE(next_b
, xb
);
5186 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5193 void fold2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5195 float *out
= ZOUT(0);
5196 float xa
= unit
->mPrevA
;
5198 float next_a
= ZIN0(0);
5203 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5206 float slope
= CALCSLOPE(next_a
, xa
);
5209 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5216 void fold2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5218 float *out
= ZOUT(0);
5224 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5230 void fold2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5232 float *out
= ZOUT(0);
5238 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5246 void wrap2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5248 float *out
= ZOUT(0);
5255 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5259 void wrap2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5261 float *out
= ZOUT(0);
5263 float xb
= unit
->mPrevB
;
5264 float next_b
= ZIN0(1);
5269 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5272 float slope
= CALCSLOPE(next_b
, xb
);
5275 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5282 void wrap2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5284 float *out
= ZOUT(0);
5285 float xa
= unit
->mPrevA
;
5287 float next_a
= ZIN0(0);
5292 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5295 float slope
= CALCSLOPE(next_a
, xa
);
5298 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5305 void wrap2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5307 float *out
= ZOUT(0);
5313 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5319 void wrap2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5321 float *out
= ZOUT(0);
5327 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5334 void atan2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5336 float *out
= ZOUT(0);
5343 ZXP(out
) = atan2(xa
, xb
);
5347 void atan2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5349 float *out
= ZOUT(0);
5351 float xb
= unit
->mPrevB
;
5352 float next_b
= ZIN0(1);
5357 ZXP(out
) = atan2(xa
, xb
);
5360 float slope
= CALCSLOPE(next_b
, xb
);
5363 ZXP(out
) = atan2(xa
, xb
);
5370 void atan2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5372 float *out
= ZOUT(0);
5373 float xa
= unit
->mPrevA
;
5375 float next_a
= ZIN0(0);
5380 ZXP(out
) = atan2(xa
, xb
);
5383 float slope
= CALCSLOPE(next_a
, xa
);
5386 ZXP(out
) = atan2(xa
, xb
);
5393 void atan2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5395 float *out
= ZOUT(0);
5401 ZXP(out
) = atan2(xa
, xb
);
5407 void atan2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5409 float *out
= ZOUT(0);
5415 ZXP(out
) = atan2(xa
, xb
);
5421 void hypot_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5423 float *out
= ZOUT(0);
5430 ZXP(out
) = hypotf(xa
, xb
);
5434 void hypot_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5436 float *out
= ZOUT(0);
5438 float xb
= unit
->mPrevB
;
5439 float next_b
= ZIN0(1);
5444 ZXP(out
) = hypotf(xa
, xb
);
5447 float slope
= CALCSLOPE(next_b
, xb
);
5450 ZXP(out
) = hypotf(xa
, xb
);
5457 void hypot_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5459 float *out
= ZOUT(0);
5460 float xa
= unit
->mPrevA
;
5462 float next_a
= ZIN0(0);
5467 ZXP(out
) = hypotf(xa
, xb
);
5470 float slope
= CALCSLOPE(next_a
, xa
);
5473 ZXP(out
) = hypotf(xa
, xb
);
5480 void hypot_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5482 float *out
= ZOUT(0);
5488 ZXP(out
) = hypotf(xa
, xb
);
5494 void hypot_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5496 float *out
= ZOUT(0);
5502 ZXP(out
) = hypotf(xa
, xb
);
5509 void hypotx_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5511 float *out
= ZOUT(0);
5518 ZXP(out
) = sc_hypotx(xa
, xb
);
5522 void hypotx_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5524 float *out
= ZOUT(0);
5526 float xb
= unit
->mPrevB
;
5527 float next_b
= ZIN0(1);
5532 ZXP(out
) = sc_hypotx(xa
, xb
);
5535 float slope
= CALCSLOPE(next_b
, xb
);
5538 ZXP(out
) = sc_hypotx(xa
, xb
);
5545 void hypotx_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5547 float *out
= ZOUT(0);
5548 float xa
= unit
->mPrevA
;
5550 float next_a
= ZIN0(0);
5555 ZXP(out
) = sc_hypotx(xa
, xb
);
5558 float slope
= CALCSLOPE(next_a
, xa
);
5561 ZXP(out
) = sc_hypotx(xa
, xb
);
5568 void hypotx_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5570 float *out
= ZOUT(0);
5576 ZXP(out
) = sc_hypotx(xa
, xb
);
5582 void hypotx_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5584 float *out
= ZOUT(0);
5590 ZXP(out
) = sc_hypotx(xa
, xb
);
5595 static BinaryOpFunc
ChooseOneSampleFunc(BinaryOpUGen
*unit
)
5597 BinaryOpFunc func
= &zero_1
;
5599 switch (unit
->mSpecialIndex
) {
5600 //case opSilence2 : func = &zero_1; break;
5601 case opAdd
: func
= &add_1
; break;
5602 case opSub
: func
= &sub_1
; break;
5603 case opMul
: func
= &mul_1
; break;
5604 case opFDiv
: func
= &div_1
; break;
5605 case opMod
: func
= &mod_1
; break;
5606 case opEQ
: func
= &eq_1
; break;
5607 case opNE
: func
= &neq_1
; break;
5608 case opLT
: func
= <_1
; break;
5609 case opGT
: func
= >_1
; break;
5610 case opLE
: func
= &le_1
; break;
5611 case opGE
: func
= &ge_1
; break;
5612 case opMin
: func
= &min_1
; break;
5613 case opMax
: func
= &max_1
; break;
5614 case opBitAnd
: func
= &and_1
; break;
5615 case opBitOr
: func
= &or_1
; break;
5616 case opBitXor
: func
= &xor_1
; break;
5617 case opShiftRight
: func
= &rightShift_1
; break;
5618 case opShiftLeft
: func
= &leftShift_1
; break;
5619 case opRound
: func
= &round_1
; break;
5620 case opRoundUp
: func
= &roundUp_1
; break;
5621 case opTrunc
: func
= &trunc_1
; break;
5622 case opAtan2
: func
= &atan2_1
; break;
5623 case opHypot
: func
= &hypot_1
; break;
5624 case opHypotx
: func
= &hypotx_1
; break;
5625 case opPow
: func
= &pow_1
; break;
5626 case opRing1
: func
= &ring1_1
; break;
5627 case opRing2
: func
= &ring2_1
; break;
5628 case opRing3
: func
= &ring3_1
; break;
5629 case opRing4
: func
= &ring4_1
; break;
5630 case opDifSqr
: func
= &difsqr_1
; break;
5631 case opSumSqr
: func
= &sumsqr_1
; break;
5632 case opSqrSum
: func
= &sqrsum_1
; break;
5633 case opSqrDif
: func
= &sqrdif_1
; break;
5634 case opAbsDif
: func
= &absdif_1
; break;
5635 case opThresh
: func
= &thresh_1
; break;
5636 case opAMClip
: func
= &amclip_1
; break;
5637 case opScaleNeg
: func
= &scaleneg_1
; break;
5638 case opClip2
: func
= &clip2_1
; break;
5639 case opFold2
: func
= &fold2_1
; break;
5640 case opWrap2
: func
= &wrap2_1
; break;
5641 case opExcess
: func
= &excess_1
; break;
5642 case opFirstArg
: func
= &firstarg_1
; break;
5643 //case opSecondArg : func = &secondarg_1; break;
5644 default : func
= &add_1
; break;
5650 static BinaryOpFunc
ChooseDemandFunc(BinaryOpUGen
*unit
)
5652 BinaryOpFunc func
= &zero_1
;
5654 switch (unit
->mSpecialIndex
) {
5655 //case opSilence2 : func = &zero_d; break;
5656 case opAdd
: func
= &add_d
; break;
5657 case opSub
: func
= &sub_d
; break;
5658 case opMul
: func
= &mul_d
; break;
5659 case opFDiv
: func
= &div_d
; break;
5660 case opMod
: func
= &mod_d
; break;
5661 case opEQ
: func
= &eq_d
; break;
5662 case opNE
: func
= &neq_d
; break;
5663 case opLT
: func
= <_d
; break;
5664 case opGT
: func
= >_d
; break;
5665 case opLE
: func
= &le_d
; break;
5666 case opGE
: func
= &ge_d
; break;
5667 case opMin
: func
= &min_d
; break;
5668 case opMax
: func
= &max_d
; break;
5669 case opBitAnd
: func
= &and_d
; break;
5670 case opBitOr
: func
= &or_d
; break;
5671 case opBitXor
: func
= &xor_d
; break;
5672 case opShiftRight
: func
= &rightShift_d
; break;
5673 case opShiftLeft
: func
= &leftShift_d
; break;
5674 case opRound
: func
= &round_d
; break;
5675 case opRoundUp
: func
= &roundUp_d
; break;
5676 case opTrunc
: func
= &trunc_d
; break;
5677 case opAtan2
: func
= &atan2_d
; break;
5678 case opHypot
: func
= &hypot_d
; break;
5679 case opHypotx
: func
= &hypotx_d
; break;
5680 case opPow
: func
= &pow_d
; break;
5681 case opRing1
: func
= &ring1_d
; break;
5682 case opRing2
: func
= &ring2_d
; break;
5683 case opRing3
: func
= &ring3_d
; break;
5684 case opRing4
: func
= &ring4_d
; break;
5685 case opDifSqr
: func
= &difsqr_d
; break;
5686 case opSumSqr
: func
= &sumsqr_d
; break;
5687 case opSqrSum
: func
= &sqrsum_d
; break;
5688 case opSqrDif
: func
= &sqrdif_d
; break;
5689 case opAbsDif
: func
= &absdif_d
; break;
5690 case opThresh
: func
= &thresh_d
; break;
5691 case opAMClip
: func
= &amclip_d
; break;
5692 case opScaleNeg
: func
= &scaleneg_d
; break;
5693 case opClip2
: func
= &clip2_d
; break;
5694 case opFold2
: func
= &fold2_d
; break;
5695 case opWrap2
: func
= &wrap2_d
; break;
5696 case opExcess
: func
= &excess_d
; break;
5697 case opFirstArg
: func
= &firstarg_d
; break;
5698 //case opSecondArg : func = &secondarg_d; break;
5699 default : func
= &add_d
; break;
5705 static BinaryOpFunc
ChooseNormalFunc(BinaryOpUGen
*unit
)
5707 BinaryOpFunc func
= &zero_1
;
5709 int rateA
= INRATE(0);
5710 int rateB
= INRATE(1);
5716 switch (unit
->mSpecialIndex
) {
5717 //case opSilence2 : func = &zero_aa; break;
5718 case opAdd
: func
= &add_aa
; break;
5719 case opSub
: func
= &sub_aa
; break;
5720 case opMul
: func
= &mul_aa
; break;
5721 case opFDiv
: func
= &div_aa
; break;
5722 case opMod
: func
= &mod_aa
; break;
5723 case opEQ
: func
= &eq_aa
; break;
5724 case opNE
: func
= &neq_aa
; break;
5725 case opLT
: func
= <_aa
; break;
5726 case opGT
: func
= >_aa
; break;
5727 case opLE
: func
= &le_aa
; break;
5728 case opGE
: func
= &ge_aa
; break;
5729 case opMin
: func
= &min_aa
; break;
5730 case opMax
: func
= &max_aa
; break;
5731 case opBitAnd
: func
= &and_aa
; break;
5732 case opBitOr
: func
= &or_aa
; break;
5733 case opBitXor
: func
= &xor_aa
; break;
5734 case opShiftRight
: func
= &rightShift_aa
; break;
5735 case opShiftLeft
: func
= &leftShift_aa
; break;
5736 case opRound
: func
= &round_aa
; break;
5737 case opRoundUp
: func
= &roundUp_aa
; break;
5738 case opTrunc
: func
= &trunc_aa
; break;
5739 case opAtan2
: func
= &atan2_aa
; break;
5740 case opHypot
: func
= &hypot_aa
; break;
5741 case opHypotx
: func
= &hypotx_aa
; break;
5742 case opPow
: func
= &pow_aa
; break;
5743 case opRing1
: func
= &ring1_aa
; break;
5744 case opRing2
: func
= &ring2_aa
; break;
5745 case opRing3
: func
= &ring3_aa
; break;
5746 case opRing4
: func
= &ring4_aa
; break;
5747 case opDifSqr
: func
= &difsqr_aa
; break;
5748 case opSumSqr
: func
= &sumsqr_aa
; break;
5749 case opSqrSum
: func
= &sqrsum_aa
; break;
5750 case opSqrDif
: func
= &sqrdif_aa
; break;
5751 case opAbsDif
: func
= &absdif_aa
; break;
5752 case opThresh
: func
= &thresh_aa
; break;
5753 case opAMClip
: func
= &amclip_aa
; break;
5754 case opScaleNeg
: func
= &scaleneg_aa
; break;
5755 case opClip2
: func
= &clip2_aa
; break;
5756 case opFold2
: func
= &fold2_aa
; break;
5757 case opWrap2
: func
= &wrap2_aa
; break;
5758 case opExcess
: func
= &excess_aa
; break;
5759 case opFirstArg
: func
= &firstarg_aa
; break;
5760 //case opSecondArg : func = &secondarg_aa; break;
5761 default : func
= &add_aa
; break;
5765 switch (unit
->mSpecialIndex
) {
5766 //case opSilence2 : func = &zero_aa; break;
5767 case opAdd
: func
= &add_ak
; break;
5768 case opSub
: func
= &sub_ak
; break;
5769 case opMul
: func
= &mul_ak
; break;
5770 case opFDiv
: func
= &div_ak
; break;
5771 case opMod
: func
= &mod_ak
; break;
5772 case opEQ
: func
= &eq_ak
; break;
5773 case opNE
: func
= &neq_ak
; break;
5774 case opLT
: func
= <_ak
; break;
5775 case opGT
: func
= >_ak
; break;
5776 case opLE
: func
= &le_ak
; break;
5777 case opGE
: func
= &ge_ak
; break;
5778 case opMin
: func
= &min_ak
; break;
5779 case opMax
: func
= &max_ak
; break;
5780 case opBitAnd
: func
= &and_ak
; break;
5781 case opBitOr
: func
= &or_ak
; break;
5782 case opBitXor
: func
= &xor_ak
; break;
5783 case opShiftRight
: func
= &rightShift_ak
; break;
5784 case opShiftLeft
: func
= &leftShift_ak
; break;
5785 case opRound
: func
= &round_ak
; break;
5786 case opRoundUp
: func
= &roundUp_ak
; break;
5787 case opTrunc
: func
= &trunc_ak
; break;
5788 case opAtan2
: func
= &atan2_ak
; break;
5789 case opHypot
: func
= &hypot_ak
; break;
5790 case opHypotx
: func
= &hypotx_ak
; break;
5791 case opPow
: func
= &pow_ak
; break;
5792 case opRing1
: func
= &ring1_ak
; break;
5793 case opRing2
: func
= &ring2_ak
; break;
5794 case opRing3
: func
= &ring3_ak
; break;
5795 case opRing4
: func
= &ring4_ak
; break;
5796 case opDifSqr
: func
= &difsqr_ak
; break;
5797 case opSumSqr
: func
= &sumsqr_ak
; break;
5798 case opSqrSum
: func
= &sqrsum_ak
; break;
5799 case opSqrDif
: func
= &sqrdif_ak
; break;
5800 case opAbsDif
: func
= &absdif_ak
; break;
5801 case opThresh
: func
= &thresh_ak
; break;
5802 case opAMClip
: func
= &amclip_ak
; break;
5803 case opScaleNeg
: func
= &scaleneg_ak
; break;
5804 case opClip2
: func
= &clip2_ak
; break;
5805 case opFold2
: func
= &fold2_ak
; break;
5806 case opWrap2
: func
= &wrap2_ak
; break;
5807 case opExcess
: func
= &excess_ak
; break;
5808 case opFirstArg
: func
= &firstarg_aa
; break;
5809 //case opSecondArg : func = &secondarg_aa; break;
5810 default : func
= &add_ak
; break;
5813 case calc_ScalarRate
:
5814 switch (unit
->mSpecialIndex
) {
5815 //case opSilence2 : func = &zero_aa; break;
5816 case opAdd
: func
= &add_ai
; break;
5817 case opSub
: func
= &sub_ai
; break;
5818 case opMul
: func
= &mul_ai
; break;
5819 case opFDiv
: func
= &div_ai
; break;
5820 case opMod
: func
= &mod_ai
; break;
5821 case opEQ
: func
= &eq_ai
; break;
5822 case opNE
: func
= &neq_ai
; break;
5823 case opLT
: func
= <_ai
; break;
5824 case opGT
: func
= >_ai
; break;
5825 case opLE
: func
= &le_ai
; break;
5826 case opGE
: func
= &ge_ai
; break;
5827 case opMin
: func
= &min_ai
; break;
5828 case opMax
: func
= &max_ai
; break;
5829 case opBitAnd
: func
= &and_ai
; break;
5830 case opBitOr
: func
= &or_ai
; break;
5831 case opBitXor
: func
= &xor_ai
; break;
5832 case opShiftRight
: func
= &rightShift_ai
; break;
5833 case opShiftLeft
: func
= &leftShift_ai
; break;
5834 case opRound
: func
= &round_ai
; break;
5835 case opRoundUp
: func
= &roundUp_ai
; break;
5836 case opTrunc
: func
= &trunc_ai
; break;
5837 case opAtan2
: func
= &atan2_ai
; break;
5838 case opHypot
: func
= &hypot_ai
; break;
5839 case opHypotx
: func
= &hypotx_ai
; break;
5840 case opPow
: func
= &pow_ai
; break;
5841 case opRing1
: func
= &ring1_ai
; break;
5842 case opRing2
: func
= &ring2_ai
; break;
5843 case opRing3
: func
= &ring3_ai
; break;
5844 case opRing4
: func
= &ring4_ai
; break;
5845 case opDifSqr
: func
= &difsqr_ai
; break;
5846 case opSumSqr
: func
= &sumsqr_ai
; break;
5847 case opSqrSum
: func
= &sqrsum_ai
; break;
5848 case opSqrDif
: func
= &sqrdif_ai
; break;
5849 case opAbsDif
: func
= &absdif_ai
; break;
5850 case opThresh
: func
= &thresh_ai
; break;
5851 case opAMClip
: func
= &amclip_ai
; break;
5852 case opScaleNeg
: func
= &scaleneg_ai
; break;
5853 case opClip2
: func
= &clip2_ai
; break;
5854 case opFold2
: func
= &fold2_ai
; break;
5855 case opWrap2
: func
= &wrap2_ai
; break;
5856 case opExcess
: func
= &excess_ai
; break;
5857 case opFirstArg
: func
= &firstarg_aa
; break;
5858 //case opSecondArg : func = &secondarg_aa; break;
5859 default : func
= &add_ai
; break;
5864 if (rateB
== calc_FullRate
) {
5865 switch (unit
->mSpecialIndex
) {
5866 //case opSilence2 : func = &zero_aa; break;
5867 case opAdd
: func
= &add_ka
; break;
5868 case opSub
: func
= &sub_ka
; break;
5869 case opMul
: func
= &mul_ka
; break;
5870 case opFDiv
: func
= &div_ka
; break;
5871 case opMod
: func
= &mod_ka
; break;
5872 case opEQ
: func
= &eq_ka
; break;
5873 case opNE
: func
= &neq_ka
; break;
5874 case opLT
: func
= <_ka
; break;
5875 case opGT
: func
= >_ka
; break;
5876 case opLE
: func
= &le_ka
; break;
5877 case opGE
: func
= &ge_ka
; break;
5878 case opMin
: func
= &min_ka
; break;
5879 case opMax
: func
= &max_ka
; break;
5880 case opBitAnd
: func
= &and_ka
; break;
5881 case opBitOr
: func
= &or_ka
; break;
5882 case opBitXor
: func
= &xor_ka
; break;
5883 case opShiftRight
: func
= &rightShift_ka
; break;
5884 case opShiftLeft
: func
= &leftShift_ka
; break;
5885 case opRound
: func
= &round_ka
; break;
5886 case opRoundUp
: func
= &roundUp_ka
; break;
5887 case opTrunc
: func
= &trunc_ka
; break;
5888 case opAtan2
: func
= &atan2_ka
; break;
5889 case opHypot
: func
= &hypot_ka
; break;
5890 case opHypotx
: func
= &hypotx_ka
; break;
5891 case opPow
: func
= &pow_ka
; break;
5892 case opRing1
: func
= &ring1_ka
; break;
5893 case opRing2
: func
= &ring2_ka
; break;
5894 case opRing3
: func
= &ring3_ka
; break;
5895 case opRing4
: func
= &ring4_ka
; break;
5896 case opDifSqr
: func
= &difsqr_ka
; break;
5897 case opSumSqr
: func
= &sumsqr_ka
; break;
5898 case opSqrSum
: func
= &sqrsum_ka
; break;
5899 case opSqrDif
: func
= &sqrdif_ka
; break;
5900 case opAbsDif
: func
= &absdif_ka
; break;
5901 case opThresh
: func
= &thresh_ka
; break;
5902 case opAMClip
: func
= &amclip_ka
; break;
5903 case opScaleNeg
: func
= &scaleneg_ka
; break;
5904 case opClip2
: func
= &clip2_ka
; break;
5905 case opFold2
: func
= &fold2_ka
; break;
5906 case opWrap2
: func
= &wrap2_ka
; break;
5907 case opExcess
: func
= &excess_ka
; break;
5908 //case opFirstArg : func = &firstarg_aa; break;
5909 //case opSecondArg : func = &secondarg_aa; break;
5910 default : func
= &add_ka
; break;
5913 // this should have been caught by mBufLength == 1
5917 case calc_ScalarRate
:
5918 if (rateB
== calc_FullRate
) {
5919 switch (unit
->mSpecialIndex
) {
5920 //case opSilence2 : func = &zero_aa; break;
5921 case opAdd
: func
= &add_ia
; break;
5922 case opSub
: func
= &sub_ia
; break;
5923 case opMul
: func
= &mul_ia
; break;
5924 case opFDiv
: func
= &div_ia
; break;
5925 case opMod
: func
= &mod_ia
; break;
5926 case opEQ
: func
= &eq_ia
; break;
5927 case opNE
: func
= &neq_ia
; break;
5928 case opLT
: func
= <_ia
; break;
5929 case opGT
: func
= >_ia
; break;
5930 case opLE
: func
= &le_ia
; break;
5931 case opGE
: func
= &ge_ia
; break;
5932 case opMin
: func
= &min_ia
; break;
5933 case opMax
: func
= &max_ia
; break;
5934 case opBitAnd
: func
= &and_ia
; break;
5935 case opBitOr
: func
= &or_ia
; break;
5936 case opBitXor
: func
= &xor_ia
; break;
5937 case opShiftRight
: func
= &rightShift_ia
; break;
5938 case opShiftLeft
: func
= &leftShift_ia
; break;
5939 case opRound
: func
= &round_ia
; break;
5940 case opRoundUp
: func
= &roundUp_ia
; break;
5941 case opTrunc
: func
= &trunc_ia
; break;
5942 case opAtan2
: func
= &atan2_ia
; break;
5943 case opHypot
: func
= &hypot_ia
; break;
5944 case opHypotx
: func
= &hypotx_ia
; break;
5945 case opPow
: func
= &pow_ia
; break;
5946 case opRing1
: func
= &ring1_ia
; break;
5947 case opRing2
: func
= &ring2_ia
; break;
5948 case opRing3
: func
= &ring3_ia
; break;
5949 case opRing4
: func
= &ring4_ia
; break;
5950 case opDifSqr
: func
= &difsqr_ia
; break;
5951 case opSumSqr
: func
= &sumsqr_ia
; break;
5952 case opSqrSum
: func
= &sqrsum_ia
; break;
5953 case opSqrDif
: func
= &sqrdif_ia
; break;
5954 case opAbsDif
: func
= &absdif_ia
; break;
5955 case opThresh
: func
= &thresh_ia
; break;
5956 case opAMClip
: func
= &amclip_ia
; break;
5957 case opScaleNeg
: func
= &scaleneg_ia
; break;
5958 case opClip2
: func
= &clip2_ia
; break;
5959 case opFold2
: func
= &fold2_ia
; break;
5960 case opWrap2
: func
= &wrap2_ia
; break;
5961 case opExcess
: func
= &excess_ia
; break;
5962 //case opFirstArg : func = &firstarg_aa; break;
5963 //case opSecondArg : func = &secondarg_aa; break;
5964 default : func
= &add_ia
; break;
5967 // this should have been caught by mBufLength == 1
5977 static BinaryOpFunc
ChooseNovaSimdFunc_64(BinaryOpUGen
*unit
)
5979 BinaryOpFunc func
= &zero_1
;
5981 int rateA
= INRATE(0);
5982 int rateB
= INRATE(1);
5988 switch (unit
->mSpecialIndex
) {
5989 //case opSilence2 : func = &zero_aa; break;
5990 case opAdd
: func
= &add_aa_nova_64
; break;
5991 case opSub
: func
= &sub_aa_nova_64
; break;
5992 case opMul
: func
= &mul_aa_nova_64
; break;
5993 case opFDiv
: func
= &div_aa_nova
; break;
5994 case opMod
: func
= &mod_aa
; break;
5995 case opEQ
: func
= &eq_aa_nova_64
; break;
5996 case opNE
: func
= &neq_aa_nova_64
; break;
5997 case opLT
: func
= <_aa_nova_64
; break;
5998 case opGT
: func
= >_aa_nova_64
; break;
5999 case opLE
: func
= &le_aa_nova_64
; break;
6000 case opGE
: func
= &ge_aa_nova_64
; break;
6001 case opMin
: func
= &min_aa_nova_64
; break;
6002 case opMax
: func
= &max_aa_nova_64
; break;
6003 case opBitAnd
: func
= &and_aa
; break;
6004 case opBitOr
: func
= &or_aa
; break;
6005 case opBitXor
: func
= &xor_aa
; break;
6006 case opShiftRight
: func
= &rightShift_aa
; break;
6007 case opShiftLeft
: func
= &leftShift_aa
; break;
6008 case opRound
: func
= &round_aa
; break;
6009 case opRoundUp
: func
= &roundUp_aa
; break;
6010 case opTrunc
: func
= &trunc_aa
; break;
6011 case opAtan2
: func
= &atan2_aa
; break;
6012 case opHypot
: func
= &hypot_aa
; break;
6013 case opHypotx
: func
= &hypotx_aa
; break;
6014 case opPow
: func
= &pow_aa_nova
; break;
6015 case opRing1
: func
= &ring1_aa
; break;
6016 case opRing2
: func
= &ring2_aa
; break;
6017 case opRing3
: func
= &ring3_aa
; break;
6018 case opRing4
: func
= &ring4_aa
; break;
6019 case opDifSqr
: func
= &difsqr_aa
; break;
6020 case opSumSqr
: func
= &sumsqr_aa
; break;
6021 case opSqrSum
: func
= &sqrsum_aa
; break;
6022 case opSqrDif
: func
= &sqrdif_aa
; break;
6023 case opAbsDif
: func
= &absdif_aa
; break;
6024 case opThresh
: func
= &thresh_aa
; break;
6025 case opAMClip
: func
= &amclip_aa
; break;
6026 case opScaleNeg
: func
= &scaleneg_aa
; break;
6027 case opClip2
: func
= &clip2_aa_nova_64
; break;
6028 case opFold2
: func
= &fold2_aa
; break;
6029 case opWrap2
: func
= &wrap2_aa
; break;
6030 case opExcess
: func
= &excess_aa
; break;
6031 case opFirstArg
: func
= &firstarg_aa_nova
; break;
6032 //case opSecondArg : func = &secondarg_aa_nova; break;
6033 default : func
= &add_aa
; break;
6037 switch (unit
->mSpecialIndex
) {
6038 //case opSilence2 : func = &zero_aa; break;
6039 case opAdd
: func
= &add_ak_nova_64
; break;
6040 case opSub
: func
= &sub_ak_nova_64
; break;
6041 case opMul
: func
= &mul_ak_nova_64
; break;
6042 case opFDiv
: func
= &div_ak_nova
; break;
6043 case opMod
: func
= &mod_ak
; break;
6044 case opEQ
: func
= &eq_ak_nova_64
; break;
6045 case opNE
: func
= &neq_ak_nova_64
; break;
6046 case opLT
: func
= <_ak_nova_64
; break;
6047 case opGT
: func
= >_ak_nova_64
; break;
6048 case opLE
: func
= &le_ak_nova_64
; break;
6049 case opGE
: func
= &ge_ak_nova_64
; break;
6050 case opMin
: func
= &min_ak_nova_64
; break;
6051 case opMax
: func
= &max_ak_nova_64
; break;
6052 case opBitAnd
: func
= &and_ak
; break;
6053 case opBitOr
: func
= &or_ak
; break;
6054 case opBitXor
: func
= &xor_ak
; break;
6055 case opShiftRight
: func
= &rightShift_ak
; break;
6056 case opShiftLeft
: func
= &leftShift_ak
; break;
6057 case opRound
: func
= &round_ak
; break;
6058 case opRoundUp
: func
= &roundUp_ak
; break;
6059 case opTrunc
: func
= &trunc_ak
; break;
6060 case opAtan2
: func
= &atan2_ak
; break;
6061 case opHypot
: func
= &hypot_ak
; break;
6062 case opHypotx
: func
= &hypotx_ak
; break;
6063 case opPow
: func
= &pow_ak_nova
; break;
6064 case opRing1
: func
= &ring1_ak
; break;
6065 case opRing2
: func
= &ring2_ak
; break;
6066 case opRing3
: func
= &ring3_ak
; break;
6067 case opRing4
: func
= &ring4_ak
; break;
6068 case opDifSqr
: func
= &difsqr_ak
; break;
6069 case opSumSqr
: func
= &sumsqr_ak
; break;
6070 case opSqrSum
: func
= &sqrsum_ak
; break;
6071 case opSqrDif
: func
= &sqrdif_ak
; break;
6072 case opAbsDif
: func
= &absdif_ak
; break;
6073 case opThresh
: func
= &thresh_ak
; break;
6074 case opAMClip
: func
= &amclip_ak
; break;
6075 case opScaleNeg
: func
= &scaleneg_ak
; break;
6076 case opClip2
: func
= &clip2_ak_nova_64
; break;
6077 case opFold2
: func
= &fold2_ak
; break;
6078 case opWrap2
: func
= &wrap2_ak
; break;
6079 case opExcess
: func
= &excess_ak
; break;
6080 case opFirstArg
: func
= &firstarg_aa
; break;
6081 //case opSecondArg : func = &secondarg_aa; break;
6082 default : func
= &add_ak
; break;
6085 case calc_ScalarRate
:
6086 switch (unit
->mSpecialIndex
) {
6087 //case opSilence2 : func = &zero_aa; break;
6088 case opAdd
: func
= &add_ai_nova_64
; break;
6089 case opSub
: func
= &sub_ai_nova_64
; break;
6090 case opMul
: func
= &mul_ai_nova_64
; break;
6091 case opFDiv
: func
= &div_ai_nova
; break;
6092 case opMod
: func
= &mod_ai
; break;
6093 case opEQ
: func
= &eq_ai_nova_64
; break;
6094 case opNE
: func
= &neq_ai_nova_64
; break;
6095 case opLT
: func
= <_ai_nova_64
; break;
6096 case opGT
: func
= >_ai_nova_64
; break;
6097 case opLE
: func
= &le_ai_nova_64
; break;
6098 case opGE
: func
= &ge_ai_nova_64
; break;
6099 case opMin
: func
= &min_ai_nova_64
; break;
6100 case opMax
: func
= &max_ai_nova_64
; break;
6101 case opBitAnd
: func
= &and_ai
; break;
6102 case opBitOr
: func
= &or_ai
; break;
6103 case opBitXor
: func
= &xor_ai
; break;
6104 case opShiftRight
: func
= &rightShift_ai
; break;
6105 case opShiftLeft
: func
= &leftShift_ai
; break;
6106 case opRound
: func
= &round_ai
; break;
6107 case opRoundUp
: func
= &roundUp_ai
; break;
6108 case opTrunc
: func
= &trunc_ai
; break;
6109 case opAtan2
: func
= &atan2_ai
; break;
6110 case opHypot
: func
= &hypot_ai
; break;
6111 case opHypotx
: func
= &hypotx_ai
; break;
6112 case opPow
: func
= &pow_ai_nova
; break;
6113 case opRing1
: func
= &ring1_ai
; break;
6114 case opRing2
: func
= &ring2_ai
; break;
6115 case opRing3
: func
= &ring3_ai
; break;
6116 case opRing4
: func
= &ring4_ai
; break;
6117 case opDifSqr
: func
= &difsqr_ai
; break;
6118 case opSumSqr
: func
= &sumsqr_ai
; break;
6119 case opSqrSum
: func
= &sqrsum_ai
; break;
6120 case opSqrDif
: func
= &sqrdif_ai
; break;
6121 case opAbsDif
: func
= &absdif_ai
; break;
6122 case opThresh
: func
= &thresh_ai
; break;
6123 case opAMClip
: func
= &amclip_ai
; break;
6124 case opScaleNeg
: func
= &scaleneg_ai
; break;
6125 case opClip2
: func
= &clip2_ai_nova_64
; break;
6126 case opFold2
: func
= &fold2_ai
; break;
6127 case opWrap2
: func
= &wrap2_ai
; break;
6128 case opExcess
: func
= &excess_ai
; break;
6129 case opFirstArg
: func
= &firstarg_aa
; break;
6130 //case opSecondArg : func = &secondarg_aa; break;
6131 default : func
= &add_ai
; break;
6136 if (rateB
== calc_FullRate
) {
6137 switch (unit
->mSpecialIndex
) {
6138 //case opSilence2 : func = &zero_aa; break;
6139 case opAdd
: func
= &add_ka_nova_64
; break;
6140 case opSub
: func
= &sub_ka_nova_64
; break;
6141 case opMul
: func
= &mul_ka_nova_64
; break;
6142 case opFDiv
: func
= &div_ka_nova
; break;
6143 case opMod
: func
= &mod_ka
; break;
6144 case opEQ
: func
= &eq_ka_nova_64
; break;
6145 case opNE
: func
= &neq_ka_nova_64
; break;
6146 case opLT
: func
= <_ka_nova_64
; break;
6147 case opGT
: func
= >_ka_nova_64
; break;
6148 case opLE
: func
= &le_ka_nova_64
; break;
6149 case opGE
: func
= &ge_ka_nova_64
; break;
6150 case opMin
: func
= &min_ka_nova_64
; break;
6151 case opMax
: func
= &max_ka_nova_64
; break;
6152 case opBitAnd
: func
= &and_ka
; break;
6153 case opBitOr
: func
= &or_ka
; break;
6154 case opBitXor
: func
= &xor_ka
; break;
6155 case opShiftRight
: func
= &rightShift_ka
; break;
6156 case opShiftLeft
: func
= &leftShift_ka
; break;
6157 case opRound
: func
= &round_ka
; break;
6158 case opRoundUp
: func
= &roundUp_ka
; break;
6159 case opTrunc
: func
= &trunc_ka
; break;
6160 case opAtan2
: func
= &atan2_ka
; break;
6161 case opHypot
: func
= &hypot_ka
; break;
6162 case opHypotx
: func
= &hypotx_ka
; break;
6163 case opPow
: func
= &pow_ka_nova
; break;
6164 case opRing1
: func
= &ring1_ka
; break;
6165 case opRing2
: func
= &ring2_ka
; break;
6166 case opRing3
: func
= &ring3_ka
; break;
6167 case opRing4
: func
= &ring4_ka
; break;
6168 case opDifSqr
: func
= &difsqr_ka
; break;
6169 case opSumSqr
: func
= &sumsqr_ka
; break;
6170 case opSqrSum
: func
= &sqrsum_ka
; break;
6171 case opSqrDif
: func
= &sqrdif_ka
; break;
6172 case opAbsDif
: func
= &absdif_ka
; break;
6173 case opThresh
: func
= &thresh_ka
; break;
6174 case opAMClip
: func
= &amclip_ka
; break;
6175 case opScaleNeg
: func
= &scaleneg_ka
; break;
6176 case opClip2
: func
= &clip2_ka_nova_64
; break;
6177 case opFold2
: func
= &fold2_ka
; break;
6178 case opWrap2
: func
= &wrap2_ka
; break;
6179 case opExcess
: func
= &excess_ka
; break;
6180 //case opFirstArg : func = &firstarg_aa; break;
6181 //case opSecondArg : func = &secondarg_aa; break;
6182 default : func
= &add_ka
; break;
6185 // this should have been caught by mBufLength == 1
6189 case calc_ScalarRate
:
6190 if (rateB
== calc_FullRate
) {
6191 switch (unit
->mSpecialIndex
) {
6192 //case opSilence2 : func = &zero_aa; break;
6193 case opAdd
: func
= &add_ia_nova_64
; break;
6194 case opSub
: func
= &sub_ia_nova_64
; break;
6195 case opMul
: func
= &mul_ia_nova_64
; break;
6196 case opFDiv
: func
= &div_ia_nova
; break;
6197 case opMod
: func
= &mod_ia
; break;
6198 case opEQ
: func
= &eq_ia_nova_64
; break;
6199 case opNE
: func
= &neq_ia_nova_64
; break;
6200 case opLT
: func
= <_ia_nova_64
; break;
6201 case opGT
: func
= >_ia_nova_64
; break;
6202 case opLE
: func
= &le_ia_nova_64
; break;
6203 case opGE
: func
= &ge_ia_nova_64
; break;
6204 case opMin
: func
= &min_ia_nova_64
; break;
6205 case opMax
: func
= &max_ia_nova_64
; break;
6206 case opBitAnd
: func
= &and_ia
; break;
6207 case opBitOr
: func
= &or_ia
; break;
6208 case opBitXor
: func
= &xor_ia
; break;
6209 case opShiftRight
: func
= &rightShift_ia
; break;
6210 case opShiftLeft
: func
= &leftShift_ia
; break;
6211 case opRound
: func
= &round_ia
; break;
6212 case opRoundUp
: func
= &roundUp_ia
; break;
6213 case opTrunc
: func
= &trunc_ia
; break;
6214 case opAtan2
: func
= &atan2_ia
; break;
6215 case opHypot
: func
= &hypot_ia
; break;
6216 case opHypotx
: func
= &hypotx_ia
; break;
6217 case opPow
: func
= &pow_ia_nova
; break;
6218 case opRing1
: func
= &ring1_ia
; break;
6219 case opRing2
: func
= &ring2_ia
; break;
6220 case opRing3
: func
= &ring3_ia
; break;
6221 case opRing4
: func
= &ring4_ia
; break;
6222 case opDifSqr
: func
= &difsqr_ia
; break;
6223 case opSumSqr
: func
= &sumsqr_ia
; break;
6224 case opSqrSum
: func
= &sqrsum_ia
; break;
6225 case opSqrDif
: func
= &sqrdif_ia
; break;
6226 case opAbsDif
: func
= &absdif_ia
; break;
6227 case opThresh
: func
= &thresh_ia
; break;
6228 case opAMClip
: func
= &amclip_ia
; break;
6229 case opScaleNeg
: func
= &scaleneg_ia
; break;
6230 case opClip2
: func
= &clip2_ia_nova_64
; break;
6231 case opFold2
: func
= &fold2_ia
; break;
6232 case opWrap2
: func
= &wrap2_ia
; break;
6233 case opExcess
: func
= &excess_ia
; break;
6234 //case opFirstArg : func = &firstarg_aa; break;
6235 //case opSecondArg : func = &secondarg_aa; break;
6236 default : func
= &add_ia
; break;
6239 // this should have been caught by mBufLength == 1
6249 static BinaryOpFunc
ChooseNovaSimdFunc(BinaryOpUGen
*unit
)
6251 if (BUFLENGTH
== 64)
6252 return ChooseNovaSimdFunc_64(unit
);
6254 BinaryOpFunc func
= &zero_1
;
6256 int rateA
= INRATE(0);
6257 int rateB
= INRATE(1);
6263 switch (unit
->mSpecialIndex
) {
6264 //case opSilence2 : func = &zero_aa; break;
6265 case opAdd
: func
= &add_aa_nova
; break;
6266 case opSub
: func
= &sub_aa_nova
; break;
6267 case opMul
: func
= &mul_aa_nova
; break;
6268 case opFDiv
: func
= &div_aa_nova
; break;
6269 case opMod
: func
= &mod_aa
; break;
6270 case opEQ
: func
= &eq_aa_nova
; break;
6271 case opNE
: func
= &neq_aa_nova
; break;
6272 case opLT
: func
= <_aa_nova
; break;
6273 case opGT
: func
= >_aa_nova
; break;
6274 case opLE
: func
= &le_aa_nova
; break;
6275 case opGE
: func
= &ge_aa_nova
; break;
6276 case opMin
: func
= &min_aa_nova
; break;
6277 case opMax
: func
= &max_aa_nova
; break;
6278 case opBitAnd
: func
= &and_aa
; break;
6279 case opBitOr
: func
= &or_aa
; break;
6280 case opBitXor
: func
= &xor_aa
; break;
6281 case opShiftRight
: func
= &rightShift_aa
; break;
6282 case opShiftLeft
: func
= &leftShift_aa
; break;
6283 case opRound
: func
= &round_aa
; break;
6284 case opRoundUp
: func
= &roundUp_aa
; break;
6285 case opTrunc
: func
= &trunc_aa
; break;
6286 case opAtan2
: func
= &atan2_aa
; break;
6287 case opHypot
: func
= &hypot_aa
; break;
6288 case opHypotx
: func
= &hypotx_aa
; break;
6289 case opPow
: func
= &pow_aa_nova
; break;
6290 case opRing1
: func
= &ring1_aa
; break;
6291 case opRing2
: func
= &ring2_aa
; break;
6292 case opRing3
: func
= &ring3_aa
; break;
6293 case opRing4
: func
= &ring4_aa
; break;
6294 case opDifSqr
: func
= &difsqr_aa
; break;
6295 case opSumSqr
: func
= &sumsqr_aa
; break;
6296 case opSqrSum
: func
= &sqrsum_aa
; break;
6297 case opSqrDif
: func
= &sqrdif_aa
; break;
6298 case opAbsDif
: func
= &absdif_aa
; break;
6299 case opThresh
: func
= &thresh_aa
; break;
6300 case opAMClip
: func
= &amclip_aa
; break;
6301 case opScaleNeg
: func
= &scaleneg_aa
; break;
6302 case opClip2
: func
= &clip2_aa_nova
; break;
6303 case opFold2
: func
= &fold2_aa
; break;
6304 case opWrap2
: func
= &wrap2_aa
; break;
6305 case opExcess
: func
= &excess_aa
; break;
6306 case opFirstArg
: func
= &firstarg_aa_nova
; break;
6307 //case opSecondArg : func = &secondarg_aa_nova; break;
6308 default : func
= &add_aa
; break;
6312 switch (unit
->mSpecialIndex
) {
6313 //case opSilence2 : func = &zero_aa; break;
6314 case opAdd
: func
= &add_ak_nova
; break;
6315 case opSub
: func
= &sub_ak_nova
; break;
6316 case opMul
: func
= &mul_ak_nova
; break;
6317 case opFDiv
: func
= &div_ak_nova
; break;
6318 case opMod
: func
= &mod_ak
; break;
6319 case opEQ
: func
= &eq_ak_nova
; break;
6320 case opNE
: func
= &neq_ak_nova
; break;
6321 case opLT
: func
= <_ak_nova
; break;
6322 case opGT
: func
= >_ak_nova
; break;
6323 case opLE
: func
= &le_ak_nova
; break;
6324 case opGE
: func
= &ge_ak_nova
; break;
6325 case opMin
: func
= &min_ak_nova
; break;
6326 case opMax
: func
= &max_ak_nova
; break;
6327 case opBitAnd
: func
= &and_ak
; break;
6328 case opBitOr
: func
= &or_ak
; break;
6329 case opBitXor
: func
= &xor_ak
; break;
6330 case opShiftRight
: func
= &rightShift_ak
; break;
6331 case opShiftLeft
: func
= &leftShift_ak
; break;
6332 case opRound
: func
= &round_ak
; break;
6333 case opRoundUp
: func
= &roundUp_ak
; break;
6334 case opTrunc
: func
= &trunc_ak
; break;
6335 case opAtan2
: func
= &atan2_ak
; break;
6336 case opHypot
: func
= &hypot_ak
; break;
6337 case opHypotx
: func
= &hypotx_ak
; break;
6338 case opPow
: func
= &pow_ak_nova
; break;
6339 case opRing1
: func
= &ring1_ak
; break;
6340 case opRing2
: func
= &ring2_ak
; break;
6341 case opRing3
: func
= &ring3_ak
; break;
6342 case opRing4
: func
= &ring4_ak
; break;
6343 case opDifSqr
: func
= &difsqr_ak
; break;
6344 case opSumSqr
: func
= &sumsqr_ak
; break;
6345 case opSqrSum
: func
= &sqrsum_ak
; break;
6346 case opSqrDif
: func
= &sqrdif_ak
; break;
6347 case opAbsDif
: func
= &absdif_ak
; break;
6348 case opThresh
: func
= &thresh_ak
; break;
6349 case opAMClip
: func
= &amclip_ak
; break;
6350 case opScaleNeg
: func
= &scaleneg_ak
; break;
6351 case opClip2
: func
= &clip2_ak_nova
; break;
6352 case opFold2
: func
= &fold2_ak
; break;
6353 case opWrap2
: func
= &wrap2_ak
; break;
6354 case opExcess
: func
= &excess_ak
; break;
6355 case opFirstArg
: func
= &firstarg_aa
; break;
6356 //case opSecondArg : func = &secondarg_aa; break;
6357 default : func
= &add_ak
; break;
6360 case calc_ScalarRate
:
6361 switch (unit
->mSpecialIndex
) {
6362 //case opSilence2 : func = &zero_aa; break;
6363 case opAdd
: func
= &add_ai_nova
; break;
6364 case opSub
: func
= &sub_ai_nova
; break;
6365 case opMul
: func
= &mul_ai_nova
; break;
6366 case opFDiv
: func
= &div_ai_nova
; break;
6367 case opMod
: func
= &mod_ai
; break;
6368 case opEQ
: func
= &eq_ai_nova
; break;
6369 case opNE
: func
= &neq_ai_nova
; break;
6370 case opLT
: func
= <_ai_nova
; break;
6371 case opGT
: func
= >_ai_nova
; break;
6372 case opLE
: func
= &le_ai_nova
; break;
6373 case opGE
: func
= &ge_ai_nova
; break;
6374 case opMin
: func
= &min_ai_nova
; break;
6375 case opMax
: func
= &max_ai_nova
; break;
6376 case opBitAnd
: func
= &and_ai
; break;
6377 case opBitOr
: func
= &or_ai
; break;
6378 case opBitXor
: func
= &xor_ai
; break;
6379 case opShiftRight
: func
= &rightShift_ai
; break;
6380 case opShiftLeft
: func
= &leftShift_ai
; break;
6381 case opRound
: func
= &round_ai
; break;
6382 case opRoundUp
: func
= &roundUp_ai
; break;
6383 case opTrunc
: func
= &trunc_ai
; break;
6384 case opAtan2
: func
= &atan2_ai
; break;
6385 case opHypot
: func
= &hypot_ai
; break;
6386 case opHypotx
: func
= &hypotx_ai
; break;
6387 case opPow
: func
= &pow_ai_nova
; break;
6388 case opRing1
: func
= &ring1_ai
; break;
6389 case opRing2
: func
= &ring2_ai
; break;
6390 case opRing3
: func
= &ring3_ai
; break;
6391 case opRing4
: func
= &ring4_ai
; break;
6392 case opDifSqr
: func
= &difsqr_ai
; break;
6393 case opSumSqr
: func
= &sumsqr_ai
; break;
6394 case opSqrSum
: func
= &sqrsum_ai
; break;
6395 case opSqrDif
: func
= &sqrdif_ai
; break;
6396 case opAbsDif
: func
= &absdif_ai
; break;
6397 case opThresh
: func
= &thresh_ai
; break;
6398 case opAMClip
: func
= &amclip_ai
; break;
6399 case opScaleNeg
: func
= &scaleneg_ai
; break;
6400 case opClip2
: func
= &clip2_ai_nova
; break;
6401 case opFold2
: func
= &fold2_ai
; break;
6402 case opWrap2
: func
= &wrap2_ai
; break;
6403 case opExcess
: func
= &excess_ai
; break;
6404 case opFirstArg
: func
= &firstarg_aa
; break;
6405 //case opSecondArg : func = &secondarg_aa; break;
6406 default : func
= &add_ai
; break;
6411 if (rateB
== calc_FullRate
) {
6412 switch (unit
->mSpecialIndex
) {
6413 //case opSilence2 : func = &zero_aa; break;
6414 case opAdd
: func
= &add_ka_nova
; break;
6415 case opSub
: func
= &sub_ka_nova
; break;
6416 case opMul
: func
= &mul_ka_nova
; break;
6417 case opFDiv
: func
= &div_ka_nova
; break;
6418 case opMod
: func
= &mod_ka
; break;
6419 case opEQ
: func
= &eq_ka_nova
; break;
6420 case opNE
: func
= &neq_ka_nova
; break;
6421 case opLT
: func
= <_ka_nova
; break;
6422 case opGT
: func
= >_ka_nova
; break;
6423 case opLE
: func
= &le_ka_nova
; break;
6424 case opGE
: func
= &ge_ka_nova
; break;
6425 case opMin
: func
= &min_ka_nova
; break;
6426 case opMax
: func
= &max_ka_nova
; break;
6427 case opBitAnd
: func
= &and_ka
; break;
6428 case opBitOr
: func
= &or_ka
; break;
6429 case opBitXor
: func
= &xor_ka
; break;
6430 case opShiftRight
: func
= &rightShift_ka
; break;
6431 case opShiftLeft
: func
= &leftShift_ka
; break;
6432 case opRound
: func
= &round_ka
; break;
6433 case opRoundUp
: func
= &roundUp_ka
; break;
6434 case opTrunc
: func
= &trunc_ka
; break;
6435 case opAtan2
: func
= &atan2_ka
; break;
6436 case opHypot
: func
= &hypot_ka
; break;
6437 case opHypotx
: func
= &hypotx_ka
; break;
6438 case opPow
: func
= &pow_ka_nova
; break;
6439 case opRing1
: func
= &ring1_ka
; break;
6440 case opRing2
: func
= &ring2_ka
; break;
6441 case opRing3
: func
= &ring3_ka
; break;
6442 case opRing4
: func
= &ring4_ka
; break;
6443 case opDifSqr
: func
= &difsqr_ka
; break;
6444 case opSumSqr
: func
= &sumsqr_ka
; break;
6445 case opSqrSum
: func
= &sqrsum_ka
; break;
6446 case opSqrDif
: func
= &sqrdif_ka
; break;
6447 case opAbsDif
: func
= &absdif_ka
; break;
6448 case opThresh
: func
= &thresh_ka
; break;
6449 case opAMClip
: func
= &amclip_ka
; break;
6450 case opScaleNeg
: func
= &scaleneg_ka
; break;
6451 case opClip2
: func
= &clip2_ka_nova
; break;
6452 case opFold2
: func
= &fold2_ka
; break;
6453 case opWrap2
: func
= &wrap2_ka
; break;
6454 case opExcess
: func
= &excess_ka
; break;
6455 //case opFirstArg : func = &firstarg_aa; break;
6456 //case opSecondArg : func = &secondarg_aa; break;
6457 default : func
= &add_ka
; break;
6460 // this should have been caught by mBufLength == 1
6464 case calc_ScalarRate
:
6465 if (rateB
== calc_FullRate
) {
6466 switch (unit
->mSpecialIndex
) {
6467 //case opSilence2 : func = &zero_aa; break;
6468 case opAdd
: func
= &add_ia_nova
; break;
6469 case opSub
: func
= &sub_ia_nova
; break;
6470 case opMul
: func
= &mul_ia_nova
; break;
6471 case opFDiv
: func
= &div_ia_nova
; break;
6472 case opMod
: func
= &mod_ia
; break;
6473 case opEQ
: func
= &eq_ia_nova
; break;
6474 case opNE
: func
= &neq_ia_nova
; break;
6475 case opLT
: func
= <_ia_nova
; break;
6476 case opGT
: func
= >_ia_nova
; break;
6477 case opLE
: func
= &le_ia_nova
; break;
6478 case opGE
: func
= &ge_ia_nova
; break;
6479 case opMin
: func
= &min_ia_nova
; break;
6480 case opMax
: func
= &max_ia_nova
; break;
6481 case opBitAnd
: func
= &and_ia
; break;
6482 case opBitOr
: func
= &or_ia
; break;
6483 case opBitXor
: func
= &xor_ia
; break;
6484 case opShiftRight
: func
= &rightShift_ia
; break;
6485 case opShiftLeft
: func
= &leftShift_ia
; break;
6486 case opRound
: func
= &round_ia
; break;
6487 case opRoundUp
: func
= &roundUp_ia
; break;
6488 case opTrunc
: func
= &trunc_ia
; break;
6489 case opAtan2
: func
= &atan2_ia
; break;
6490 case opHypot
: func
= &hypot_ia
; break;
6491 case opHypotx
: func
= &hypotx_ia
; break;
6492 case opPow
: func
= &pow_ia_nova
; break;
6493 case opRing1
: func
= &ring1_ia
; break;
6494 case opRing2
: func
= &ring2_ia
; break;
6495 case opRing3
: func
= &ring3_ia
; break;
6496 case opRing4
: func
= &ring4_ia
; break;
6497 case opDifSqr
: func
= &difsqr_ia
; break;
6498 case opSumSqr
: func
= &sumsqr_ia
; break;
6499 case opSqrSum
: func
= &sqrsum_ia
; break;
6500 case opSqrDif
: func
= &sqrdif_ia
; break;
6501 case opAbsDif
: func
= &absdif_ia
; break;
6502 case opThresh
: func
= &thresh_ia
; break;
6503 case opAMClip
: func
= &amclip_ia
; break;
6504 case opScaleNeg
: func
= &scaleneg_ia
; break;
6505 case opClip2
: func
= &clip2_ia_nova
; break;
6506 case opFold2
: func
= &fold2_ia
; break;
6507 case opWrap2
: func
= &wrap2_ia
; break;
6508 case opExcess
: func
= &excess_ia
; break;
6509 //case opFirstArg : func = &firstarg_aa; break;
6510 //case opSecondArg : func = &secondarg_aa; break;
6511 default : func
= &add_ia
; break;
6514 // this should have been caught by mBufLength == 1
6525 bool ChooseOperatorFunc(BinaryOpUGen
*unit
)
6527 //Print("->ChooseOperatorFunc %d\n", unit->mSpecialIndex);
6528 BinaryOpFunc func
= &zero_aa
;
6531 if (BUFLENGTH
== 1) {
6532 if (unit
->mCalcRate
== calc_DemandRate
) {
6533 func
= ChooseDemandFunc(unit
);
6535 func
= ChooseOneSampleFunc(unit
);
6537 #if defined(NOVA_SIMD)
6538 } else if (!(BUFLENGTH
& 15)) {
6539 /* select normal function for initialization */
6540 func
= ChooseNormalFunc(unit
);
6543 /* select simd function */
6544 func
= ChooseNovaSimdFunc(unit
);
6548 func
= ChooseNormalFunc(unit
);
6550 unit
->mCalcFunc
= (UnitCalcFunc
)func
;
6551 //Print("<-ChooseOperatorFunc %p\n", func);
6552 //Print("calc %d\n", unit->mCalcRate);
6559 ////////////////////////////////////////////////////////////////////////////////////////////////////////
6562 PluginLoad(BinaryOp
)
6566 DefineSimpleUnit(BinaryOpUGen
);