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"
36 #include "function_attributes.h"
37 using nova::slope_argument
;
39 #define NOVA_BINARY_WRAPPER(SCNAME, NOVANAME) \
40 FLATTEN void SCNAME##_aa_nova(BinaryOpUGen *unit, int inNumSamples) \
42 nova::NOVANAME##_vec_simd(OUT(0), IN(0), IN(1), inNumSamples); \
45 FLATTEN void SCNAME##_aa_nova_64(BinaryOpUGen *unit, int inNumSamples) \
47 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), IN(1)); \
50 FLATTEN void SCNAME##_ia_nova(BinaryOpUGen *unit, int inNumSamples) \
54 nova::NOVANAME##_vec_simd(OUT(0), xa, IN(1), inNumSamples); \
58 FLATTEN void SCNAME##_ia_nova_64(BinaryOpUGen *unit, int inNumSamples) \
62 nova::NOVANAME##_vec_simd<64>(OUT(0), xa, IN(1)); \
66 FLATTEN void SCNAME##_ai_nova(BinaryOpUGen *unit, int inNumSamples) \
70 nova::NOVANAME##_vec_simd(OUT(0), IN(0), xb, inNumSamples); \
74 FLATTEN void SCNAME##_ai_nova_64(BinaryOpUGen *unit, int inNumSamples) \
78 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), xb); \
82 #define NOVA_BINARY_WRAPPER_K(SCNAME, NOVANAME) \
83 FLATTEN void SCNAME##_aa_nova(BinaryOpUGen *unit, int inNumSamples) \
85 nova::NOVANAME##_vec_simd(OUT(0), IN(0), IN(1), inNumSamples); \
88 FLATTEN void SCNAME##_aa_nova_64(BinaryOpUGen *unit, int inNumSamples) \
90 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), IN(1)); \
93 FLATTEN void SCNAME##_ia_nova(BinaryOpUGen *unit, int inNumSamples) \
97 nova::NOVANAME##_vec_simd(OUT(0), xa, IN(1), inNumSamples); \
101 FLATTEN void SCNAME##_ia_nova_64(BinaryOpUGen *unit, int inNumSamples) \
103 float xa = ZIN0(0); \
105 nova::NOVANAME##_vec_simd<64>(OUT(0), xa, IN(1)); \
109 FLATTEN void SCNAME##_ai_nova(BinaryOpUGen *unit, int inNumSamples) \
111 float xb = ZIN0(1); \
113 nova::NOVANAME##_vec_simd(OUT(0), IN(0), xb, inNumSamples); \
117 FLATTEN void SCNAME##_ai_nova_64(BinaryOpUGen *unit, int inNumSamples) \
119 float xb = ZIN0(1); \
121 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), xb); \
125 FLATTEN void SCNAME##_ak_nova(BinaryOpUGen *unit, int inNumSamples) \
127 float xb = unit->mPrevB; \
128 float next_b = ZIN0(1); \
130 if (xb == next_b) { \
131 nova::NOVANAME##_vec_simd(OUT(0), IN(0), xb, inNumSamples); \
133 float slope = CALCSLOPE(next_b, xb); \
134 nova::NOVANAME##_vec_simd(OUT(0), IN(0), slope_argument(xb, slope), inNumSamples); \
135 unit->mPrevB = next_b; \
139 FLATTEN void SCNAME##_ak_nova_64(BinaryOpUGen *unit, int inNumSamples) \
141 float xb = unit->mPrevB; \
142 float next_b = ZIN0(1); \
144 if (xb == next_b) { \
145 nova::NOVANAME##_vec_simd<64>(OUT(0), IN(0), xb); \
147 float slope = CALCSLOPE(next_b, xb); \
148 nova::NOVANAME##_vec_simd(OUT(0), IN(0), slope_argument(xb, slope), inNumSamples); \
149 unit->mPrevB = next_b; \
153 FLATTEN void SCNAME##_ka_nova(BinaryOpUGen *unit, int inNumSamples) \
155 float xa = unit->mPrevA; \
156 float next_a = ZIN0(0); \
158 if (xa == next_a) { \
159 nova::NOVANAME##_vec_simd(OUT(0), xa, IN(1), inNumSamples); \
161 float slope = CALCSLOPE(next_a, xa); \
162 nova::NOVANAME##_vec_simd(OUT(0), slope_argument(xa, slope), IN(1), inNumSamples); \
163 unit->mPrevA = next_a; \
166 FLATTEN void SCNAME##_ka_nova_64(BinaryOpUGen *unit, int inNumSamples) \
168 float xa = unit->mPrevA; \
169 float next_a = ZIN0(0); \
171 if (xa == next_a) { \
172 nova::NOVANAME##_vec_simd<64>(OUT(0), xa, IN(1)); \
174 float slope = CALCSLOPE(next_a, xa); \
175 nova::NOVANAME##_vec_simd(OUT(0), slope_argument(xa, slope), IN(1), inNumSamples); \
176 unit->mPrevA = next_a; \
183 using namespace std
; // for math functions
185 static InterfaceTable
*ft
;
187 //////////////////////////////////////////////////////////////////////////////////////////////////
190 /* special binary math operators */
225 opRing1
, // a * (b + 1) == a * b + a
226 opRing2
, // a * b + a + b
228 opRing4
, // a*a*b - a*b*b
229 opDifSqr
, // a*a - b*b
230 opSumSqr
, // a*a + b*b
231 opSqrSum
, // (a + b)^2
232 opSqrDif
, // (a - b)^2
249 inline float sc_andt(float a
, float b
)
251 return int(a
) & int(b
);
254 inline float sc_ort(float a
, float b
)
256 return int(a
) | int(b
);
259 inline float sc_xort(float a
, float b
)
261 return int(a
) ^ int(b
);
264 inline float sc_rst(float a
, float b
)
266 return int(a
) >> int(b
);
269 inline float sc_lst(float a
, float b
)
271 return int(a
) << int(b
);
274 struct BinaryOpUGen
: public Unit
276 float mPrevA
, mPrevB
;
279 typedef void (*BinaryOpFunc
)(BinaryOpUGen
*unit
, int inNumSamples
);
284 void BinaryOpUGen_Ctor(BinaryOpUGen
*unit
);
286 //void zero_d(BinaryOpUGen *unit, int inNumSamples);
287 void zero_1(BinaryOpUGen
*unit
, int inNumSamples
);
288 void zero_aa(BinaryOpUGen
*unit
, int inNumSamples
);
289 void firstarg_d(BinaryOpUGen
*unit
, int inNumSamples
);
290 void firstarg_1(BinaryOpUGen
*unit
, int inNumSamples
);
291 void firstarg_aa(BinaryOpUGen
*unit
, int inNumSamples
);
292 void secondarg_d(BinaryOpUGen
*unit
, int inNumSamples
);
293 void secondarg_1(BinaryOpUGen
*unit
, int inNumSamples
);
294 void secondarg_aa(BinaryOpUGen
*unit
, int inNumSamples
);
295 void add_d(BinaryOpUGen
*unit
, int inNumSamples
);
296 void add_1(BinaryOpUGen
*unit
, int inNumSamples
);
297 void add_aa(BinaryOpUGen
*unit
, int inNumSamples
);
298 void add_ak(BinaryOpUGen
*unit
, int inNumSamples
);
299 void add_ka(BinaryOpUGen
*unit
, int inNumSamples
);
300 void add_ai(BinaryOpUGen
*unit
, int inNumSamples
);
301 void add_ia(BinaryOpUGen
*unit
, int inNumSamples
);
302 void sub_d(BinaryOpUGen
*unit
, int inNumSamples
);
303 void sub_1(BinaryOpUGen
*unit
, int inNumSamples
);
304 void sub_aa(BinaryOpUGen
*unit
, int inNumSamples
);
305 void sub_ak(BinaryOpUGen
*unit
, int inNumSamples
);
306 void sub_ka(BinaryOpUGen
*unit
, int inNumSamples
);
307 void sub_ai(BinaryOpUGen
*unit
, int inNumSamples
);
308 void sub_ia(BinaryOpUGen
*unit
, int inNumSamples
);
309 void mul_d(BinaryOpUGen
*unit
, int inNumSamples
);
310 void mul_1(BinaryOpUGen
*unit
, int inNumSamples
);
311 void mul_aa(BinaryOpUGen
*unit
, int inNumSamples
);
312 void mul_ak(BinaryOpUGen
*unit
, int inNumSamples
);
313 void mul_ka(BinaryOpUGen
*unit
, int inNumSamples
);
314 void mul_ai(BinaryOpUGen
*unit
, int inNumSamples
);
315 void mul_ia(BinaryOpUGen
*unit
, int inNumSamples
);
316 void div_d(BinaryOpUGen
*unit
, int inNumSamples
);
317 void div_1(BinaryOpUGen
*unit
, int inNumSamples
);
318 void div_aa(BinaryOpUGen
*unit
, int inNumSamples
);
319 void div_ak(BinaryOpUGen
*unit
, int inNumSamples
);
320 void div_ka(BinaryOpUGen
*unit
, int inNumSamples
);
321 void div_ai(BinaryOpUGen
*unit
, int inNumSamples
);
322 void div_ia(BinaryOpUGen
*unit
, int inNumSamples
);
323 void mod_d(BinaryOpUGen
*unit
, int inNumSamples
);
324 void mod_1(BinaryOpUGen
*unit
, int inNumSamples
);
325 void mod_aa(BinaryOpUGen
*unit
, int inNumSamples
);
326 void mod_ak(BinaryOpUGen
*unit
, int inNumSamples
);
327 void mod_ka(BinaryOpUGen
*unit
, int inNumSamples
);
328 void mod_ai(BinaryOpUGen
*unit
, int inNumSamples
);
329 void mod_ia(BinaryOpUGen
*unit
, int inNumSamples
);
330 void max_d(BinaryOpUGen
*unit
, int inNumSamples
);
331 void max_1(BinaryOpUGen
*unit
, int inNumSamples
);
332 void max_aa(BinaryOpUGen
*unit
, int inNumSamples
);
333 void max_ak(BinaryOpUGen
*unit
, int inNumSamples
);
334 void max_ka(BinaryOpUGen
*unit
, int inNumSamples
);
335 void max_ai(BinaryOpUGen
*unit
, int inNumSamples
);
336 void max_ia(BinaryOpUGen
*unit
, int inNumSamples
);
337 void min_d(BinaryOpUGen
*unit
, int inNumSamples
);
338 void min_1(BinaryOpUGen
*unit
, int inNumSamples
);
339 void min_aa(BinaryOpUGen
*unit
, int inNumSamples
);
340 void min_ak(BinaryOpUGen
*unit
, int inNumSamples
);
341 void min_ka(BinaryOpUGen
*unit
, int inNumSamples
);
342 void min_ai(BinaryOpUGen
*unit
, int inNumSamples
);
343 void min_ia(BinaryOpUGen
*unit
, int inNumSamples
);
345 void and_d(BinaryOpUGen
*unit
, int inNumSamples
);
346 void and_1(BinaryOpUGen
*unit
, int inNumSamples
);
347 void and_aa(BinaryOpUGen
*unit
, int inNumSamples
);
348 void and_ak(BinaryOpUGen
*unit
, int inNumSamples
);
349 void and_ka(BinaryOpUGen
*unit
, int inNumSamples
);
350 void and_ai(BinaryOpUGen
*unit
, int inNumSamples
);
351 void and_ia(BinaryOpUGen
*unit
, int inNumSamples
);
353 void or_d(BinaryOpUGen
*unit
, int inNumSamples
);
354 void or_1(BinaryOpUGen
*unit
, int inNumSamples
);
355 void or_aa(BinaryOpUGen
*unit
, int inNumSamples
);
356 void or_ak(BinaryOpUGen
*unit
, int inNumSamples
);
357 void or_ka(BinaryOpUGen
*unit
, int inNumSamples
);
358 void or_ai(BinaryOpUGen
*unit
, int inNumSamples
);
359 void or_ia(BinaryOpUGen
*unit
, int inNumSamples
);
361 void xor_d(BinaryOpUGen
*unit
, int inNumSamples
);
362 void xor_1(BinaryOpUGen
*unit
, int inNumSamples
);
363 void xor_aa(BinaryOpUGen
*unit
, int inNumSamples
);
364 void xor_ak(BinaryOpUGen
*unit
, int inNumSamples
);
365 void xor_ka(BinaryOpUGen
*unit
, int inNumSamples
);
366 void xor_ai(BinaryOpUGen
*unit
, int inNumSamples
);
367 void xor_ia(BinaryOpUGen
*unit
, int inNumSamples
);
369 void amclip_d(BinaryOpUGen
*unit
, int inNumSamples
);
370 void amclip_1(BinaryOpUGen
*unit
, int inNumSamples
);
371 void amclip_aa(BinaryOpUGen
*unit
, int inNumSamples
);
372 void amclip_ak(BinaryOpUGen
*unit
, int inNumSamples
);
373 void amclip_ka(BinaryOpUGen
*unit
, int inNumSamples
);
374 void amclip_ai(BinaryOpUGen
*unit
, int inNumSamples
);
375 void amclip_ia(BinaryOpUGen
*unit
, int inNumSamples
);
376 void scaleneg_d(BinaryOpUGen
*unit
, int inNumSamples
);
377 void scaleneg_1(BinaryOpUGen
*unit
, int inNumSamples
);
378 void scaleneg_aa(BinaryOpUGen
*unit
, int inNumSamples
);
379 void scaleneg_ak(BinaryOpUGen
*unit
, int inNumSamples
);
380 void scaleneg_ka(BinaryOpUGen
*unit
, int inNumSamples
);
381 void scaleneg_ai(BinaryOpUGen
*unit
, int inNumSamples
);
382 void scaleneg_ia(BinaryOpUGen
*unit
, int inNumSamples
);
383 void pow_d(BinaryOpUGen
*unit
, int inNumSamples
);
384 void pow_1(BinaryOpUGen
*unit
, int inNumSamples
);
385 void pow_aa(BinaryOpUGen
*unit
, int inNumSamples
);
386 void pow_ak(BinaryOpUGen
*unit
, int inNumSamples
);
387 void pow_ka(BinaryOpUGen
*unit
, int inNumSamples
);
388 void pow_ai(BinaryOpUGen
*unit
, int inNumSamples
);
389 void pow_ia(BinaryOpUGen
*unit
, int inNumSamples
);
390 void ring1_d(BinaryOpUGen
*unit
, int inNumSamples
);
391 void ring1_1(BinaryOpUGen
*unit
, int inNumSamples
);
392 void ring1_aa(BinaryOpUGen
*unit
, int inNumSamples
);
393 void ring1_ak(BinaryOpUGen
*unit
, int inNumSamples
);
394 void ring1_ka(BinaryOpUGen
*unit
, int inNumSamples
);
395 void ring1_ai(BinaryOpUGen
*unit
, int inNumSamples
);
396 void ring1_ia(BinaryOpUGen
*unit
, int inNumSamples
);
397 void ring2_d(BinaryOpUGen
*unit
, int inNumSamples
);
398 void ring2_1(BinaryOpUGen
*unit
, int inNumSamples
);
399 void ring2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
400 void ring2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
401 void ring2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
402 void ring2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
403 void ring2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
404 void ring3_d(BinaryOpUGen
*unit
, int inNumSamples
);
405 void ring3_1(BinaryOpUGen
*unit
, int inNumSamples
);
406 void ring3_aa(BinaryOpUGen
*unit
, int inNumSamples
);
407 void ring3_ak(BinaryOpUGen
*unit
, int inNumSamples
);
408 void ring3_ka(BinaryOpUGen
*unit
, int inNumSamples
);
409 void ring3_ai(BinaryOpUGen
*unit
, int inNumSamples
);
410 void ring3_ia(BinaryOpUGen
*unit
, int inNumSamples
);
411 void ring4_d(BinaryOpUGen
*unit
, int inNumSamples
);
412 void ring4_1(BinaryOpUGen
*unit
, int inNumSamples
);
413 void ring4_aa(BinaryOpUGen
*unit
, int inNumSamples
);
414 void ring4_ak(BinaryOpUGen
*unit
, int inNumSamples
);
415 void ring4_ka(BinaryOpUGen
*unit
, int inNumSamples
);
416 void ring4_ai(BinaryOpUGen
*unit
, int inNumSamples
);
417 void ring4_ia(BinaryOpUGen
*unit
, int inNumSamples
);
418 void thresh_d(BinaryOpUGen
*unit
, int inNumSamples
);
419 void thresh_1(BinaryOpUGen
*unit
, int inNumSamples
);
420 void thresh_aa(BinaryOpUGen
*unit
, int inNumSamples
);
421 void thresh_ak(BinaryOpUGen
*unit
, int inNumSamples
);
422 void thresh_ka(BinaryOpUGen
*unit
, int inNumSamples
);
423 void thresh_ai(BinaryOpUGen
*unit
, int inNumSamples
);
424 void thresh_ia(BinaryOpUGen
*unit
, int inNumSamples
);
425 void clip2_d(BinaryOpUGen
*unit
, int inNumSamples
);
426 void clip2_1(BinaryOpUGen
*unit
, int inNumSamples
);
427 void clip2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
428 void clip2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
429 void clip2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
430 void clip2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
431 void clip2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
432 void fold2_d(BinaryOpUGen
*unit
, int inNumSamples
);
433 void fold2_1(BinaryOpUGen
*unit
, int inNumSamples
);
434 void fold2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
435 void fold2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
436 void fold2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
437 void fold2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
438 void fold2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
439 void wrap2_d(BinaryOpUGen
*unit
, int inNumSamples
);
440 void wrap2_1(BinaryOpUGen
*unit
, int inNumSamples
);
441 void wrap2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
442 void wrap2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
443 void wrap2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
444 void wrap2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
445 void wrap2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
446 void excess_d(BinaryOpUGen
*unit
, int inNumSamples
);
447 void excess_1(BinaryOpUGen
*unit
, int inNumSamples
);
448 void excess_aa(BinaryOpUGen
*unit
, int inNumSamples
);
449 void excess_ak(BinaryOpUGen
*unit
, int inNumSamples
);
450 void excess_ka(BinaryOpUGen
*unit
, int inNumSamples
);
451 void excess_ai(BinaryOpUGen
*unit
, int inNumSamples
);
452 void excess_ia(BinaryOpUGen
*unit
, int inNumSamples
);
453 void lt_d(BinaryOpUGen
*unit
, int inNumSamples
);
454 void lt_1(BinaryOpUGen
*unit
, int inNumSamples
);
455 void lt_aa(BinaryOpUGen
*unit
, int inNumSamples
);
456 void lt_ak(BinaryOpUGen
*unit
, int inNumSamples
);
457 void lt_ka(BinaryOpUGen
*unit
, int inNumSamples
);
458 void lt_ai(BinaryOpUGen
*unit
, int inNumSamples
);
459 void lt_ia(BinaryOpUGen
*unit
, int inNumSamples
);
460 void le_d(BinaryOpUGen
*unit
, int inNumSamples
);
461 void le_1(BinaryOpUGen
*unit
, int inNumSamples
);
462 void le_aa(BinaryOpUGen
*unit
, int inNumSamples
);
463 void le_ak(BinaryOpUGen
*unit
, int inNumSamples
);
464 void le_ka(BinaryOpUGen
*unit
, int inNumSamples
);
465 void le_ai(BinaryOpUGen
*unit
, int inNumSamples
);
466 void le_ia(BinaryOpUGen
*unit
, int inNumSamples
);
467 void gt_d(BinaryOpUGen
*unit
, int inNumSamples
);
468 void gt_1(BinaryOpUGen
*unit
, int inNumSamples
);
469 void gt_aa(BinaryOpUGen
*unit
, int inNumSamples
);
470 void gt_ak(BinaryOpUGen
*unit
, int inNumSamples
);
471 void gt_ka(BinaryOpUGen
*unit
, int inNumSamples
);
472 void gt_ai(BinaryOpUGen
*unit
, int inNumSamples
);
473 void gt_ia(BinaryOpUGen
*unit
, int inNumSamples
);
474 void ge_d(BinaryOpUGen
*unit
, int inNumSamples
);
475 void ge_1(BinaryOpUGen
*unit
, int inNumSamples
);
476 void ge_aa(BinaryOpUGen
*unit
, int inNumSamples
);
477 void ge_ak(BinaryOpUGen
*unit
, int inNumSamples
);
478 void ge_ka(BinaryOpUGen
*unit
, int inNumSamples
);
479 void ge_ai(BinaryOpUGen
*unit
, int inNumSamples
);
480 void ge_ia(BinaryOpUGen
*unit
, int inNumSamples
);
481 void eq_d(BinaryOpUGen
*unit
, int inNumSamples
);
482 void eq_1(BinaryOpUGen
*unit
, int inNumSamples
);
483 void eq_aa(BinaryOpUGen
*unit
, int inNumSamples
);
484 void eq_ak(BinaryOpUGen
*unit
, int inNumSamples
);
485 void eq_ka(BinaryOpUGen
*unit
, int inNumSamples
);
486 void eq_ai(BinaryOpUGen
*unit
, int inNumSamples
);
487 void eq_ia(BinaryOpUGen
*unit
, int inNumSamples
);
488 void neq_d(BinaryOpUGen
*unit
, int inNumSamples
);
489 void neq_1(BinaryOpUGen
*unit
, int inNumSamples
);
490 void neq_aa(BinaryOpUGen
*unit
, int inNumSamples
);
491 void neq_ak(BinaryOpUGen
*unit
, int inNumSamples
);
492 void neq_ka(BinaryOpUGen
*unit
, int inNumSamples
);
493 void neq_ai(BinaryOpUGen
*unit
, int inNumSamples
);
494 void neq_ia(BinaryOpUGen
*unit
, int inNumSamples
);
495 void sumsqr_d(BinaryOpUGen
*unit
, int inNumSamples
);
496 void sumsqr_1(BinaryOpUGen
*unit
, int inNumSamples
);
497 void sumsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
);
498 void sumsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
);
499 void sumsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
);
500 void sumsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
);
501 void sumsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
);
502 void difsqr_d(BinaryOpUGen
*unit
, int inNumSamples
);
503 void difsqr_1(BinaryOpUGen
*unit
, int inNumSamples
);
504 void difsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
);
505 void difsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
);
506 void difsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
);
507 void difsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
);
508 void difsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
);
509 void sqrsum_d(BinaryOpUGen
*unit
, int inNumSamples
);
510 void sqrsum_1(BinaryOpUGen
*unit
, int inNumSamples
);
511 void sqrsum_aa(BinaryOpUGen
*unit
, int inNumSamples
);
512 void sqrsum_ak(BinaryOpUGen
*unit
, int inNumSamples
);
513 void sqrsum_ka(BinaryOpUGen
*unit
, int inNumSamples
);
514 void sqrsum_ai(BinaryOpUGen
*unit
, int inNumSamples
);
515 void sqrsum_ia(BinaryOpUGen
*unit
, int inNumSamples
);
516 void sqrdif_d(BinaryOpUGen
*unit
, int inNumSamples
);
517 void sqrdif_1(BinaryOpUGen
*unit
, int inNumSamples
);
518 void sqrdif_aa(BinaryOpUGen
*unit
, int inNumSamples
);
519 void sqrdif_ak(BinaryOpUGen
*unit
, int inNumSamples
);
520 void sqrdif_ka(BinaryOpUGen
*unit
, int inNumSamples
);
521 void sqrdif_ai(BinaryOpUGen
*unit
, int inNumSamples
);
522 void sqrdif_ia(BinaryOpUGen
*unit
, int inNumSamples
);
523 void absdif_d(BinaryOpUGen
*unit
, int inNumSamples
);
524 void absdif_1(BinaryOpUGen
*unit
, int inNumSamples
);
525 void absdif_aa(BinaryOpUGen
*unit
, int inNumSamples
);
526 void absdif_ak(BinaryOpUGen
*unit
, int inNumSamples
);
527 void absdif_ka(BinaryOpUGen
*unit
, int inNumSamples
);
528 void absdif_ai(BinaryOpUGen
*unit
, int inNumSamples
);
529 void absdif_ia(BinaryOpUGen
*unit
, int inNumSamples
);
530 void round_d(BinaryOpUGen
*unit
, int inNumSamples
);
531 void round_1(BinaryOpUGen
*unit
, int inNumSamples
);
532 void round_aa(BinaryOpUGen
*unit
, int inNumSamples
);
533 void round_ak(BinaryOpUGen
*unit
, int inNumSamples
);
534 void round_ka(BinaryOpUGen
*unit
, int inNumSamples
);
535 void round_ai(BinaryOpUGen
*unit
, int inNumSamples
);
536 void round_ia(BinaryOpUGen
*unit
, int inNumSamples
);
537 void roundUp_d(BinaryOpUGen
*unit
, int inNumSamples
);
538 void roundUp_1(BinaryOpUGen
*unit
, int inNumSamples
);
539 void roundUp_aa(BinaryOpUGen
*unit
, int inNumSamples
);
540 void roundUp_ak(BinaryOpUGen
*unit
, int inNumSamples
);
541 void roundUp_ka(BinaryOpUGen
*unit
, int inNumSamples
);
542 void roundUp_ai(BinaryOpUGen
*unit
, int inNumSamples
);
543 void roundUp_ia(BinaryOpUGen
*unit
, int inNumSamples
);
544 void trunc_d(BinaryOpUGen
*unit
, int inNumSamples
);
545 void trunc_1(BinaryOpUGen
*unit
, int inNumSamples
);
546 void trunc_aa(BinaryOpUGen
*unit
, int inNumSamples
);
547 void trunc_ak(BinaryOpUGen
*unit
, int inNumSamples
);
548 void trunc_ka(BinaryOpUGen
*unit
, int inNumSamples
);
549 void trunc_ai(BinaryOpUGen
*unit
, int inNumSamples
);
550 void trunc_ia(BinaryOpUGen
*unit
, int inNumSamples
);
551 void atan2_d(BinaryOpUGen
*unit
, int inNumSamples
);
552 void atan2_1(BinaryOpUGen
*unit
, int inNumSamples
);
553 void atan2_aa(BinaryOpUGen
*unit
, int inNumSamples
);
554 void atan2_ak(BinaryOpUGen
*unit
, int inNumSamples
);
555 void atan2_ka(BinaryOpUGen
*unit
, int inNumSamples
);
556 void atan2_ai(BinaryOpUGen
*unit
, int inNumSamples
);
557 void atan2_ia(BinaryOpUGen
*unit
, int inNumSamples
);
558 void hypot_d(BinaryOpUGen
*unit
, int inNumSamples
);
559 void hypot_1(BinaryOpUGen
*unit
, int inNumSamples
);
560 void hypot_aa(BinaryOpUGen
*unit
, int inNumSamples
);
561 void hypot_ak(BinaryOpUGen
*unit
, int inNumSamples
);
562 void hypot_ka(BinaryOpUGen
*unit
, int inNumSamples
);
563 void hypot_ai(BinaryOpUGen
*unit
, int inNumSamples
);
564 void hypot_ia(BinaryOpUGen
*unit
, int inNumSamples
);
565 void hypotx_d(BinaryOpUGen
*unit
, int inNumSamples
);
566 void hypotx_1(BinaryOpUGen
*unit
, int inNumSamples
);
567 void hypotx_aa(BinaryOpUGen
*unit
, int inNumSamples
);
568 void hypotx_ak(BinaryOpUGen
*unit
, int inNumSamples
);
569 void hypotx_ka(BinaryOpUGen
*unit
, int inNumSamples
);
570 void hypotx_ai(BinaryOpUGen
*unit
, int inNumSamples
);
571 void hypotx_ia(BinaryOpUGen
*unit
, int inNumSamples
);
574 ////////////////////////////////////////////////////////////////////////////////////////////////////////
576 static bool ChooseOperatorFunc(BinaryOpUGen
*unit
);
578 void BinaryOpUGen_Ctor(BinaryOpUGen
*unit
)
580 unit
->mPrevA
= ZIN0(0);
581 unit
->mPrevB
= ZIN0(1);
582 bool initialized
= ChooseOperatorFunc(unit
);
583 if (unit
->mCalcRate
== calc_DemandRate
) {
587 (unit
->mCalcFunc
)(unit
, 1);
592 void zero_d(BinaryOpUGen *unit, int inNumSamples)
595 float a = DEMANDINPUT_A(0, inNumSamples);
596 float b = DEMANDINPUT_A(1, inNumSamples);
597 OUT0(0) = sc_isnan(a) || sc_isnan(b) ? NAN : 0.f;
605 void firstarg_d(BinaryOpUGen
*unit
, int inNumSamples
)
608 float a
= DEMANDINPUT_A(0, inNumSamples
);
609 float b
= DEMANDINPUT_A(1, inNumSamples
);
610 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
;
617 void secondarg_d(BinaryOpUGen
*unit
, int inNumSamples
)
620 float a
= DEMANDINPUT_A(0, inNumSamples
);
621 float b
= DEMANDINPUT_A(1, inNumSamples
);
622 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: b
;
629 void add_d(BinaryOpUGen
*unit
, int inNumSamples
)
632 float a
= DEMANDINPUT_A(0, inNumSamples
);
633 float b
= DEMANDINPUT_A(1, inNumSamples
);
634 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
+ b
;
641 void sub_d(BinaryOpUGen
*unit
, int inNumSamples
)
644 float a
= DEMANDINPUT_A(0, inNumSamples
);
645 float b
= DEMANDINPUT_A(1, inNumSamples
);
646 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
- b
;
653 void mul_d(BinaryOpUGen
*unit
, int inNumSamples
)
656 float a
= DEMANDINPUT_A(0, inNumSamples
);
657 float b
= DEMANDINPUT_A(1, inNumSamples
);
658 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* b
;
665 void div_d(BinaryOpUGen
*unit
, int inNumSamples
)
668 float a
= DEMANDINPUT_A(0, inNumSamples
);
669 float b
= DEMANDINPUT_A(1, inNumSamples
);
670 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
/ b
;
677 void mod_d(BinaryOpUGen
*unit
, int inNumSamples
)
680 float a
= DEMANDINPUT_A(0, inNumSamples
);
681 float b
= DEMANDINPUT_A(1, inNumSamples
);
682 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_mod(a
, b
);
689 void max_d(BinaryOpUGen
*unit
, int inNumSamples
)
692 float a
= DEMANDINPUT_A(0, inNumSamples
);
693 float b
= DEMANDINPUT_A(1, inNumSamples
);
694 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_max(a
, b
);
701 void min_d(BinaryOpUGen
*unit
, int inNumSamples
)
704 float a
= DEMANDINPUT_A(0, inNumSamples
);
705 float b
= DEMANDINPUT_A(1, inNumSamples
);
706 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_min(a
, b
);
713 void and_d(BinaryOpUGen
*unit
, int inNumSamples
)
716 float a
= DEMANDINPUT_A(0, inNumSamples
);
717 float b
= DEMANDINPUT_A(1, inNumSamples
);
718 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_andt(a
, b
);
725 void or_d(BinaryOpUGen
*unit
, int inNumSamples
)
728 float a
= DEMANDINPUT_A(0, inNumSamples
);
729 float b
= DEMANDINPUT_A(1, inNumSamples
);
730 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_ort(a
, b
);
737 void xor_d(BinaryOpUGen
*unit
, int inNumSamples
)
740 float a
= DEMANDINPUT_A(0, inNumSamples
);
741 float b
= DEMANDINPUT_A(1, inNumSamples
);
742 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_xort(a
, b
);
749 void rightShift_d(BinaryOpUGen
*unit
, int inNumSamples
)
752 float a
= DEMANDINPUT_A(0, inNumSamples
);
753 float b
= DEMANDINPUT_A(1, inNumSamples
);
754 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_rst(a
, b
);
761 void leftShift_d(BinaryOpUGen
*unit
, int inNumSamples
)
764 float a
= DEMANDINPUT_A(0, inNumSamples
);
765 float b
= DEMANDINPUT_A(1, inNumSamples
);
766 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_lst(a
, b
);
773 void amclip_d(BinaryOpUGen
*unit
, int inNumSamples
)
776 float a
= DEMANDINPUT_A(0, inNumSamples
);
777 float b
= DEMANDINPUT_A(1, inNumSamples
);
778 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_amclip(a
, b
);
785 void scaleneg_d(BinaryOpUGen
*unit
, int inNumSamples
)
788 float a
= DEMANDINPUT_A(0, inNumSamples
);
789 float b
= DEMANDINPUT_A(1, inNumSamples
);
790 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_scaleneg(a
, b
);
797 void pow_d(BinaryOpUGen
*unit
, int inNumSamples
)
800 float a
= DEMANDINPUT_A(0, inNumSamples
);
801 float b
= DEMANDINPUT_A(1, inNumSamples
);
802 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
< 0.f
? -pow(-a
, b
) : pow(a
, b
));
809 void ring1_d(BinaryOpUGen
*unit
, int inNumSamples
)
812 float a
= DEMANDINPUT_A(0, inNumSamples
);
813 float b
= DEMANDINPUT_A(1, inNumSamples
);
814 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* b
+ a
;
821 void ring2_d(BinaryOpUGen
*unit
, int inNumSamples
)
824 float a
= DEMANDINPUT_A(0, inNumSamples
);
825 float b
= DEMANDINPUT_A(1, inNumSamples
);
826 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* b
+ a
+ b
;
833 void ring3_d(BinaryOpUGen
*unit
, int inNumSamples
)
836 float a
= DEMANDINPUT_A(0, inNumSamples
);
837 float b
= DEMANDINPUT_A(1, inNumSamples
);
838 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
* b
;
845 void ring4_d(BinaryOpUGen
*unit
, int inNumSamples
)
848 float a
= DEMANDINPUT_A(0, inNumSamples
);
849 float b
= DEMANDINPUT_A(1, inNumSamples
);
850 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
* b
- a
* b
* b
;
857 void thresh_d(BinaryOpUGen
*unit
, int inNumSamples
)
860 float a
= DEMANDINPUT_A(0, inNumSamples
);
861 float b
= DEMANDINPUT_A(1, inNumSamples
);
862 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_thresh(a
, b
);
869 void clip2_d(BinaryOpUGen
*unit
, int inNumSamples
)
872 float a
= DEMANDINPUT_A(0, inNumSamples
);
873 float b
= DEMANDINPUT_A(1, inNumSamples
);
874 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_clip2(a
, b
);
881 void excess_d(BinaryOpUGen
*unit
, int inNumSamples
)
884 float a
= DEMANDINPUT_A(0, inNumSamples
);
885 float b
= DEMANDINPUT_A(1, inNumSamples
);
886 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_excess(a
, b
);
893 void lt_d(BinaryOpUGen
*unit
, int inNumSamples
)
896 float a
= DEMANDINPUT_A(0, inNumSamples
);
897 float b
= DEMANDINPUT_A(1, inNumSamples
);
898 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
< b
? 1.f
: 0.f
);
905 void gt_d(BinaryOpUGen
*unit
, int inNumSamples
)
908 float a
= DEMANDINPUT_A(0, inNumSamples
);
909 float b
= DEMANDINPUT_A(1, inNumSamples
);
910 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
> b
? 1.f
: 0.f
);
917 void le_d(BinaryOpUGen
*unit
, int inNumSamples
)
920 float a
= DEMANDINPUT_A(0, inNumSamples
);
921 float b
= DEMANDINPUT_A(1, inNumSamples
);
922 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
<= b
? 1.f
: 0.f
);
929 void ge_d(BinaryOpUGen
*unit
, int inNumSamples
)
932 float a
= DEMANDINPUT_A(0, inNumSamples
);
933 float b
= DEMANDINPUT_A(1, inNumSamples
);
934 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
>= b
? 1.f
: 0.f
);
941 void eq_d(BinaryOpUGen
*unit
, int inNumSamples
)
944 float a
= DEMANDINPUT_A(0, inNumSamples
);
945 float b
= DEMANDINPUT_A(1, inNumSamples
);
946 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
== b
? 1.f
: 0.f
);
953 void neq_d(BinaryOpUGen
*unit
, int inNumSamples
)
956 float a
= DEMANDINPUT_A(0, inNumSamples
);
957 float b
= DEMANDINPUT_A(1, inNumSamples
);
958 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (a
!= b
? 1.f
: 0.f
);
965 void sumsqr_d(BinaryOpUGen
*unit
, int inNumSamples
)
968 float a
= DEMANDINPUT_A(0, inNumSamples
);
969 float b
= DEMANDINPUT_A(1, inNumSamples
);
970 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
+ b
* b
;
977 void difsqr_d(BinaryOpUGen
*unit
, int inNumSamples
)
980 float a
= DEMANDINPUT_A(0, inNumSamples
);
981 float b
= DEMANDINPUT_A(1, inNumSamples
);
982 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: a
* a
- b
* b
;
989 void sqrsum_d(BinaryOpUGen
*unit
, int inNumSamples
)
992 float a
= DEMANDINPUT_A(0, inNumSamples
);
993 float b
= DEMANDINPUT_A(1, inNumSamples
);
995 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (z
= a
+ b
, z
* z
);
1002 void sqrdif_d(BinaryOpUGen
*unit
, int inNumSamples
)
1005 float a
= DEMANDINPUT_A(0, inNumSamples
);
1006 float b
= DEMANDINPUT_A(1, inNumSamples
);
1008 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: (z
= a
- b
, z
* z
);
1015 void absdif_d(BinaryOpUGen
*unit
, int inNumSamples
)
1018 float a
= DEMANDINPUT_A(0, inNumSamples
);
1019 float b
= DEMANDINPUT_A(1, inNumSamples
);
1020 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: fabs(a
- b
);
1027 void round_d(BinaryOpUGen
*unit
, int inNumSamples
)
1030 float a
= DEMANDINPUT_A(0, inNumSamples
);
1031 float b
= DEMANDINPUT_A(1, inNumSamples
);
1032 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_round(a
, b
);
1039 void roundUp_d(BinaryOpUGen
*unit
, int inNumSamples
)
1042 float a
= DEMANDINPUT_A(0, inNumSamples
);
1043 float b
= DEMANDINPUT_A(1, inNumSamples
);
1044 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_roundUp(a
, b
);
1051 void trunc_d(BinaryOpUGen
*unit
, int inNumSamples
)
1054 float a
= DEMANDINPUT_A(0, inNumSamples
);
1055 float b
= DEMANDINPUT_A(1, inNumSamples
);
1056 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_trunc(a
, b
);
1063 void fold2_d(BinaryOpUGen
*unit
, int inNumSamples
)
1066 float a
= DEMANDINPUT_A(0, inNumSamples
);
1067 float b
= DEMANDINPUT_A(1, inNumSamples
);
1068 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_fold2(a
, b
);
1075 void wrap2_d(BinaryOpUGen
*unit
, int inNumSamples
)
1078 float a
= DEMANDINPUT_A(0, inNumSamples
);
1079 float b
= DEMANDINPUT_A(1, inNumSamples
);
1080 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_wrap2(a
, b
);
1087 void atan2_d(BinaryOpUGen
*unit
, int inNumSamples
)
1090 float a
= DEMANDINPUT_A(0, inNumSamples
);
1091 float b
= DEMANDINPUT_A(1, inNumSamples
);
1092 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: atan2(a
, b
);
1099 void hypot_d(BinaryOpUGen
*unit
, int inNumSamples
)
1102 float a
= DEMANDINPUT_A(0, inNumSamples
);
1103 float b
= DEMANDINPUT_A(1, inNumSamples
);
1104 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: hypot(a
, b
);
1111 void hypotx_d(BinaryOpUGen
*unit
, int inNumSamples
)
1114 float a
= DEMANDINPUT_A(0, inNumSamples
);
1115 float b
= DEMANDINPUT_A(1, inNumSamples
);
1116 OUT0(0) = sc_isnan(a
) || sc_isnan(b
) ? NAN
: sc_hypotx(a
, b
);
1125 void zero_1(BinaryOpUGen
*unit
, int inNumSamples
)
1130 void firstarg_1(BinaryOpUGen
*unit
, int inNumSamples
)
1135 void secondarg_1(BinaryOpUGen
*unit
, int inNumSamples
)
1140 void add_1(BinaryOpUGen
*unit
, int inNumSamples
)
1142 ZOUT0(0) = ZIN0(0) + ZIN0(1);
1145 void sub_1(BinaryOpUGen
*unit
, int inNumSamples
)
1147 ZOUT0(0) = ZIN0(0) - ZIN0(1);
1150 void mul_1(BinaryOpUGen
*unit
, int inNumSamples
)
1152 ZOUT0(0) = ZIN0(0) * ZIN0(1);
1155 void div_1(BinaryOpUGen
*unit
, int inNumSamples
)
1157 ZOUT0(0) = ZIN0(0) / ZIN0(1);
1160 void mod_1(BinaryOpUGen
*unit
, int inNumSamples
)
1164 ZOUT0(0) = sc_mod(xa
, xb
);
1167 void max_1(BinaryOpUGen
*unit
, int inNumSamples
)
1171 ZOUT0(0) = sc_max(xa
, xb
);
1174 void min_1(BinaryOpUGen
*unit
, int inNumSamples
)
1178 ZOUT0(0) = sc_min(xa
, xb
);
1181 void and_1(BinaryOpUGen
*unit
, int inNumSamples
)
1185 ZOUT0(0) = sc_andt(xa
, xb
);
1188 void or_1(BinaryOpUGen
*unit
, int inNumSamples
)
1192 ZOUT0(0) = sc_ort(xa
, xb
);
1195 void xor_1(BinaryOpUGen
*unit
, int inNumSamples
)
1199 ZOUT0(0) = sc_xort(xa
, xb
);
1202 void rightShift_1(BinaryOpUGen
*unit
, int inNumSamples
)
1206 ZOUT0(0) = sc_rst(xa
, xb
);
1209 void leftShift_1(BinaryOpUGen
*unit
, int inNumSamples
)
1213 ZOUT0(0) = sc_lst(xa
, xb
);
1216 void amclip_1(BinaryOpUGen
*unit
, int inNumSamples
)
1220 ZOUT0(0) = sc_amclip(xa
, xb
);
1223 void scaleneg_1(BinaryOpUGen
*unit
, int inNumSamples
)
1227 ZOUT0(0) = xa
>= 0.f
? xa
: xa
* xb
;
1230 void pow_1(BinaryOpUGen
*unit
, int inNumSamples
)
1234 ZOUT0(0) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
1238 void ring1_1(BinaryOpUGen
*unit
, int inNumSamples
)
1242 ZOUT0(0) = xa
* xb
+ xa
;
1245 void ring2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1249 ZOUT0(0) = xa
* xb
+ xa
+ xb
;
1252 void ring3_1(BinaryOpUGen
*unit
, int inNumSamples
)
1256 ZOUT0(0) = xa
* xa
* xb
;
1259 void ring4_1(BinaryOpUGen
*unit
, int inNumSamples
)
1263 ZOUT0(0) = xa
* xa
* xb
- xa
* xb
* xb
;
1266 void thresh_1(BinaryOpUGen
*unit
, int inNumSamples
)
1270 ZOUT0(0) = xa
< xb
? 0.f
: xa
;
1273 void clip2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1277 ZOUT0(0) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
1280 void excess_1(BinaryOpUGen
*unit
, int inNumSamples
)
1284 ZOUT0(0) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
1287 void lt_1(BinaryOpUGen
*unit
, int inNumSamples
)
1291 ZOUT0(0) = xa
< xb
? 1.f
: 0.f
;
1294 void le_1(BinaryOpUGen
*unit
, int inNumSamples
)
1298 ZOUT0(0) = xa
<= xb
? 1.f
: 0.f
;
1301 void gt_1(BinaryOpUGen
*unit
, int inNumSamples
)
1305 ZOUT0(0) = xa
> xb
? 1.f
: 0.f
;
1308 void ge_1(BinaryOpUGen
*unit
, int inNumSamples
)
1312 ZOUT0(0) = xa
>= xb
? 1.f
: 0.f
;
1315 void eq_1(BinaryOpUGen
*unit
, int inNumSamples
)
1319 ZOUT0(0) = xa
== xb
? 1.f
: 0.f
;
1322 void neq_1(BinaryOpUGen
*unit
, int inNumSamples
)
1326 ZOUT0(0) = xa
!= xb
? 1.f
: 0.f
;
1330 void sumsqr_1(BinaryOpUGen
*unit
, int inNumSamples
)
1334 ZOUT0(0) = xa
* xa
+ xb
* xb
;
1337 void difsqr_1(BinaryOpUGen
*unit
, int inNumSamples
)
1341 ZOUT0(0) = xa
* xa
- xb
* xb
;
1344 void sqrsum_1(BinaryOpUGen
*unit
, int inNumSamples
)
1348 float sum
= xa
+ xb
;
1349 ZOUT0(0) = sum
* sum
;
1352 void sqrdif_1(BinaryOpUGen
*unit
, int inNumSamples
)
1356 float dif
= xa
- xb
;
1357 ZOUT0(0) = dif
* dif
;
1360 void absdif_1(BinaryOpUGen
*unit
, int inNumSamples
)
1364 ZOUT0(0) = fabs(xa
- xb
);
1367 void round_1(BinaryOpUGen
*unit
, int inNumSamples
)
1371 ZOUT0(0) = sc_round(xa
, xb
);
1374 void roundUp_1(BinaryOpUGen
*unit
, int inNumSamples
)
1378 ZOUT0(0) = sc_roundUp(xa
, xb
);
1381 void trunc_1(BinaryOpUGen
*unit
, int inNumSamples
)
1385 ZOUT0(0) = sc_trunc(xa
, xb
);
1388 void fold2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1392 ZOUT0(0) = sc_fold(xa
, -xb
, xb
);
1395 void wrap2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1399 ZOUT0(0) = sc_wrap(xa
, -xb
, xb
);
1402 void atan2_1(BinaryOpUGen
*unit
, int inNumSamples
)
1406 ZOUT0(0) = atan2(xa
, xb
);
1409 void hypot_1(BinaryOpUGen
*unit
, int inNumSamples
)
1413 ZOUT0(0) = hypot(xa
, xb
);
1416 void hypotx_1(BinaryOpUGen
*unit
, int inNumSamples
)
1420 ZOUT0(0) = sc_hypotx(xa
, xb
);
1425 void zero_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1427 float *out
= ZOUT(0);
1429 ZClear(inNumSamples
, out
);
1432 void firstarg_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1434 float *out
= ZOUT(0);
1437 ZCopy(inNumSamples
, out
, a
);
1441 FLATTEN
void firstarg_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1443 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1447 void secondarg_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1449 float *out
= ZOUT(0);
1452 ZCopy(inNumSamples
, out
, b
);
1456 FLATTEN
void secondarg_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1458 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1462 void add_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1464 float *out
= ZOUT(0);
1469 ZXP(out
) = ZXP(a
) + ZXP(b
);
1473 void add_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1475 float *out
= ZOUT(0);
1477 float xb
= unit
->mPrevB
;
1478 float next_b
= ZIN0(1);
1482 ZCopy(inNumSamples
, out
, a
);
1484 float *out
= ZOUT(0);
1487 ZXP(out
) = ZXP(a
) + xb
;
1491 float slope
= CALCSLOPE(next_b
, xb
);
1493 ZXP(out
) = ZXP(a
) + xb
;
1501 void add_ka(BinaryOpUGen
*unit
, int inNumSamples
)
1503 float *out
= ZOUT(0);
1504 float xa
= unit
->mPrevA
;
1506 float next_a
= ZIN0(0);
1510 ZCopy(inNumSamples
, out
, b
);
1513 ZXP(out
) = xa
+ ZXP(b
);
1517 float slope
= CALCSLOPE(next_a
, xa
);
1519 ZXP(out
) = xa
+ ZXP(b
);
1526 void add_ia(BinaryOpUGen
*unit
, int inNumSamples
)
1528 float *out
= ZOUT(0);
1533 ZXP(out
) = xa
+ ZXP(b
);
1538 void add_ai(BinaryOpUGen
*unit
, int inNumSamples
)
1540 float *out
= ZOUT(0);
1545 ZXP(out
) = ZXP(a
) + xb
;
1551 NOVA_BINARY_WRAPPER(add
, plus
)
1553 FLATTEN
void add_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1555 float xb
= unit
->mPrevB
;
1556 float next_b
= ZIN0(1);
1560 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1562 nova::plus_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
1564 float slope
= CALCSLOPE(next_b
, xb
);
1565 nova::plus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1566 unit
->mPrevB
= next_b
;
1570 FLATTEN
void add_ak_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1572 float xb
= unit
->mPrevB
;
1573 float next_b
= ZIN0(1);
1577 nova::copyvec_simd
<64>(OUT(0), IN(0));
1579 nova::plus_vec_simd
<64>(OUT(0), IN(0), xb
);
1581 float slope
= CALCSLOPE(next_b
, xb
);
1582 nova::plus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1583 unit
->mPrevB
= next_b
;
1588 FLATTEN
void add_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1590 float xa
= unit
->mPrevA
;
1591 float next_a
= ZIN0(0);
1595 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1597 nova::plus_vec_simd(OUT(0), IN(1), xa
, inNumSamples
);
1599 float slope
= CALCSLOPE(next_a
, xa
);
1600 nova::plus_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1601 unit
->mPrevA
= next_a
;
1605 FLATTEN
void add_ka_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1607 float xa
= unit
->mPrevA
;
1608 float next_a
= ZIN0(0);
1612 nova::copyvec_simd
<64>(OUT(0), IN(1));
1614 nova::plus_vec_simd
<64>(OUT(0), IN(1), xa
);
1616 float slope
= CALCSLOPE(next_a
, xa
);
1617 nova::plus_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1618 unit
->mPrevA
= next_a
;
1626 /////////////////////////
1630 void sub_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1632 float *out
= ZOUT(0);
1637 ZXP(out
) = ZXP(a
) - ZXP(b
);
1641 void sub_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1643 float *out
= ZOUT(0);
1645 float xb
= unit
->mPrevB
;
1646 float next_b
= ZIN0(1);
1650 ZCopy(inNumSamples
, out
, a
);
1653 ZXP(out
) = ZXP(a
) - xb
;
1657 float slope
= CALCSLOPE(next_b
, xb
);
1659 ZXP(out
) = ZXP(a
) - xb
;
1666 void sub_ka(BinaryOpUGen
*unit
, int inNumSamples
)
1668 float *out
= ZOUT(0);
1669 float xa
= unit
->mPrevA
;
1671 float next_a
= ZIN0(0);
1675 ZCopy(inNumSamples
, out
, b
);
1678 ZXP(out
) = xa
- ZXP(b
);
1682 float slope
= CALCSLOPE(next_a
, xa
);
1684 ZXP(out
) = xa
- ZXP(b
);
1692 void sub_ia(BinaryOpUGen
*unit
, int inNumSamples
)
1694 float *out
= ZOUT(0);
1699 ZXP(out
) = xa
- ZXP(b
);
1704 void sub_ai(BinaryOpUGen
*unit
, int inNumSamples
)
1706 float *out
= ZOUT(0);
1711 ZXP(out
) = ZXP(a
) - xb
;
1717 NOVA_BINARY_WRAPPER(sub
, minus
)
1719 FLATTEN
void sub_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1721 float xb
= unit
->mPrevB
;
1722 float next_b
= ZIN0(1);
1726 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1728 nova::minus_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
1730 float slope
= CALCSLOPE(next_b
, xb
);
1731 nova::minus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1732 unit
->mPrevB
= next_b
;
1736 FLATTEN
void sub_ak_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1738 float xb
= unit
->mPrevB
;
1739 float next_b
= ZIN0(1);
1743 nova::copyvec_aa_simd
<64>(OUT(0), IN(0));
1745 nova::minus_vec_simd
<64>(OUT(0), IN(0), xb
);
1747 float slope
= CALCSLOPE(next_b
, xb
);
1748 nova::minus_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1749 unit
->mPrevB
= next_b
;
1753 FLATTEN
void sub_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1755 float xa
= unit
->mPrevA
;
1756 float next_a
= ZIN0(0);
1760 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1762 nova::minus_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
1764 float slope
= CALCSLOPE(next_a
, xa
);
1765 nova::minus_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
1766 unit
->mPrevA
= next_a
;
1770 FLATTEN
void sub_ka_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1772 float xa
= unit
->mPrevA
;
1773 float next_a
= ZIN0(0);
1777 nova::copyvec_simd
<64>(OUT(0), IN(1));
1779 nova::minus_vec_simd
<64>(OUT(0), xa
, IN(1));
1781 float slope
= CALCSLOPE(next_a
, xa
);
1782 nova::minus_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
1783 unit
->mPrevA
= next_a
;
1791 void mul_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1793 float *out
= ZOUT(0);
1798 ZXP(out
) = ZXP(a
) * ZXP(b
);
1802 void mul_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1804 float *out
= ZOUT(0);
1806 float xb
= unit
->mPrevB
;
1807 float next_b
= ZIN0(1);
1811 ZClear(inNumSamples
, out
);
1812 } else if (xb
== 1.f
) {
1813 ZCopy(inNumSamples
, out
, a
);
1816 ZXP(out
) = ZXP(a
) * xb
;
1820 float slope
= CALCSLOPE(next_b
, xb
);
1822 ZXP(out
) = ZXP(a
) * xb
;
1829 void mul_ka(BinaryOpUGen
*unit
, int inNumSamples
)
1831 float *out
= ZOUT(0);
1832 float xa
= unit
->mPrevA
;
1834 float next_a
= ZIN0(0);
1838 ZClear(inNumSamples
, out
);
1839 } else if (xa
== 1.f
) {
1840 ZCopy(inNumSamples
, out
, b
);
1843 ZXP(out
) = xa
* ZXP(b
);
1847 float slope
= CALCSLOPE(next_a
, xa
);
1849 ZXP(out
) = xa
* ZXP(b
);
1857 void mul_ai(BinaryOpUGen
*unit
, int inNumSamples
)
1859 float *out
= ZOUT(0);
1864 ZXP(out
) = ZXP(a
) * xb
;
1869 void mul_ia(BinaryOpUGen
*unit
, int inNumSamples
)
1871 float *out
= ZOUT(0);
1876 ZXP(out
) = xa
* ZXP(b
);
1882 NOVA_BINARY_WRAPPER(mul
, times
)
1884 FLATTEN
void mul_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1886 float xa
= unit
->mPrevA
;
1887 float next_a
= ZIN0(0);
1891 nova::zerovec_simd(OUT(0), inNumSamples
);
1893 nova::copyvec_simd(OUT(0), IN(1), inNumSamples
);
1895 nova::times_vec_simd(OUT(0), IN(1), xa
, inNumSamples
);
1897 float slope
= CALCSLOPE(next_a
, xa
);
1898 unit
->mPrevA
= next_a
;
1900 nova::times_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1904 FLATTEN
void mul_ka_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1906 float xa
= unit
->mPrevA
;
1907 float next_a
= ZIN0(0);
1911 nova::zerovec_simd
<64>(OUT(0));
1913 nova::copyvec_simd
<64>(OUT(0), IN(1));
1915 nova::times_vec_simd
<64>(OUT(0), IN(1), xa
);
1917 float slope
= CALCSLOPE(next_a
, xa
);
1918 unit
->mPrevA
= next_a
;
1920 nova::times_vec_simd(OUT(0), IN(1), slope_argument(xa
, slope
), inNumSamples
);
1924 FLATTEN
void mul_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
1926 float xb
= unit
->mPrevB
;
1927 float next_b
= ZIN0(1);
1931 nova::zerovec_simd(OUT(0), inNumSamples
);
1933 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
1935 nova::times_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
1937 float slope
= CALCSLOPE(next_b
, xb
);
1938 unit
->mPrevB
= next_b
;
1940 nova::times_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1944 FLATTEN
void mul_ak_nova_64(BinaryOpUGen
*unit
, int inNumSamples
)
1946 float xb
= unit
->mPrevB
;
1947 float next_b
= ZIN0(1);
1951 nova::zerovec_simd
<64>(OUT(0));
1953 nova::copyvec_simd
<64>(OUT(0), IN(0));
1955 nova::times_vec_simd
<64>(OUT(0), IN(0), xb
);
1957 float slope
= CALCSLOPE(next_b
, xb
);
1958 unit
->mPrevB
= next_b
;
1960 nova::times_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
1967 void div_aa(BinaryOpUGen
*unit
, int inNumSamples
)
1969 float *out
= ZOUT(0);
1974 ZXP(out
) = ZXP(a
) / ZXP(b
);
1978 void div_ak(BinaryOpUGen
*unit
, int inNumSamples
)
1980 float *out
= ZOUT(0);
1982 float xb
= unit
->mPrevB
;
1983 float next_b
= ZIN0(1);
1987 ZClear(inNumSamples
, out
);
1988 } else if (xb
== 1.f
) {
1989 ZCopy(inNumSamples
, out
, a
);
1991 float recip
= 1.f
/ xb
;
1993 ZXP(out
) = ZXP(a
) * recip
;
1997 float slope
= CALCSLOPE(next_b
, xb
);
1999 ZXP(out
) = ZXP(a
) / xb
;
2006 void div_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2008 float *out
= ZOUT(0);
2009 float xa
= unit
->mPrevA
;
2011 float next_a
= ZIN0(0);
2015 ZClear(inNumSamples
, out
);
2018 ZXP(out
) = xa
/ ZXP(b
);
2022 float slope
= CALCSLOPE(next_a
, xa
);
2024 ZXP(out
) = xa
/ ZXP(b
);
2031 void div_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2033 float *out
= ZOUT(0);
2038 ZXP(out
) = xa
/ ZXP(b
);
2044 void div_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2046 float *out
= ZOUT(0);
2050 float rxb
= 1.f
/ xb
;
2052 ZXP(out
) = ZXP(a
) * rxb
;
2058 FLATTEN
void div_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2060 nova::over_vec_simd(OUT(0), IN(0), IN(1), inNumSamples
);
2063 FLATTEN
void div_ia_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2067 nova::over_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
2071 FLATTEN
void div_ai_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2075 nova::times_vec_simd(OUT(0), IN(0), sc_reciprocal(xb
), inNumSamples
);
2079 FLATTEN
void div_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2081 float xb
= unit
->mPrevB
;
2082 float next_b
= ZIN0(1);
2086 nova::zerovec_simd(OUT(0), inNumSamples
);
2088 nova::copyvec_simd(OUT(0), IN(0), inNumSamples
);
2090 float recip
= 1.f
/ xb
;
2091 nova::times_vec_simd(OUT(0), IN(0), recip
, inNumSamples
);
2094 float slope
= CALCSLOPE(next_b
, xb
);
2095 nova::over_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
2096 unit
->mPrevB
= next_b
;
2100 FLATTEN
void div_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
2102 float xa
= unit
->mPrevA
;
2103 float next_a
= ZIN0(0);
2107 nova::zerovec_simd(OUT(0), inNumSamples
);
2109 nova::over_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
2111 float slope
= CALCSLOPE(next_a
, xa
);
2112 nova::over_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
2123 void mod_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2125 float *out
= ZOUT(0);
2132 ZXP(out
) = sc_mod(xa
, xb
);
2136 void mod_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2138 float *out
= ZOUT(0);
2140 float xb
= unit
->mPrevB
;
2141 float next_b
= ZIN0(1);
2145 ZCopy(inNumSamples
, out
, a
);
2148 ZXP(out
) = sc_mod(ZXP(a
), xb
);
2152 float slope
= CALCSLOPE(next_b
, xb
);
2154 ZXP(out
) = sc_mod(ZXP(a
), xb
);
2161 void mod_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2163 float *out
= ZOUT(0);
2164 float xa
= unit
->mPrevA
;
2166 float next_a
= ZIN0(0);
2170 ZClear(inNumSamples
, out
);
2173 ZXP(out
) = sc_mod(xa
, ZXP(b
));
2177 float slope
= CALCSLOPE(next_a
, xa
);
2179 ZXP(out
) = sc_mod(xa
, ZXP(b
));
2187 void mod_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2189 float *out
= ZOUT(0);
2194 ZXP(out
) = sc_mod(xa
, ZXP(b
));
2200 void mod_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2202 float *out
= ZOUT(0);
2207 ZXP(out
) = sc_mod(ZXP(a
), xb
);
2214 void max_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2216 float *out
= ZOUT(0);
2223 ZXP(out
) = sc_max(xa
, xb
);
2227 void max_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2229 float *out
= ZOUT(0);
2231 float xb
= unit
->mPrevB
;
2232 float next_b
= ZIN0(1);
2237 ZXP(out
) = sc_max(xa
, xb
);
2240 float slope
= CALCSLOPE(next_b
, xb
);
2243 ZXP(out
) = sc_max(xa
, xb
);
2250 void max_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2252 float *out
= ZOUT(0);
2253 float xa
= unit
->mPrevA
;
2255 float next_a
= ZIN0(0);
2260 ZXP(out
) = sc_max(xa
, xb
);
2263 float slope
= CALCSLOPE(next_a
, xa
);
2266 ZXP(out
) = sc_max(xa
, xb
);
2273 void max_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2275 float *out
= ZOUT(0);
2281 ZXP(out
) = sc_max(xa
, xb
);
2287 void max_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2289 float *out
= ZOUT(0);
2295 ZXP(out
) = sc_max(xa
, xb
);
2301 NOVA_BINARY_WRAPPER_K(max
, max
)
2307 void min_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2309 float *out
= ZOUT(0);
2316 ZXP(out
) = sc_min(xa
, xb
);
2320 void min_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2322 float *out
= ZOUT(0);
2324 float xb
= unit
->mPrevB
;
2325 float next_b
= ZIN0(1);
2330 ZXP(out
) = sc_min(xa
, xb
);
2333 float slope
= CALCSLOPE(next_b
, xb
);
2336 ZXP(out
) = sc_min(xa
, xb
);
2343 void min_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2345 float *out
= ZOUT(0);
2346 float xa
= unit
->mPrevA
;
2348 float next_a
= ZIN0(0);
2353 ZXP(out
) = sc_min(xa
, xb
);
2356 float slope
= CALCSLOPE(next_a
, xa
);
2359 ZXP(out
) = sc_min(xa
, xb
);
2366 void min_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2368 float *out
= ZOUT(0);
2374 ZXP(out
) = sc_min(xa
, xb
);
2380 void min_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2382 float *out
= ZOUT(0);
2388 ZXP(out
) = sc_min(xa
, xb
);
2395 NOVA_BINARY_WRAPPER_K(min
, min
)
2399 void and_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2401 float *out
= ZOUT(0);
2408 ZXP(out
) = sc_andt(xa
, xb
) ;
2412 void and_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2414 float *out
= ZOUT(0);
2416 float xb
= unit
->mPrevB
;
2417 float next_b
= ZIN0(1);
2422 ZXP(out
) = sc_andt(xa
, xb
);
2425 float slope
= CALCSLOPE(next_b
, xb
);
2428 ZXP(out
) = sc_andt(xa
, xb
);
2435 void and_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2437 float *out
= ZOUT(0);
2438 float xa
= unit
->mPrevA
;
2440 float next_a
= ZIN0(0);
2445 ZXP(out
) = sc_andt(xa
, xb
);
2448 float slope
= CALCSLOPE(next_a
, xa
);
2451 ZXP(out
) = sc_andt(xa
, xb
);
2458 void and_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2460 float *out
= ZOUT(0);
2466 ZXP(out
) = sc_andt(xa
, xb
);
2472 void and_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2474 float *out
= ZOUT(0);
2480 ZXP(out
) = sc_andt(xa
, xb
);
2491 void or_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2493 float *out
= ZOUT(0);
2500 ZXP(out
) = sc_ort(xa
, xb
) ;
2504 void or_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2506 float *out
= ZOUT(0);
2508 float xb
= unit
->mPrevB
;
2509 float next_b
= ZIN0(1);
2514 ZXP(out
) = sc_ort(xa
, xb
);
2517 float slope
= CALCSLOPE(next_b
, xb
);
2520 ZXP(out
) = sc_ort(xa
, xb
);
2527 void or_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2529 float *out
= ZOUT(0);
2530 float xa
= unit
->mPrevA
;
2532 float next_a
= ZIN0(0);
2537 ZXP(out
) = sc_ort(xa
, xb
);
2540 float slope
= CALCSLOPE(next_a
, xa
);
2543 ZXP(out
) = sc_ort(xa
, xb
);
2550 void or_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2552 float *out
= ZOUT(0);
2558 ZXP(out
) = sc_ort(xa
, xb
);
2564 void or_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2566 float *out
= ZOUT(0);
2572 ZXP(out
) = sc_ort(xa
, xb
);
2583 void xor_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2585 float *out
= ZOUT(0);
2592 ZXP(out
) = sc_xort(xa
, xb
) ;
2596 void xor_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2598 float *out
= ZOUT(0);
2600 float xb
= unit
->mPrevB
;
2601 float next_b
= ZIN0(1);
2606 ZXP(out
) = sc_xort(xa
, xb
);
2609 float slope
= CALCSLOPE(next_b
, xb
);
2612 ZXP(out
) = sc_xort(xa
, xb
);
2619 void xor_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2621 float *out
= ZOUT(0);
2622 float xa
= unit
->mPrevA
;
2624 float next_a
= ZIN0(0);
2629 ZXP(out
) = sc_xort(xa
, xb
);
2632 float slope
= CALCSLOPE(next_a
, xa
);
2635 ZXP(out
) = sc_xort(xa
, xb
);
2642 void xor_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2644 float *out
= ZOUT(0);
2650 ZXP(out
) = sc_xort(xa
, xb
);
2656 void xor_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2658 float *out
= ZOUT(0);
2664 ZXP(out
) = sc_xort(xa
, xb
);
2672 void rightShift_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2674 float *out
= ZOUT(0);
2681 ZXP(out
) = sc_rst(xa
, xb
) ;
2685 void rightShift_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2687 float *out
= ZOUT(0);
2689 float xb
= unit
->mPrevB
;
2690 float next_b
= ZIN0(1);
2695 ZXP(out
) = sc_rst(xa
, xb
);
2698 float slope
= CALCSLOPE(next_b
, xb
);
2701 ZXP(out
) = sc_rst(xa
, xb
);
2708 void rightShift_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2710 float *out
= ZOUT(0);
2711 float xa
= unit
->mPrevA
;
2713 float next_a
= ZIN0(0);
2718 ZXP(out
) = sc_rst(xa
, xb
);
2721 float slope
= CALCSLOPE(next_a
, xa
);
2724 ZXP(out
) = sc_rst(xa
, xb
);
2731 void rightShift_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2733 float *out
= ZOUT(0);
2739 ZXP(out
) = sc_rst(xa
, xb
);
2745 void rightShift_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2747 float *out
= ZOUT(0);
2753 ZXP(out
) = sc_rst(xa
, xb
);
2760 void leftShift_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2762 float *out
= ZOUT(0);
2769 ZXP(out
) = sc_lst(xa
, xb
) ;
2773 void leftShift_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2775 float *out
= ZOUT(0);
2777 float xb
= unit
->mPrevB
;
2778 float next_b
= ZIN0(1);
2783 ZXP(out
) = sc_lst(xa
, xb
);
2786 float slope
= CALCSLOPE(next_b
, xb
);
2789 ZXP(out
) = sc_lst(xa
, xb
);
2796 void leftShift_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2798 float *out
= ZOUT(0);
2799 float xa
= unit
->mPrevA
;
2801 float next_a
= ZIN0(0);
2806 ZXP(out
) = sc_lst(xa
, xb
);
2809 float slope
= CALCSLOPE(next_a
, xa
);
2812 ZXP(out
) = sc_lst(xa
, xb
);
2819 void leftShift_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2821 float *out
= ZOUT(0);
2827 ZXP(out
) = sc_lst(xa
, xb
);
2833 void leftShift_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2835 float *out
= ZOUT(0);
2841 ZXP(out
) = sc_lst(xa
, xb
);
2850 void amclip_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2852 float *out
= ZOUT(0);
2859 ZXP(out
) = sc_amclip(xa
, xb
);
2863 void amclip_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2865 float *out
= ZOUT(0);
2867 float xb
= unit
->mPrevB
;
2868 float next_b
= ZIN0(1);
2873 ZXP(out
) = ZXP(a
) * xb
;
2876 ZClear(inNumSamples
, out
);
2879 float slope
= CALCSLOPE(next_b
, xb
);
2882 ZXP(out
) = sc_amclip(xa
, xb
);
2889 void amclip_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2891 float *out
= ZOUT(0);
2892 float xa
= unit
->mPrevA
;
2894 float next_a
= ZIN0(0);
2899 ZXP(out
) = sc_amclip(xa
, xb
);
2902 float slope
= CALCSLOPE(next_a
, xa
);
2905 ZXP(out
) = sc_amclip(xa
, xb
);
2912 void amclip_ia(BinaryOpUGen
*unit
, int inNumSamples
)
2914 float *out
= ZOUT(0);
2920 ZXP(out
) = sc_amclip(xa
, xb
);
2926 void amclip_ai(BinaryOpUGen
*unit
, int inNumSamples
)
2928 float *out
= ZOUT(0);
2934 ZXP(out
) = sc_amclip(xa
, xb
);
2941 void scaleneg_aa(BinaryOpUGen
*unit
, int inNumSamples
)
2943 float *out
= ZOUT(0);
2950 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
2954 void scaleneg_ak(BinaryOpUGen
*unit
, int inNumSamples
)
2956 float *out
= ZOUT(0);
2958 float xb
= unit
->mPrevB
;
2959 float next_b
= ZIN0(1);
2964 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
2967 float slope
= CALCSLOPE(next_b
, xb
);
2970 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
2977 void scaleneg_ka(BinaryOpUGen
*unit
, int inNumSamples
)
2979 float *out
= ZOUT(0);
2980 float xa
= unit
->mPrevA
;
2982 float next_a
= ZIN0(0);
2991 ZXP(out
) = xa
* ZXP(b
);
2995 float slope
= CALCSLOPE(next_a
, xa
);
2998 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
3005 void scaleneg_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3007 float *out
= ZOUT(0);
3013 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
3019 void scaleneg_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3021 float *out
= ZOUT(0);
3027 ZXP(out
) = xa
>= 0.f
? xa
: xa
* xb
;
3035 void pow_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3037 float *out
= ZOUT(0);
3044 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3049 void pow_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3051 float *out
= ZOUT(0);
3053 float xb
= unit
->mPrevB
;
3054 float next_b
= ZIN0(1);
3059 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3062 float slope
= CALCSLOPE(next_b
, xb
);
3065 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3072 void pow_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3074 float *out
= ZOUT(0);
3075 float xa
= unit
->mPrevA
;
3077 float next_a
= ZIN0(0);
3083 ZXP(out
) = pow(xa
, xb
);
3088 ZXP(out
) = -pow(-xa
, xb
);
3092 float slope
= CALCSLOPE(next_a
, xa
);
3095 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3102 void pow_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3104 float *out
= ZOUT(0);
3110 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3116 void pow_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3118 float *out
= ZOUT(0);
3124 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3130 FLATTEN
void pow_aa_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3132 nova::spow_vec_simd(OUT(0), IN(0), IN(1), inNumSamples
);
3135 FLATTEN
void pow_ak_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3137 float *out
= ZOUT(0);
3139 float xb
= unit
->mPrevB
;
3140 float next_b
= ZIN0(1);
3143 nova::spow_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
3145 float slope
= CALCSLOPE(next_b
, xb
);
3146 nova::spow_vec_simd(OUT(0), IN(0), slope_argument(xb
, slope
), inNumSamples
);
3147 unit
->mPrevB
= next_b
;
3151 FLATTEN
void pow_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3153 float *out
= ZOUT(0);
3154 float xa
= unit
->mPrevA
;
3156 float next_a
= ZIN0(0);
3160 nova::pow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3162 nova::spow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3164 float slope
= CALCSLOPE(next_a
, xa
);
3165 nova::spow_vec_simd(OUT(0), slope_argument(xa
, slope
), IN(1), inNumSamples
);
3166 unit
->mPrevA
= next_a
;
3171 FLATTEN
void pow_ia_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3175 nova::pow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3177 nova::spow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3182 FLATTEN
void pow_ai_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3185 nova::spow_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
3190 void ring1_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3192 float *out
= ZOUT(0);
3199 ZXP(out
) = xa
* xb
+ xa
;
3203 void ring1_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3205 float *out
= ZOUT(0);
3207 float xb
= unit
->mPrevB
;
3208 float next_b
= ZIN0(1);
3212 ZCopy(inNumSamples
, out
, a
);
3213 } else if (xb
== 1.f
) {
3221 ZXP(out
) = xa
* xb
+ xa
;
3225 float slope
= CALCSLOPE(next_b
, xb
);
3228 ZXP(out
) = xa
* xb
+ xa
;
3235 void ring1_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3237 float *out
= ZOUT(0);
3238 float xa
= unit
->mPrevA
;
3240 float next_a
= ZIN0(0);
3250 ZXP(out
) = xa
* xb
+ xa
;
3254 float slope
= CALCSLOPE(next_a
, xa
);
3257 ZXP(out
) = xa
* xb
+ xa
;
3264 void ring1_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3266 float *out
= ZOUT(0);
3272 ZXP(out
) = xa
* xb
+ xa
;
3278 void ring1_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3280 float *out
= ZOUT(0);
3286 ZXP(out
) = xa
* xb
+ xa
;
3294 void ring2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3296 float *out
= ZOUT(0);
3303 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3307 void ring2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3309 float *out
= ZOUT(0);
3311 float xb
= unit
->mPrevB
;
3312 float next_b
= ZIN0(1);
3316 ZCopy(inNumSamples
, out
, a
);
3320 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3324 float slope
= CALCSLOPE(next_b
, xb
);
3327 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3334 void ring2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3336 float *out
= ZOUT(0);
3337 float xa
= unit
->mPrevA
;
3339 float next_a
= ZIN0(0);
3343 ZCopy(inNumSamples
, out
, b
);
3347 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3351 float slope
= CALCSLOPE(next_a
, xa
);
3354 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3361 void ring2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3363 float *out
= ZOUT(0);
3369 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3375 void ring2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3377 float *out
= ZOUT(0);
3383 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3391 void ring3_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3393 float *out
= ZOUT(0);
3400 ZXP(out
) = xa
* xa
* xb
;
3404 void ring3_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3406 float *out
= ZOUT(0);
3408 float xb
= unit
->mPrevB
;
3409 float next_b
= ZIN0(1);
3413 ZClear(inNumSamples
, out
);
3414 } else if (xb
== 1.f
) {
3422 ZXP(out
) = xa
* xa
* xb
;
3426 float slope
= CALCSLOPE(next_b
, xb
);
3429 ZXP(out
) = xa
* xa
* xb
;
3436 void ring3_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3438 float *out
= ZOUT(0);
3439 float xa
= unit
->mPrevA
;
3441 float next_a
= ZIN0(0);
3445 ZClear(inNumSamples
, out
);
3446 } else if (xa
== 1.f
) {
3447 ZCopy(inNumSamples
, out
, b
);
3451 ZXP(out
) = xa
* xa
* xb
;
3455 float slope
= CALCSLOPE(next_a
, xa
);
3458 ZXP(out
) = xa
* xa
* xb
;
3465 void ring3_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3467 float *out
= ZOUT(0);
3473 ZXP(out
) = xa
* xa
* xb
;
3479 void ring3_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3481 float *out
= ZOUT(0);
3487 ZXP(out
) = xa
* xa
* xb
;
3494 void ring4_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3496 float *out
= ZOUT(0);
3503 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3507 void ring4_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3509 float *out
= ZOUT(0);
3511 float xb
= unit
->mPrevB
;
3512 float next_b
= ZIN0(1);
3516 ZClear(inNumSamples
, out
);
3517 } else if (xb
== 1.f
) {
3520 ZXP(out
) = xa
* xa
- xa
;
3525 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3529 float slope
= CALCSLOPE(next_b
, xb
);
3532 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3539 void ring4_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3541 float *out
= ZOUT(0);
3542 float xa
= unit
->mPrevA
;
3544 float next_a
= ZIN0(0);
3548 ZClear(inNumSamples
, out
);
3549 } else if (xa
== 1.f
) {
3552 ZXP(out
) = xb
- xb
* xb
;
3557 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3561 float slope
= CALCSLOPE(next_a
, xa
);
3564 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3571 void ring4_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3573 float *out
= ZOUT(0);
3579 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3585 void ring4_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3587 float *out
= ZOUT(0);
3593 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3600 void thresh_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3602 float *out
= ZOUT(0);
3609 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3613 void thresh_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3615 float *out
= ZOUT(0);
3617 float xb
= unit
->mPrevB
;
3618 float next_b
= ZIN0(1);
3623 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3626 float slope
= CALCSLOPE(next_b
, xb
);
3629 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3636 void thresh_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3638 float *out
= ZOUT(0);
3639 float xa
= unit
->mPrevA
;
3641 float next_a
= ZIN0(0);
3646 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3649 float slope
= CALCSLOPE(next_a
, xa
);
3652 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3659 void thresh_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3661 float *out
= ZOUT(0);
3667 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3673 void thresh_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3675 float *out
= ZOUT(0);
3681 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3688 void clip2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3690 float *out
= ZOUT(0);
3697 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3701 void clip2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3703 float *out
= ZOUT(0);
3705 float xb
= unit
->mPrevB
;
3706 float next_b
= ZIN0(1);
3711 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3714 float slope
= CALCSLOPE(next_b
, xb
);
3717 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3724 void clip2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3726 float *out
= ZOUT(0);
3727 float xa
= unit
->mPrevA
;
3729 float next_a
= ZIN0(0);
3734 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3737 float slope
= CALCSLOPE(next_a
, xa
);
3740 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3747 void clip2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3749 float *out
= ZOUT(0);
3755 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3761 void clip2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3763 float *out
= ZOUT(0);
3769 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3776 NOVA_BINARY_WRAPPER_K(clip2
, clip2
)
3780 void excess_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3782 float *out
= ZOUT(0);
3789 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3793 void excess_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3795 float *out
= ZOUT(0);
3797 float xb
= unit
->mPrevB
;
3798 float next_b
= ZIN0(1);
3803 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3806 float slope
= CALCSLOPE(next_b
, xb
);
3809 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3816 void excess_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3818 float *out
= ZOUT(0);
3819 float xa
= unit
->mPrevA
;
3821 float next_a
= ZIN0(0);
3826 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3829 float slope
= CALCSLOPE(next_a
, xa
);
3832 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3839 void excess_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3841 float *out
= ZOUT(0);
3847 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3853 void excess_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3855 float *out
= ZOUT(0);
3861 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3868 void lt_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3870 float *out
= ZOUT(0);
3877 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3882 NOVA_BINARY_WRAPPER_K(lt
, less
)
3886 void lt_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3888 float *out
= ZOUT(0);
3890 float xb
= unit
->mPrevB
;
3891 float next_b
= ZIN0(1);
3896 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3899 float slope
= CALCSLOPE(next_b
, xb
);
3902 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3909 void lt_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3911 float *out
= ZOUT(0);
3912 float xa
= unit
->mPrevA
;
3914 float next_a
= ZIN0(0);
3919 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3922 float slope
= CALCSLOPE(next_a
, xa
);
3925 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3932 void lt_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3934 float *out
= ZOUT(0);
3940 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3946 void lt_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3948 float *out
= ZOUT(0);
3954 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3961 void le_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3963 float *out
= ZOUT(0);
3970 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
3975 NOVA_BINARY_WRAPPER_K(le
, less_equal
)
3978 void le_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3980 float *out
= ZOUT(0);
3982 float xb
= unit
->mPrevB
;
3983 float next_b
= ZIN0(1);
3988 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
3991 float slope
= CALCSLOPE(next_b
, xb
);
3994 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4001 void le_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4003 float *out
= ZOUT(0);
4004 float xa
= unit
->mPrevA
;
4006 float next_a
= ZIN0(0);
4011 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4014 float slope
= CALCSLOPE(next_a
, xa
);
4017 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4024 void le_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4026 float *out
= ZOUT(0);
4032 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4038 void le_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4040 float *out
= ZOUT(0);
4046 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4053 void gt_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4055 float *out
= ZOUT(0);
4062 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4067 NOVA_BINARY_WRAPPER_K(gt
, greater
)
4071 void gt_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4073 float *out
= ZOUT(0);
4075 float xb
= unit
->mPrevB
;
4076 float next_b
= ZIN0(1);
4081 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4084 float slope
= CALCSLOPE(next_b
, xb
);
4087 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4094 void gt_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4096 float *out
= ZOUT(0);
4097 float xa
= unit
->mPrevA
;
4099 float next_a
= ZIN0(0);
4104 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4107 float slope
= CALCSLOPE(next_a
, xa
);
4110 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4117 void gt_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4119 float *out
= ZOUT(0);
4125 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4131 void gt_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4133 float *out
= ZOUT(0);
4139 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4146 void ge_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4148 float *out
= ZOUT(0);
4155 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4160 NOVA_BINARY_WRAPPER_K(ge
, greater_equal
)
4164 void ge_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4166 float *out
= ZOUT(0);
4168 float xb
= unit
->mPrevB
;
4169 float next_b
= ZIN0(1);
4174 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4177 float slope
= CALCSLOPE(next_b
, xb
);
4180 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4187 void ge_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4189 float *out
= ZOUT(0);
4190 float xa
= unit
->mPrevA
;
4192 float next_a
= ZIN0(0);
4197 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4200 float slope
= CALCSLOPE(next_a
, xa
);
4203 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4210 void ge_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4212 float *out
= ZOUT(0);
4218 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4224 void ge_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4226 float *out
= ZOUT(0);
4232 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4239 void eq_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4241 float *out
= ZOUT(0);
4248 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4253 NOVA_BINARY_WRAPPER_K(eq
, equal
)
4256 void eq_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4258 float *out
= ZOUT(0);
4260 float xb
= unit
->mPrevB
;
4261 float next_b
= ZIN0(1);
4266 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4269 float slope
= CALCSLOPE(next_b
, xb
);
4272 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4279 void eq_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4281 float *out
= ZOUT(0);
4282 float xa
= unit
->mPrevA
;
4284 float next_a
= ZIN0(0);
4289 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4292 float slope
= CALCSLOPE(next_a
, xa
);
4295 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4302 void eq_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4304 float *out
= ZOUT(0);
4310 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4316 void eq_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4318 float *out
= ZOUT(0);
4324 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4331 void neq_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4333 float *out
= ZOUT(0);
4340 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4345 NOVA_BINARY_WRAPPER_K(neq
, notequal
)
4349 void neq_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4351 float *out
= ZOUT(0);
4353 float xb
= unit
->mPrevB
;
4354 float next_b
= ZIN0(1);
4359 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4362 float slope
= CALCSLOPE(next_b
, xb
);
4365 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4372 void neq_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4374 float *out
= ZOUT(0);
4375 float xa
= unit
->mPrevA
;
4377 float next_a
= ZIN0(0);
4382 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4385 float slope
= CALCSLOPE(next_a
, xa
);
4388 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4395 void neq_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4397 float *out
= ZOUT(0);
4403 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4409 void neq_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4411 float *out
= ZOUT(0);
4417 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4423 void sumsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4425 float *out
= ZOUT(0);
4432 ZXP(out
) = xa
* xa
+ xb
* xb
;
4436 void sumsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4438 float *out
= ZOUT(0);
4440 float xb
= unit
->mPrevB
;
4441 float next_b
= ZIN0(1);
4446 ZXP(out
) = xa
* xa
+ xb
* xb
;
4449 float slope
= CALCSLOPE(next_b
, xb
);
4452 ZXP(out
) = xa
* xa
+ xb
* xb
;
4459 void sumsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4461 float *out
= ZOUT(0);
4462 float xa
= unit
->mPrevA
;
4464 float next_a
= ZIN0(0);
4469 ZXP(out
) = xa
* xa
+ xb
* xb
;
4472 float slope
= CALCSLOPE(next_a
, xa
);
4475 ZXP(out
) = xa
* xa
+ xb
* xb
;
4483 void sumsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4485 float *out
= ZOUT(0);
4491 ZXP(out
) = xa
* xa
+ xb
* xb
;
4497 void sumsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4499 float *out
= ZOUT(0);
4505 ZXP(out
) = xa
* xa
+ xb
* xb
;
4512 void difsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4514 float *out
= ZOUT(0);
4521 ZXP(out
) = xa
* xa
- xb
* xb
;
4525 void difsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4527 float *out
= ZOUT(0);
4529 float xb
= unit
->mPrevB
;
4530 float next_b
= ZIN0(1);
4535 ZXP(out
) = xa
* xa
- xb
* xb
;
4538 float slope
= CALCSLOPE(next_b
, xb
);
4541 ZXP(out
) = xa
* xa
- xb
* xb
;
4548 void difsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4550 float *out
= ZOUT(0);
4551 float xa
= unit
->mPrevA
;
4553 float next_a
= ZIN0(0);
4558 ZXP(out
) = xa
* xa
- xb
* xb
;
4561 float slope
= CALCSLOPE(next_a
, xa
);
4564 ZXP(out
) = xa
* xa
- xb
* xb
;
4571 void difsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4573 float *out
= ZOUT(0);
4579 ZXP(out
) = xa
* xa
- xb
* xb
;
4585 void difsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4587 float *out
= ZOUT(0);
4593 ZXP(out
) = xa
* xa
- xb
* xb
;
4599 void sqrsum_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4601 float *out
= ZOUT(0);
4606 float sum
= ZXP(a
) + ZXP(b
);
4607 ZXP(out
) = sum
* sum
;
4611 void sqrsum_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4613 float *out
= ZOUT(0);
4615 float xb
= unit
->mPrevB
;
4616 float next_b
= ZIN0(1);
4621 float sum
= xa
+ xb
;
4622 ZXP(out
) = sum
* sum
;
4625 float slope
= CALCSLOPE(next_b
, xb
);
4628 float sum
= xa
+ xb
;
4629 ZXP(out
) = sum
* sum
;
4636 void sqrsum_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4638 float *out
= ZOUT(0);
4639 float xa
= unit
->mPrevA
;
4641 float next_a
= ZIN0(0);
4646 float sum
= xa
+ xb
;
4647 ZXP(out
) = sum
* sum
;
4650 float slope
= CALCSLOPE(next_a
, xa
);
4653 float sum
= xa
+ xb
;
4654 ZXP(out
) = sum
* sum
;
4661 void sqrsum_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4663 float *out
= ZOUT(0);
4669 float sum
= xa
+ xb
;
4670 ZXP(out
) = sum
* sum
;
4676 void sqrsum_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4678 float *out
= ZOUT(0);
4684 float sum
= xa
+ xb
;
4685 ZXP(out
) = sum
* sum
;
4691 void sqrdif_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4693 float *out
= ZOUT(0);
4698 float dif
= ZXP(a
) - ZXP(b
);
4699 ZXP(out
) = dif
* dif
;
4703 void sqrdif_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4705 float *out
= ZOUT(0);
4707 float xb
= unit
->mPrevB
;
4708 float next_b
= ZIN0(1);
4713 float dif
= xa
- xb
;
4714 ZXP(out
) = dif
* dif
;
4717 float slope
= CALCSLOPE(next_b
, xb
);
4720 float dif
= xa
- xb
;
4721 ZXP(out
) = dif
* dif
;
4728 void sqrdif_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4730 float *out
= ZOUT(0);
4731 float xa
= unit
->mPrevA
;
4733 float next_a
= ZIN0(0);
4738 float dif
= xa
- xb
;
4739 ZXP(out
) = dif
* dif
;
4742 float slope
= CALCSLOPE(next_a
, xa
);
4745 float dif
= xa
- xb
;
4746 ZXP(out
) = dif
* dif
;
4754 void sqrdif_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4756 float *out
= ZOUT(0);
4762 float dif
= xa
- xb
;
4763 ZXP(out
) = dif
* dif
;
4769 void sqrdif_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4771 float *out
= ZOUT(0);
4777 float dif
= xa
- xb
;
4778 ZXP(out
) = dif
* dif
;
4784 void absdif_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4786 float *out
= ZOUT(0);
4791 float dif
= ZXP(a
) - ZXP(b
);
4792 ZXP(out
) = fabs(dif
);
4796 void absdif_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4798 float *out
= ZOUT(0);
4800 float xb
= unit
->mPrevB
;
4801 float next_b
= ZIN0(1);
4806 float dif
= xa
- xb
;
4807 ZXP(out
) = fabs(dif
);
4810 float slope
= CALCSLOPE(next_b
, xb
);
4813 float dif
= xa
- xb
;
4814 ZXP(out
) = fabs(dif
);
4821 void absdif_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4823 float *out
= ZOUT(0);
4824 float xa
= unit
->mPrevA
;
4826 float next_a
= ZIN0(0);
4831 float dif
= xa
- xb
;
4832 ZXP(out
) = fabs(dif
);
4835 float slope
= CALCSLOPE(next_a
, xa
);
4838 float dif
= xa
- xb
;
4839 ZXP(out
) = fabs(dif
);
4846 void absdif_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4848 float *out
= ZOUT(0);
4854 float dif
= xa
- xb
;
4855 ZXP(out
) = fabs(dif
);
4861 void absdif_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4863 float *out
= ZOUT(0);
4869 float dif
= xa
- xb
;
4870 ZXP(out
) = fabs(dif
);
4876 void round_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4878 float *out
= ZOUT(0);
4885 ZXP(out
) = sc_round(xa
, xb
);
4889 void round_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4891 float *out
= ZOUT(0);
4893 float xb
= unit
->mPrevB
;
4894 float next_b
= ZIN0(1);
4899 ZXP(out
) = sc_round(xa
, xb
);
4902 float slope
= CALCSLOPE(next_b
, xb
);
4905 ZXP(out
) = sc_round(xa
, xb
);
4912 void round_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4914 float *out
= ZOUT(0);
4915 float xa
= unit
->mPrevA
;
4917 float next_a
= ZIN0(0);
4922 ZXP(out
) = sc_round(xa
, xb
);
4925 float slope
= CALCSLOPE(next_a
, xa
);
4928 ZXP(out
) = sc_round(xa
, xb
);
4936 void round_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4938 float *out
= ZOUT(0);
4944 ZXP(out
) = sc_round(xa
, xb
);
4950 void round_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4952 float *out
= ZOUT(0);
4958 ZXP(out
) = sc_round(xa
, xb
);
4966 void roundUp_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4968 float *out
= ZOUT(0);
4975 ZXP(out
) = sc_roundUp(xa
, xb
);
4979 void roundUp_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4981 float *out
= ZOUT(0);
4983 float xb
= unit
->mPrevB
;
4984 float next_b
= ZIN0(1);
4989 ZXP(out
) = sc_roundUp(xa
, xb
);
4992 float slope
= CALCSLOPE(next_b
, xb
);
4995 ZXP(out
) = sc_roundUp(xa
, xb
);
5002 void roundUp_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5004 float *out
= ZOUT(0);
5005 float xa
= unit
->mPrevA
;
5007 float next_a
= ZIN0(0);
5012 ZXP(out
) = sc_roundUp(xa
, xb
);
5015 float slope
= CALCSLOPE(next_a
, xa
);
5018 ZXP(out
) = sc_roundUp(xa
, xb
);
5026 void roundUp_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5028 float *out
= ZOUT(0);
5034 ZXP(out
) = sc_roundUp(xa
, xb
);
5040 void roundUp_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5042 float *out
= ZOUT(0);
5048 ZXP(out
) = sc_roundUp(xa
, xb
);
5055 void trunc_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5057 float *out
= ZOUT(0);
5064 ZXP(out
) = sc_trunc(xa
, xb
);
5068 void trunc_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5070 float *out
= ZOUT(0);
5072 float xb
= unit
->mPrevB
;
5073 float next_b
= ZIN0(1);
5078 ZXP(out
) = sc_trunc(xa
, xb
);
5081 float slope
= CALCSLOPE(next_b
, xb
);
5084 ZXP(out
) = sc_trunc(xa
, xb
);
5091 void trunc_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5093 float *out
= ZOUT(0);
5094 float xa
= unit
->mPrevA
;
5096 float next_a
= ZIN0(0);
5101 ZXP(out
) = sc_trunc(xa
, xb
);
5104 float slope
= CALCSLOPE(next_a
, xa
);
5107 ZXP(out
) = sc_trunc(xa
, xb
);
5114 void trunc_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5116 float *out
= ZOUT(0);
5122 ZXP(out
) = sc_trunc(xa
, xb
);
5128 void trunc_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5130 float *out
= ZOUT(0);
5136 ZXP(out
) = sc_trunc(xa
, xb
);
5143 void fold2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5145 float *out
= ZOUT(0);
5152 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5156 void fold2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5158 float *out
= ZOUT(0);
5160 float xb
= unit
->mPrevB
;
5161 float next_b
= ZIN0(1);
5166 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5169 float slope
= CALCSLOPE(next_b
, xb
);
5172 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5179 void fold2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5181 float *out
= ZOUT(0);
5182 float xa
= unit
->mPrevA
;
5184 float next_a
= ZIN0(0);
5189 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5192 float slope
= CALCSLOPE(next_a
, xa
);
5195 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5202 void fold2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5204 float *out
= ZOUT(0);
5210 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5216 void fold2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5218 float *out
= ZOUT(0);
5224 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5232 void wrap2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5234 float *out
= ZOUT(0);
5241 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5245 void wrap2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5247 float *out
= ZOUT(0);
5249 float xb
= unit
->mPrevB
;
5250 float next_b
= ZIN0(1);
5255 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5258 float slope
= CALCSLOPE(next_b
, xb
);
5261 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5268 void wrap2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5270 float *out
= ZOUT(0);
5271 float xa
= unit
->mPrevA
;
5273 float next_a
= ZIN0(0);
5278 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5281 float slope
= CALCSLOPE(next_a
, xa
);
5284 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5291 void wrap2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5293 float *out
= ZOUT(0);
5299 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5305 void wrap2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5307 float *out
= ZOUT(0);
5313 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5320 void atan2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5322 float *out
= ZOUT(0);
5329 ZXP(out
) = atan2(xa
, xb
);
5333 void atan2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5335 float *out
= ZOUT(0);
5337 float xb
= unit
->mPrevB
;
5338 float next_b
= ZIN0(1);
5343 ZXP(out
) = atan2(xa
, xb
);
5346 float slope
= CALCSLOPE(next_b
, xb
);
5349 ZXP(out
) = atan2(xa
, xb
);
5356 void atan2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5358 float *out
= ZOUT(0);
5359 float xa
= unit
->mPrevA
;
5361 float next_a
= ZIN0(0);
5366 ZXP(out
) = atan2(xa
, xb
);
5369 float slope
= CALCSLOPE(next_a
, xa
);
5372 ZXP(out
) = atan2(xa
, xb
);
5379 void atan2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5381 float *out
= ZOUT(0);
5387 ZXP(out
) = atan2(xa
, xb
);
5393 void atan2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5395 float *out
= ZOUT(0);
5401 ZXP(out
) = atan2(xa
, xb
);
5407 void hypot_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5409 float *out
= ZOUT(0);
5416 ZXP(out
) = hypotf(xa
, xb
);
5420 void hypot_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5422 float *out
= ZOUT(0);
5424 float xb
= unit
->mPrevB
;
5425 float next_b
= ZIN0(1);
5430 ZXP(out
) = hypotf(xa
, xb
);
5433 float slope
= CALCSLOPE(next_b
, xb
);
5436 ZXP(out
) = hypotf(xa
, xb
);
5443 void hypot_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5445 float *out
= ZOUT(0);
5446 float xa
= unit
->mPrevA
;
5448 float next_a
= ZIN0(0);
5453 ZXP(out
) = hypotf(xa
, xb
);
5456 float slope
= CALCSLOPE(next_a
, xa
);
5459 ZXP(out
) = hypotf(xa
, xb
);
5466 void hypot_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5468 float *out
= ZOUT(0);
5474 ZXP(out
) = hypotf(xa
, xb
);
5480 void hypot_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5482 float *out
= ZOUT(0);
5488 ZXP(out
) = hypotf(xa
, xb
);
5495 void hypotx_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5497 float *out
= ZOUT(0);
5504 ZXP(out
) = sc_hypotx(xa
, xb
);
5508 void hypotx_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5510 float *out
= ZOUT(0);
5512 float xb
= unit
->mPrevB
;
5513 float next_b
= ZIN0(1);
5518 ZXP(out
) = sc_hypotx(xa
, xb
);
5521 float slope
= CALCSLOPE(next_b
, xb
);
5524 ZXP(out
) = sc_hypotx(xa
, xb
);
5531 void hypotx_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5533 float *out
= ZOUT(0);
5534 float xa
= unit
->mPrevA
;
5536 float next_a
= ZIN0(0);
5541 ZXP(out
) = sc_hypotx(xa
, xb
);
5544 float slope
= CALCSLOPE(next_a
, xa
);
5547 ZXP(out
) = sc_hypotx(xa
, xb
);
5554 void hypotx_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5556 float *out
= ZOUT(0);
5562 ZXP(out
) = sc_hypotx(xa
, xb
);
5568 void hypotx_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5570 float *out
= ZOUT(0);
5576 ZXP(out
) = sc_hypotx(xa
, xb
);
5581 static BinaryOpFunc
ChooseOneSampleFunc(BinaryOpUGen
*unit
)
5583 BinaryOpFunc func
= &zero_1
;
5585 switch (unit
->mSpecialIndex
) {
5586 //case opSilence2 : func = &zero_1; break;
5587 case opAdd
: func
= &add_1
; break;
5588 case opSub
: func
= &sub_1
; break;
5589 case opMul
: func
= &mul_1
; break;
5590 case opFDiv
: func
= &div_1
; break;
5591 case opMod
: func
= &mod_1
; break;
5592 case opEQ
: func
= &eq_1
; break;
5593 case opNE
: func
= &neq_1
; break;
5594 case opLT
: func
= <_1
; break;
5595 case opGT
: func
= >_1
; break;
5596 case opLE
: func
= &le_1
; break;
5597 case opGE
: func
= &ge_1
; break;
5598 case opMin
: func
= &min_1
; break;
5599 case opMax
: func
= &max_1
; break;
5600 case opBitAnd
: func
= &and_1
; break;
5601 case opBitOr
: func
= &or_1
; break;
5602 case opBitXor
: func
= &xor_1
; break;
5603 case opShiftRight
: func
= &rightShift_1
; break;
5604 case opShiftLeft
: func
= &leftShift_1
; break;
5605 case opRound
: func
= &round_1
; break;
5606 case opRoundUp
: func
= &roundUp_1
; break;
5607 case opTrunc
: func
= &trunc_1
; break;
5608 case opAtan2
: func
= &atan2_1
; break;
5609 case opHypot
: func
= &hypot_1
; break;
5610 case opHypotx
: func
= &hypotx_1
; break;
5611 case opPow
: func
= &pow_1
; break;
5612 case opRing1
: func
= &ring1_1
; break;
5613 case opRing2
: func
= &ring2_1
; break;
5614 case opRing3
: func
= &ring3_1
; break;
5615 case opRing4
: func
= &ring4_1
; break;
5616 case opDifSqr
: func
= &difsqr_1
; break;
5617 case opSumSqr
: func
= &sumsqr_1
; break;
5618 case opSqrSum
: func
= &sqrsum_1
; break;
5619 case opSqrDif
: func
= &sqrdif_1
; break;
5620 case opAbsDif
: func
= &absdif_1
; break;
5621 case opThresh
: func
= &thresh_1
; break;
5622 case opAMClip
: func
= &amclip_1
; break;
5623 case opScaleNeg
: func
= &scaleneg_1
; break;
5624 case opClip2
: func
= &clip2_1
; break;
5625 case opFold2
: func
= &fold2_1
; break;
5626 case opWrap2
: func
= &wrap2_1
; break;
5627 case opExcess
: func
= &excess_1
; break;
5628 case opFirstArg
: func
= &firstarg_1
; break;
5629 //case opSecondArg : func = &secondarg_1; break;
5630 default : func
= &add_1
; break;
5636 static BinaryOpFunc
ChooseDemandFunc(BinaryOpUGen
*unit
)
5638 BinaryOpFunc func
= &zero_1
;
5640 switch (unit
->mSpecialIndex
) {
5641 //case opSilence2 : func = &zero_d; break;
5642 case opAdd
: func
= &add_d
; break;
5643 case opSub
: func
= &sub_d
; break;
5644 case opMul
: func
= &mul_d
; break;
5645 case opFDiv
: func
= &div_d
; break;
5646 case opMod
: func
= &mod_d
; break;
5647 case opEQ
: func
= &eq_d
; break;
5648 case opNE
: func
= &neq_d
; break;
5649 case opLT
: func
= <_d
; break;
5650 case opGT
: func
= >_d
; break;
5651 case opLE
: func
= &le_d
; break;
5652 case opGE
: func
= &ge_d
; break;
5653 case opMin
: func
= &min_d
; break;
5654 case opMax
: func
= &max_d
; break;
5655 case opBitAnd
: func
= &and_d
; break;
5656 case opBitOr
: func
= &or_d
; break;
5657 case opBitXor
: func
= &xor_d
; break;
5658 case opShiftRight
: func
= &rightShift_d
; break;
5659 case opShiftLeft
: func
= &leftShift_d
; break;
5660 case opRound
: func
= &round_d
; break;
5661 case opRoundUp
: func
= &roundUp_d
; break;
5662 case opTrunc
: func
= &trunc_d
; break;
5663 case opAtan2
: func
= &atan2_d
; break;
5664 case opHypot
: func
= &hypot_d
; break;
5665 case opHypotx
: func
= &hypotx_d
; break;
5666 case opPow
: func
= &pow_d
; break;
5667 case opRing1
: func
= &ring1_d
; break;
5668 case opRing2
: func
= &ring2_d
; break;
5669 case opRing3
: func
= &ring3_d
; break;
5670 case opRing4
: func
= &ring4_d
; break;
5671 case opDifSqr
: func
= &difsqr_d
; break;
5672 case opSumSqr
: func
= &sumsqr_d
; break;
5673 case opSqrSum
: func
= &sqrsum_d
; break;
5674 case opSqrDif
: func
= &sqrdif_d
; break;
5675 case opAbsDif
: func
= &absdif_d
; break;
5676 case opThresh
: func
= &thresh_d
; break;
5677 case opAMClip
: func
= &amclip_d
; break;
5678 case opScaleNeg
: func
= &scaleneg_d
; break;
5679 case opClip2
: func
= &clip2_d
; break;
5680 case opFold2
: func
= &fold2_d
; break;
5681 case opWrap2
: func
= &wrap2_d
; break;
5682 case opExcess
: func
= &excess_d
; break;
5683 case opFirstArg
: func
= &firstarg_d
; break;
5684 //case opSecondArg : func = &secondarg_d; break;
5685 default : func
= &add_d
; break;
5691 static BinaryOpFunc
ChooseNormalFunc(BinaryOpUGen
*unit
)
5693 BinaryOpFunc func
= &zero_1
;
5695 int rateA
= INRATE(0);
5696 int rateB
= INRATE(1);
5702 switch (unit
->mSpecialIndex
) {
5703 //case opSilence2 : func = &zero_aa; break;
5704 case opAdd
: func
= &add_aa
; break;
5705 case opSub
: func
= &sub_aa
; break;
5706 case opMul
: func
= &mul_aa
; break;
5707 case opFDiv
: func
= &div_aa
; break;
5708 case opMod
: func
= &mod_aa
; break;
5709 case opEQ
: func
= &eq_aa
; break;
5710 case opNE
: func
= &neq_aa
; break;
5711 case opLT
: func
= <_aa
; break;
5712 case opGT
: func
= >_aa
; break;
5713 case opLE
: func
= &le_aa
; break;
5714 case opGE
: func
= &ge_aa
; break;
5715 case opMin
: func
= &min_aa
; break;
5716 case opMax
: func
= &max_aa
; break;
5717 case opBitAnd
: func
= &and_aa
; break;
5718 case opBitOr
: func
= &or_aa
; break;
5719 case opBitXor
: func
= &xor_aa
; break;
5720 case opShiftRight
: func
= &rightShift_aa
; break;
5721 case opShiftLeft
: func
= &leftShift_aa
; break;
5722 case opRound
: func
= &round_aa
; break;
5723 case opRoundUp
: func
= &roundUp_aa
; break;
5724 case opTrunc
: func
= &trunc_aa
; break;
5725 case opAtan2
: func
= &atan2_aa
; break;
5726 case opHypot
: func
= &hypot_aa
; break;
5727 case opHypotx
: func
= &hypotx_aa
; break;
5728 case opPow
: func
= &pow_aa
; break;
5729 case opRing1
: func
= &ring1_aa
; break;
5730 case opRing2
: func
= &ring2_aa
; break;
5731 case opRing3
: func
= &ring3_aa
; break;
5732 case opRing4
: func
= &ring4_aa
; break;
5733 case opDifSqr
: func
= &difsqr_aa
; break;
5734 case opSumSqr
: func
= &sumsqr_aa
; break;
5735 case opSqrSum
: func
= &sqrsum_aa
; break;
5736 case opSqrDif
: func
= &sqrdif_aa
; break;
5737 case opAbsDif
: func
= &absdif_aa
; break;
5738 case opThresh
: func
= &thresh_aa
; break;
5739 case opAMClip
: func
= &amclip_aa
; break;
5740 case opScaleNeg
: func
= &scaleneg_aa
; break;
5741 case opClip2
: func
= &clip2_aa
; break;
5742 case opFold2
: func
= &fold2_aa
; break;
5743 case opWrap2
: func
= &wrap2_aa
; break;
5744 case opExcess
: func
= &excess_aa
; break;
5745 case opFirstArg
: func
= &firstarg_aa
; break;
5746 //case opSecondArg : func = &secondarg_aa; break;
5747 default : func
= &add_aa
; break;
5751 switch (unit
->mSpecialIndex
) {
5752 //case opSilence2 : func = &zero_aa; break;
5753 case opAdd
: func
= &add_ak
; break;
5754 case opSub
: func
= &sub_ak
; break;
5755 case opMul
: func
= &mul_ak
; break;
5756 case opFDiv
: func
= &div_ak
; break;
5757 case opMod
: func
= &mod_ak
; break;
5758 case opEQ
: func
= &eq_ak
; break;
5759 case opNE
: func
= &neq_ak
; break;
5760 case opLT
: func
= <_ak
; break;
5761 case opGT
: func
= >_ak
; break;
5762 case opLE
: func
= &le_ak
; break;
5763 case opGE
: func
= &ge_ak
; break;
5764 case opMin
: func
= &min_ak
; break;
5765 case opMax
: func
= &max_ak
; break;
5766 case opBitAnd
: func
= &and_ak
; break;
5767 case opBitOr
: func
= &or_ak
; break;
5768 case opBitXor
: func
= &xor_ak
; break;
5769 case opShiftRight
: func
= &rightShift_ak
; break;
5770 case opShiftLeft
: func
= &leftShift_ak
; break;
5771 case opRound
: func
= &round_ak
; break;
5772 case opRoundUp
: func
= &roundUp_ak
; break;
5773 case opTrunc
: func
= &trunc_ak
; break;
5774 case opAtan2
: func
= &atan2_ak
; break;
5775 case opHypot
: func
= &hypot_ak
; break;
5776 case opHypotx
: func
= &hypotx_ak
; break;
5777 case opPow
: func
= &pow_ak
; break;
5778 case opRing1
: func
= &ring1_ak
; break;
5779 case opRing2
: func
= &ring2_ak
; break;
5780 case opRing3
: func
= &ring3_ak
; break;
5781 case opRing4
: func
= &ring4_ak
; break;
5782 case opDifSqr
: func
= &difsqr_ak
; break;
5783 case opSumSqr
: func
= &sumsqr_ak
; break;
5784 case opSqrSum
: func
= &sqrsum_ak
; break;
5785 case opSqrDif
: func
= &sqrdif_ak
; break;
5786 case opAbsDif
: func
= &absdif_ak
; break;
5787 case opThresh
: func
= &thresh_ak
; break;
5788 case opAMClip
: func
= &amclip_ak
; break;
5789 case opScaleNeg
: func
= &scaleneg_ak
; break;
5790 case opClip2
: func
= &clip2_ak
; break;
5791 case opFold2
: func
= &fold2_ak
; break;
5792 case opWrap2
: func
= &wrap2_ak
; break;
5793 case opExcess
: func
= &excess_ak
; break;
5794 case opFirstArg
: func
= &firstarg_aa
; break;
5795 //case opSecondArg : func = &secondarg_aa; break;
5796 default : func
= &add_ak
; break;
5799 case calc_ScalarRate
:
5800 switch (unit
->mSpecialIndex
) {
5801 //case opSilence2 : func = &zero_aa; break;
5802 case opAdd
: func
= &add_ai
; break;
5803 case opSub
: func
= &sub_ai
; break;
5804 case opMul
: func
= &mul_ai
; break;
5805 case opFDiv
: func
= &div_ai
; break;
5806 case opMod
: func
= &mod_ai
; break;
5807 case opEQ
: func
= &eq_ai
; break;
5808 case opNE
: func
= &neq_ai
; break;
5809 case opLT
: func
= <_ai
; break;
5810 case opGT
: func
= >_ai
; break;
5811 case opLE
: func
= &le_ai
; break;
5812 case opGE
: func
= &ge_ai
; break;
5813 case opMin
: func
= &min_ai
; break;
5814 case opMax
: func
= &max_ai
; break;
5815 case opBitAnd
: func
= &and_ai
; break;
5816 case opBitOr
: func
= &or_ai
; break;
5817 case opBitXor
: func
= &xor_ai
; break;
5818 case opShiftRight
: func
= &rightShift_ai
; break;
5819 case opShiftLeft
: func
= &leftShift_ai
; break;
5820 case opRound
: func
= &round_ai
; break;
5821 case opRoundUp
: func
= &roundUp_ai
; break;
5822 case opTrunc
: func
= &trunc_ai
; break;
5823 case opAtan2
: func
= &atan2_ai
; break;
5824 case opHypot
: func
= &hypot_ai
; break;
5825 case opHypotx
: func
= &hypotx_ai
; break;
5826 case opPow
: func
= &pow_ai
; break;
5827 case opRing1
: func
= &ring1_ai
; break;
5828 case opRing2
: func
= &ring2_ai
; break;
5829 case opRing3
: func
= &ring3_ai
; break;
5830 case opRing4
: func
= &ring4_ai
; break;
5831 case opDifSqr
: func
= &difsqr_ai
; break;
5832 case opSumSqr
: func
= &sumsqr_ai
; break;
5833 case opSqrSum
: func
= &sqrsum_ai
; break;
5834 case opSqrDif
: func
= &sqrdif_ai
; break;
5835 case opAbsDif
: func
= &absdif_ai
; break;
5836 case opThresh
: func
= &thresh_ai
; break;
5837 case opAMClip
: func
= &amclip_ai
; break;
5838 case opScaleNeg
: func
= &scaleneg_ai
; break;
5839 case opClip2
: func
= &clip2_ai
; break;
5840 case opFold2
: func
= &fold2_ai
; break;
5841 case opWrap2
: func
= &wrap2_ai
; break;
5842 case opExcess
: func
= &excess_ai
; break;
5843 case opFirstArg
: func
= &firstarg_aa
; break;
5844 //case opSecondArg : func = &secondarg_aa; break;
5845 default : func
= &add_ai
; break;
5850 if (rateB
== calc_FullRate
) {
5851 switch (unit
->mSpecialIndex
) {
5852 //case opSilence2 : func = &zero_aa; break;
5853 case opAdd
: func
= &add_ka
; break;
5854 case opSub
: func
= &sub_ka
; break;
5855 case opMul
: func
= &mul_ka
; break;
5856 case opFDiv
: func
= &div_ka
; break;
5857 case opMod
: func
= &mod_ka
; break;
5858 case opEQ
: func
= &eq_ka
; break;
5859 case opNE
: func
= &neq_ka
; break;
5860 case opLT
: func
= <_ka
; break;
5861 case opGT
: func
= >_ka
; break;
5862 case opLE
: func
= &le_ka
; break;
5863 case opGE
: func
= &ge_ka
; break;
5864 case opMin
: func
= &min_ka
; break;
5865 case opMax
: func
= &max_ka
; break;
5866 case opBitAnd
: func
= &and_ka
; break;
5867 case opBitOr
: func
= &or_ka
; break;
5868 case opBitXor
: func
= &xor_ka
; break;
5869 case opShiftRight
: func
= &rightShift_ka
; break;
5870 case opShiftLeft
: func
= &leftShift_ka
; break;
5871 case opRound
: func
= &round_ka
; break;
5872 case opRoundUp
: func
= &roundUp_ka
; break;
5873 case opTrunc
: func
= &trunc_ka
; break;
5874 case opAtan2
: func
= &atan2_ka
; break;
5875 case opHypot
: func
= &hypot_ka
; break;
5876 case opHypotx
: func
= &hypotx_ka
; break;
5877 case opPow
: func
= &pow_ka
; break;
5878 case opRing1
: func
= &ring1_ka
; break;
5879 case opRing2
: func
= &ring2_ka
; break;
5880 case opRing3
: func
= &ring3_ka
; break;
5881 case opRing4
: func
= &ring4_ka
; break;
5882 case opDifSqr
: func
= &difsqr_ka
; break;
5883 case opSumSqr
: func
= &sumsqr_ka
; break;
5884 case opSqrSum
: func
= &sqrsum_ka
; break;
5885 case opSqrDif
: func
= &sqrdif_ka
; break;
5886 case opAbsDif
: func
= &absdif_ka
; break;
5887 case opThresh
: func
= &thresh_ka
; break;
5888 case opAMClip
: func
= &amclip_ka
; break;
5889 case opScaleNeg
: func
= &scaleneg_ka
; break;
5890 case opClip2
: func
= &clip2_ka
; break;
5891 case opFold2
: func
= &fold2_ka
; break;
5892 case opWrap2
: func
= &wrap2_ka
; break;
5893 case opExcess
: func
= &excess_ka
; break;
5894 //case opFirstArg : func = &firstarg_aa; break;
5895 //case opSecondArg : func = &secondarg_aa; break;
5896 default : func
= &add_ka
; break;
5899 // this should have been caught by mBufLength == 1
5903 case calc_ScalarRate
:
5904 if (rateB
== calc_FullRate
) {
5905 switch (unit
->mSpecialIndex
) {
5906 //case opSilence2 : func = &zero_aa; break;
5907 case opAdd
: func
= &add_ia
; break;
5908 case opSub
: func
= &sub_ia
; break;
5909 case opMul
: func
= &mul_ia
; break;
5910 case opFDiv
: func
= &div_ia
; break;
5911 case opMod
: func
= &mod_ia
; break;
5912 case opEQ
: func
= &eq_ia
; break;
5913 case opNE
: func
= &neq_ia
; break;
5914 case opLT
: func
= <_ia
; break;
5915 case opGT
: func
= >_ia
; break;
5916 case opLE
: func
= &le_ia
; break;
5917 case opGE
: func
= &ge_ia
; break;
5918 case opMin
: func
= &min_ia
; break;
5919 case opMax
: func
= &max_ia
; break;
5920 case opBitAnd
: func
= &and_ia
; break;
5921 case opBitOr
: func
= &or_ia
; break;
5922 case opBitXor
: func
= &xor_ia
; break;
5923 case opShiftRight
: func
= &rightShift_ia
; break;
5924 case opShiftLeft
: func
= &leftShift_ia
; break;
5925 case opRound
: func
= &round_ia
; break;
5926 case opRoundUp
: func
= &roundUp_ia
; break;
5927 case opTrunc
: func
= &trunc_ia
; break;
5928 case opAtan2
: func
= &atan2_ia
; break;
5929 case opHypot
: func
= &hypot_ia
; break;
5930 case opHypotx
: func
= &hypotx_ia
; break;
5931 case opPow
: func
= &pow_ia
; break;
5932 case opRing1
: func
= &ring1_ia
; break;
5933 case opRing2
: func
= &ring2_ia
; break;
5934 case opRing3
: func
= &ring3_ia
; break;
5935 case opRing4
: func
= &ring4_ia
; break;
5936 case opDifSqr
: func
= &difsqr_ia
; break;
5937 case opSumSqr
: func
= &sumsqr_ia
; break;
5938 case opSqrSum
: func
= &sqrsum_ia
; break;
5939 case opSqrDif
: func
= &sqrdif_ia
; break;
5940 case opAbsDif
: func
= &absdif_ia
; break;
5941 case opThresh
: func
= &thresh_ia
; break;
5942 case opAMClip
: func
= &amclip_ia
; break;
5943 case opScaleNeg
: func
= &scaleneg_ia
; break;
5944 case opClip2
: func
= &clip2_ia
; break;
5945 case opFold2
: func
= &fold2_ia
; break;
5946 case opWrap2
: func
= &wrap2_ia
; break;
5947 case opExcess
: func
= &excess_ia
; break;
5948 //case opFirstArg : func = &firstarg_aa; break;
5949 //case opSecondArg : func = &secondarg_aa; break;
5950 default : func
= &add_ia
; break;
5953 // this should have been caught by mBufLength == 1
5963 static BinaryOpFunc
ChooseNovaSimdFunc_64(BinaryOpUGen
*unit
)
5965 BinaryOpFunc func
= &zero_1
;
5967 int rateA
= INRATE(0);
5968 int rateB
= INRATE(1);
5974 switch (unit
->mSpecialIndex
) {
5975 //case opSilence2 : func = &zero_aa; break;
5976 case opAdd
: func
= &add_aa_nova_64
; break;
5977 case opSub
: func
= &sub_aa_nova_64
; break;
5978 case opMul
: func
= &mul_aa_nova_64
; break;
5979 case opFDiv
: func
= &div_aa_nova
; break;
5980 case opMod
: func
= &mod_aa
; break;
5981 case opEQ
: func
= &eq_aa_nova_64
; break;
5982 case opNE
: func
= &neq_aa_nova_64
; break;
5983 case opLT
: func
= <_aa_nova_64
; break;
5984 case opGT
: func
= >_aa_nova_64
; break;
5985 case opLE
: func
= &le_aa_nova_64
; break;
5986 case opGE
: func
= &ge_aa_nova_64
; break;
5987 case opMin
: func
= &min_aa_nova_64
; break;
5988 case opMax
: func
= &max_aa_nova_64
; break;
5989 case opBitAnd
: func
= &and_aa
; break;
5990 case opBitOr
: func
= &or_aa
; break;
5991 case opBitXor
: func
= &xor_aa
; break;
5992 case opShiftRight
: func
= &rightShift_aa
; break;
5993 case opShiftLeft
: func
= &leftShift_aa
; break;
5994 case opRound
: func
= &round_aa
; break;
5995 case opRoundUp
: func
= &roundUp_aa
; break;
5996 case opTrunc
: func
= &trunc_aa
; break;
5997 case opAtan2
: func
= &atan2_aa
; break;
5998 case opHypot
: func
= &hypot_aa
; break;
5999 case opHypotx
: func
= &hypotx_aa
; break;
6000 case opPow
: func
= &pow_aa_nova
; break;
6001 case opRing1
: func
= &ring1_aa
; break;
6002 case opRing2
: func
= &ring2_aa
; break;
6003 case opRing3
: func
= &ring3_aa
; break;
6004 case opRing4
: func
= &ring4_aa
; break;
6005 case opDifSqr
: func
= &difsqr_aa
; break;
6006 case opSumSqr
: func
= &sumsqr_aa
; break;
6007 case opSqrSum
: func
= &sqrsum_aa
; break;
6008 case opSqrDif
: func
= &sqrdif_aa
; break;
6009 case opAbsDif
: func
= &absdif_aa
; break;
6010 case opThresh
: func
= &thresh_aa
; break;
6011 case opAMClip
: func
= &amclip_aa
; break;
6012 case opScaleNeg
: func
= &scaleneg_aa
; break;
6013 case opClip2
: func
= &clip2_aa_nova_64
; break;
6014 case opFold2
: func
= &fold2_aa
; break;
6015 case opWrap2
: func
= &wrap2_aa
; break;
6016 case opExcess
: func
= &excess_aa
; break;
6017 case opFirstArg
: func
= &firstarg_aa_nova
; break;
6018 //case opSecondArg : func = &secondarg_aa_nova; break;
6019 default : func
= &add_aa
; break;
6023 switch (unit
->mSpecialIndex
) {
6024 //case opSilence2 : func = &zero_aa; break;
6025 case opAdd
: func
= &add_ak_nova_64
; break;
6026 case opSub
: func
= &sub_ak_nova_64
; break;
6027 case opMul
: func
= &mul_ak_nova_64
; break;
6028 case opFDiv
: func
= &div_ak_nova
; break;
6029 case opMod
: func
= &mod_ak
; break;
6030 case opEQ
: func
= &eq_ak_nova_64
; break;
6031 case opNE
: func
= &neq_ak_nova_64
; break;
6032 case opLT
: func
= <_ak_nova_64
; break;
6033 case opGT
: func
= >_ak_nova_64
; break;
6034 case opLE
: func
= &le_ak_nova_64
; break;
6035 case opGE
: func
= &ge_ak_nova_64
; break;
6036 case opMin
: func
= &min_ak_nova_64
; break;
6037 case opMax
: func
= &max_ak_nova_64
; break;
6038 case opBitAnd
: func
= &and_ak
; break;
6039 case opBitOr
: func
= &or_ak
; break;
6040 case opBitXor
: func
= &xor_ak
; break;
6041 case opShiftRight
: func
= &rightShift_ak
; break;
6042 case opShiftLeft
: func
= &leftShift_ak
; break;
6043 case opRound
: func
= &round_ak
; break;
6044 case opRoundUp
: func
= &roundUp_ak
; break;
6045 case opTrunc
: func
= &trunc_ak
; break;
6046 case opAtan2
: func
= &atan2_ak
; break;
6047 case opHypot
: func
= &hypot_ak
; break;
6048 case opHypotx
: func
= &hypotx_ak
; break;
6049 case opPow
: func
= &pow_ak_nova
; break;
6050 case opRing1
: func
= &ring1_ak
; break;
6051 case opRing2
: func
= &ring2_ak
; break;
6052 case opRing3
: func
= &ring3_ak
; break;
6053 case opRing4
: func
= &ring4_ak
; break;
6054 case opDifSqr
: func
= &difsqr_ak
; break;
6055 case opSumSqr
: func
= &sumsqr_ak
; break;
6056 case opSqrSum
: func
= &sqrsum_ak
; break;
6057 case opSqrDif
: func
= &sqrdif_ak
; break;
6058 case opAbsDif
: func
= &absdif_ak
; break;
6059 case opThresh
: func
= &thresh_ak
; break;
6060 case opAMClip
: func
= &amclip_ak
; break;
6061 case opScaleNeg
: func
= &scaleneg_ak
; break;
6062 case opClip2
: func
= &clip2_ak_nova_64
; break;
6063 case opFold2
: func
= &fold2_ak
; break;
6064 case opWrap2
: func
= &wrap2_ak
; break;
6065 case opExcess
: func
= &excess_ak
; break;
6066 case opFirstArg
: func
= &firstarg_aa
; break;
6067 //case opSecondArg : func = &secondarg_aa; break;
6068 default : func
= &add_ak
; break;
6071 case calc_ScalarRate
:
6072 switch (unit
->mSpecialIndex
) {
6073 //case opSilence2 : func = &zero_aa; break;
6074 case opAdd
: func
= &add_ai_nova_64
; break;
6075 case opSub
: func
= &sub_ai_nova_64
; break;
6076 case opMul
: func
= &mul_ai_nova_64
; break;
6077 case opFDiv
: func
= &div_ai_nova
; break;
6078 case opMod
: func
= &mod_ai
; break;
6079 case opEQ
: func
= &eq_ai_nova_64
; break;
6080 case opNE
: func
= &neq_ai_nova_64
; break;
6081 case opLT
: func
= <_ai_nova_64
; break;
6082 case opGT
: func
= >_ai_nova_64
; break;
6083 case opLE
: func
= &le_ai_nova_64
; break;
6084 case opGE
: func
= &ge_ai_nova_64
; break;
6085 case opMin
: func
= &min_ai_nova_64
; break;
6086 case opMax
: func
= &max_ai_nova_64
; break;
6087 case opBitAnd
: func
= &and_ai
; break;
6088 case opBitOr
: func
= &or_ai
; break;
6089 case opBitXor
: func
= &xor_ai
; break;
6090 case opShiftRight
: func
= &rightShift_ai
; break;
6091 case opShiftLeft
: func
= &leftShift_ai
; break;
6092 case opRound
: func
= &round_ai
; break;
6093 case opRoundUp
: func
= &roundUp_ai
; break;
6094 case opTrunc
: func
= &trunc_ai
; break;
6095 case opAtan2
: func
= &atan2_ai
; break;
6096 case opHypot
: func
= &hypot_ai
; break;
6097 case opHypotx
: func
= &hypotx_ai
; break;
6098 case opPow
: func
= &pow_ai_nova
; break;
6099 case opRing1
: func
= &ring1_ai
; break;
6100 case opRing2
: func
= &ring2_ai
; break;
6101 case opRing3
: func
= &ring3_ai
; break;
6102 case opRing4
: func
= &ring4_ai
; break;
6103 case opDifSqr
: func
= &difsqr_ai
; break;
6104 case opSumSqr
: func
= &sumsqr_ai
; break;
6105 case opSqrSum
: func
= &sqrsum_ai
; break;
6106 case opSqrDif
: func
= &sqrdif_ai
; break;
6107 case opAbsDif
: func
= &absdif_ai
; break;
6108 case opThresh
: func
= &thresh_ai
; break;
6109 case opAMClip
: func
= &amclip_ai
; break;
6110 case opScaleNeg
: func
= &scaleneg_ai
; break;
6111 case opClip2
: func
= &clip2_ai_nova_64
; break;
6112 case opFold2
: func
= &fold2_ai
; break;
6113 case opWrap2
: func
= &wrap2_ai
; break;
6114 case opExcess
: func
= &excess_ai
; break;
6115 case opFirstArg
: func
= &firstarg_aa
; break;
6116 //case opSecondArg : func = &secondarg_aa; break;
6117 default : func
= &add_ai
; break;
6122 if (rateB
== calc_FullRate
) {
6123 switch (unit
->mSpecialIndex
) {
6124 //case opSilence2 : func = &zero_aa; break;
6125 case opAdd
: func
= &add_ka_nova_64
; break;
6126 case opSub
: func
= &sub_ka_nova_64
; break;
6127 case opMul
: func
= &mul_ka_nova_64
; break;
6128 case opFDiv
: func
= &div_ka_nova
; break;
6129 case opMod
: func
= &mod_ka
; break;
6130 case opEQ
: func
= &eq_ka_nova_64
; break;
6131 case opNE
: func
= &neq_ka_nova_64
; break;
6132 case opLT
: func
= <_ka_nova_64
; break;
6133 case opGT
: func
= >_ka_nova_64
; break;
6134 case opLE
: func
= &le_ka_nova_64
; break;
6135 case opGE
: func
= &ge_ka_nova_64
; break;
6136 case opMin
: func
= &min_ka_nova_64
; break;
6137 case opMax
: func
= &max_ka_nova_64
; break;
6138 case opBitAnd
: func
= &and_ka
; break;
6139 case opBitOr
: func
= &or_ka
; break;
6140 case opBitXor
: func
= &xor_ka
; break;
6141 case opShiftRight
: func
= &rightShift_ka
; break;
6142 case opShiftLeft
: func
= &leftShift_ka
; break;
6143 case opRound
: func
= &round_ka
; break;
6144 case opRoundUp
: func
= &roundUp_ka
; break;
6145 case opTrunc
: func
= &trunc_ka
; break;
6146 case opAtan2
: func
= &atan2_ka
; break;
6147 case opHypot
: func
= &hypot_ka
; break;
6148 case opHypotx
: func
= &hypotx_ka
; break;
6149 case opPow
: func
= &pow_ka_nova
; break;
6150 case opRing1
: func
= &ring1_ka
; break;
6151 case opRing2
: func
= &ring2_ka
; break;
6152 case opRing3
: func
= &ring3_ka
; break;
6153 case opRing4
: func
= &ring4_ka
; break;
6154 case opDifSqr
: func
= &difsqr_ka
; break;
6155 case opSumSqr
: func
= &sumsqr_ka
; break;
6156 case opSqrSum
: func
= &sqrsum_ka
; break;
6157 case opSqrDif
: func
= &sqrdif_ka
; break;
6158 case opAbsDif
: func
= &absdif_ka
; break;
6159 case opThresh
: func
= &thresh_ka
; break;
6160 case opAMClip
: func
= &amclip_ka
; break;
6161 case opScaleNeg
: func
= &scaleneg_ka
; break;
6162 case opClip2
: func
= &clip2_ka_nova_64
; break;
6163 case opFold2
: func
= &fold2_ka
; break;
6164 case opWrap2
: func
= &wrap2_ka
; break;
6165 case opExcess
: func
= &excess_ka
; break;
6166 //case opFirstArg : func = &firstarg_aa; break;
6167 //case opSecondArg : func = &secondarg_aa; break;
6168 default : func
= &add_ka
; break;
6171 // this should have been caught by mBufLength == 1
6175 case calc_ScalarRate
:
6176 if (rateB
== calc_FullRate
) {
6177 switch (unit
->mSpecialIndex
) {
6178 //case opSilence2 : func = &zero_aa; break;
6179 case opAdd
: func
= &add_ia_nova_64
; break;
6180 case opSub
: func
= &sub_ia_nova_64
; break;
6181 case opMul
: func
= &mul_ia_nova_64
; break;
6182 case opFDiv
: func
= &div_ia_nova
; break;
6183 case opMod
: func
= &mod_ia
; break;
6184 case opEQ
: func
= &eq_ia_nova_64
; break;
6185 case opNE
: func
= &neq_ia_nova_64
; break;
6186 case opLT
: func
= <_ia_nova_64
; break;
6187 case opGT
: func
= >_ia_nova_64
; break;
6188 case opLE
: func
= &le_ia_nova_64
; break;
6189 case opGE
: func
= &ge_ia_nova_64
; break;
6190 case opMin
: func
= &min_ia_nova_64
; break;
6191 case opMax
: func
= &max_ia_nova_64
; break;
6192 case opBitAnd
: func
= &and_ia
; break;
6193 case opBitOr
: func
= &or_ia
; break;
6194 case opBitXor
: func
= &xor_ia
; break;
6195 case opShiftRight
: func
= &rightShift_ia
; break;
6196 case opShiftLeft
: func
= &leftShift_ia
; break;
6197 case opRound
: func
= &round_ia
; break;
6198 case opRoundUp
: func
= &roundUp_ia
; break;
6199 case opTrunc
: func
= &trunc_ia
; break;
6200 case opAtan2
: func
= &atan2_ia
; break;
6201 case opHypot
: func
= &hypot_ia
; break;
6202 case opHypotx
: func
= &hypotx_ia
; break;
6203 case opPow
: func
= &pow_ia_nova
; break;
6204 case opRing1
: func
= &ring1_ia
; break;
6205 case opRing2
: func
= &ring2_ia
; break;
6206 case opRing3
: func
= &ring3_ia
; break;
6207 case opRing4
: func
= &ring4_ia
; break;
6208 case opDifSqr
: func
= &difsqr_ia
; break;
6209 case opSumSqr
: func
= &sumsqr_ia
; break;
6210 case opSqrSum
: func
= &sqrsum_ia
; break;
6211 case opSqrDif
: func
= &sqrdif_ia
; break;
6212 case opAbsDif
: func
= &absdif_ia
; break;
6213 case opThresh
: func
= &thresh_ia
; break;
6214 case opAMClip
: func
= &amclip_ia
; break;
6215 case opScaleNeg
: func
= &scaleneg_ia
; break;
6216 case opClip2
: func
= &clip2_ia_nova_64
; break;
6217 case opFold2
: func
= &fold2_ia
; break;
6218 case opWrap2
: func
= &wrap2_ia
; break;
6219 case opExcess
: func
= &excess_ia
; break;
6220 //case opFirstArg : func = &firstarg_aa; break;
6221 //case opSecondArg : func = &secondarg_aa; break;
6222 default : func
= &add_ia
; break;
6225 // this should have been caught by mBufLength == 1
6235 static BinaryOpFunc
ChooseNovaSimdFunc(BinaryOpUGen
*unit
)
6237 if (BUFLENGTH
== 64)
6238 return ChooseNovaSimdFunc_64(unit
);
6240 BinaryOpFunc func
= &zero_1
;
6242 int rateA
= INRATE(0);
6243 int rateB
= INRATE(1);
6249 switch (unit
->mSpecialIndex
) {
6250 //case opSilence2 : func = &zero_aa; break;
6251 case opAdd
: func
= &add_aa_nova
; break;
6252 case opSub
: func
= &sub_aa_nova
; break;
6253 case opMul
: func
= &mul_aa_nova
; break;
6254 case opFDiv
: func
= &div_aa_nova
; break;
6255 case opMod
: func
= &mod_aa
; break;
6256 case opEQ
: func
= &eq_aa_nova
; break;
6257 case opNE
: func
= &neq_aa_nova
; break;
6258 case opLT
: func
= <_aa_nova
; break;
6259 case opGT
: func
= >_aa_nova
; break;
6260 case opLE
: func
= &le_aa_nova
; break;
6261 case opGE
: func
= &ge_aa_nova
; break;
6262 case opMin
: func
= &min_aa_nova
; break;
6263 case opMax
: func
= &max_aa_nova
; break;
6264 case opBitAnd
: func
= &and_aa
; break;
6265 case opBitOr
: func
= &or_aa
; break;
6266 case opBitXor
: func
= &xor_aa
; break;
6267 case opShiftRight
: func
= &rightShift_aa
; break;
6268 case opShiftLeft
: func
= &leftShift_aa
; break;
6269 case opRound
: func
= &round_aa
; break;
6270 case opRoundUp
: func
= &roundUp_aa
; break;
6271 case opTrunc
: func
= &trunc_aa
; break;
6272 case opAtan2
: func
= &atan2_aa
; break;
6273 case opHypot
: func
= &hypot_aa
; break;
6274 case opHypotx
: func
= &hypotx_aa
; break;
6275 case opPow
: func
= &pow_aa_nova
; break;
6276 case opRing1
: func
= &ring1_aa
; break;
6277 case opRing2
: func
= &ring2_aa
; break;
6278 case opRing3
: func
= &ring3_aa
; break;
6279 case opRing4
: func
= &ring4_aa
; break;
6280 case opDifSqr
: func
= &difsqr_aa
; break;
6281 case opSumSqr
: func
= &sumsqr_aa
; break;
6282 case opSqrSum
: func
= &sqrsum_aa
; break;
6283 case opSqrDif
: func
= &sqrdif_aa
; break;
6284 case opAbsDif
: func
= &absdif_aa
; break;
6285 case opThresh
: func
= &thresh_aa
; break;
6286 case opAMClip
: func
= &amclip_aa
; break;
6287 case opScaleNeg
: func
= &scaleneg_aa
; break;
6288 case opClip2
: func
= &clip2_aa_nova
; break;
6289 case opFold2
: func
= &fold2_aa
; break;
6290 case opWrap2
: func
= &wrap2_aa
; break;
6291 case opExcess
: func
= &excess_aa
; break;
6292 case opFirstArg
: func
= &firstarg_aa_nova
; break;
6293 //case opSecondArg : func = &secondarg_aa_nova; break;
6294 default : func
= &add_aa
; break;
6298 switch (unit
->mSpecialIndex
) {
6299 //case opSilence2 : func = &zero_aa; break;
6300 case opAdd
: func
= &add_ak_nova
; break;
6301 case opSub
: func
= &sub_ak_nova
; break;
6302 case opMul
: func
= &mul_ak_nova
; break;
6303 case opFDiv
: func
= &div_ak_nova
; break;
6304 case opMod
: func
= &mod_ak
; break;
6305 case opEQ
: func
= &eq_ak_nova
; break;
6306 case opNE
: func
= &neq_ak_nova
; break;
6307 case opLT
: func
= <_ak_nova
; break;
6308 case opGT
: func
= >_ak_nova
; break;
6309 case opLE
: func
= &le_ak_nova
; break;
6310 case opGE
: func
= &ge_ak_nova
; break;
6311 case opMin
: func
= &min_ak_nova
; break;
6312 case opMax
: func
= &max_ak_nova
; break;
6313 case opBitAnd
: func
= &and_ak
; break;
6314 case opBitOr
: func
= &or_ak
; break;
6315 case opBitXor
: func
= &xor_ak
; break;
6316 case opShiftRight
: func
= &rightShift_ak
; break;
6317 case opShiftLeft
: func
= &leftShift_ak
; break;
6318 case opRound
: func
= &round_ak
; break;
6319 case opRoundUp
: func
= &roundUp_ak
; break;
6320 case opTrunc
: func
= &trunc_ak
; break;
6321 case opAtan2
: func
= &atan2_ak
; break;
6322 case opHypot
: func
= &hypot_ak
; break;
6323 case opHypotx
: func
= &hypotx_ak
; break;
6324 case opPow
: func
= &pow_ak_nova
; break;
6325 case opRing1
: func
= &ring1_ak
; break;
6326 case opRing2
: func
= &ring2_ak
; break;
6327 case opRing3
: func
= &ring3_ak
; break;
6328 case opRing4
: func
= &ring4_ak
; break;
6329 case opDifSqr
: func
= &difsqr_ak
; break;
6330 case opSumSqr
: func
= &sumsqr_ak
; break;
6331 case opSqrSum
: func
= &sqrsum_ak
; break;
6332 case opSqrDif
: func
= &sqrdif_ak
; break;
6333 case opAbsDif
: func
= &absdif_ak
; break;
6334 case opThresh
: func
= &thresh_ak
; break;
6335 case opAMClip
: func
= &amclip_ak
; break;
6336 case opScaleNeg
: func
= &scaleneg_ak
; break;
6337 case opClip2
: func
= &clip2_ak_nova
; break;
6338 case opFold2
: func
= &fold2_ak
; break;
6339 case opWrap2
: func
= &wrap2_ak
; break;
6340 case opExcess
: func
= &excess_ak
; break;
6341 case opFirstArg
: func
= &firstarg_aa
; break;
6342 //case opSecondArg : func = &secondarg_aa; break;
6343 default : func
= &add_ak
; break;
6346 case calc_ScalarRate
:
6347 switch (unit
->mSpecialIndex
) {
6348 //case opSilence2 : func = &zero_aa; break;
6349 case opAdd
: func
= &add_ai_nova
; break;
6350 case opSub
: func
= &sub_ai_nova
; break;
6351 case opMul
: func
= &mul_ai_nova
; break;
6352 case opFDiv
: func
= &div_ai_nova
; break;
6353 case opMod
: func
= &mod_ai
; break;
6354 case opEQ
: func
= &eq_ai_nova
; break;
6355 case opNE
: func
= &neq_ai_nova
; break;
6356 case opLT
: func
= <_ai_nova
; break;
6357 case opGT
: func
= >_ai_nova
; break;
6358 case opLE
: func
= &le_ai_nova
; break;
6359 case opGE
: func
= &ge_ai_nova
; break;
6360 case opMin
: func
= &min_ai_nova
; break;
6361 case opMax
: func
= &max_ai_nova
; break;
6362 case opBitAnd
: func
= &and_ai
; break;
6363 case opBitOr
: func
= &or_ai
; break;
6364 case opBitXor
: func
= &xor_ai
; break;
6365 case opShiftRight
: func
= &rightShift_ai
; break;
6366 case opShiftLeft
: func
= &leftShift_ai
; break;
6367 case opRound
: func
= &round_ai
; break;
6368 case opRoundUp
: func
= &roundUp_ai
; break;
6369 case opTrunc
: func
= &trunc_ai
; break;
6370 case opAtan2
: func
= &atan2_ai
; break;
6371 case opHypot
: func
= &hypot_ai
; break;
6372 case opHypotx
: func
= &hypotx_ai
; break;
6373 case opPow
: func
= &pow_ai_nova
; break;
6374 case opRing1
: func
= &ring1_ai
; break;
6375 case opRing2
: func
= &ring2_ai
; break;
6376 case opRing3
: func
= &ring3_ai
; break;
6377 case opRing4
: func
= &ring4_ai
; break;
6378 case opDifSqr
: func
= &difsqr_ai
; break;
6379 case opSumSqr
: func
= &sumsqr_ai
; break;
6380 case opSqrSum
: func
= &sqrsum_ai
; break;
6381 case opSqrDif
: func
= &sqrdif_ai
; break;
6382 case opAbsDif
: func
= &absdif_ai
; break;
6383 case opThresh
: func
= &thresh_ai
; break;
6384 case opAMClip
: func
= &amclip_ai
; break;
6385 case opScaleNeg
: func
= &scaleneg_ai
; break;
6386 case opClip2
: func
= &clip2_ai_nova
; break;
6387 case opFold2
: func
= &fold2_ai
; break;
6388 case opWrap2
: func
= &wrap2_ai
; break;
6389 case opExcess
: func
= &excess_ai
; break;
6390 case opFirstArg
: func
= &firstarg_aa
; break;
6391 //case opSecondArg : func = &secondarg_aa; break;
6392 default : func
= &add_ai
; break;
6397 if (rateB
== calc_FullRate
) {
6398 switch (unit
->mSpecialIndex
) {
6399 //case opSilence2 : func = &zero_aa; break;
6400 case opAdd
: func
= &add_ka_nova
; break;
6401 case opSub
: func
= &sub_ka_nova
; break;
6402 case opMul
: func
= &mul_ka_nova
; break;
6403 case opFDiv
: func
= &div_ka_nova
; break;
6404 case opMod
: func
= &mod_ka
; break;
6405 case opEQ
: func
= &eq_ka_nova
; break;
6406 case opNE
: func
= &neq_ka_nova
; break;
6407 case opLT
: func
= <_ka_nova
; break;
6408 case opGT
: func
= >_ka_nova
; break;
6409 case opLE
: func
= &le_ka_nova
; break;
6410 case opGE
: func
= &ge_ka_nova
; break;
6411 case opMin
: func
= &min_ka_nova
; break;
6412 case opMax
: func
= &max_ka_nova
; break;
6413 case opBitAnd
: func
= &and_ka
; break;
6414 case opBitOr
: func
= &or_ka
; break;
6415 case opBitXor
: func
= &xor_ka
; break;
6416 case opShiftRight
: func
= &rightShift_ka
; break;
6417 case opShiftLeft
: func
= &leftShift_ka
; break;
6418 case opRound
: func
= &round_ka
; break;
6419 case opRoundUp
: func
= &roundUp_ka
; break;
6420 case opTrunc
: func
= &trunc_ka
; break;
6421 case opAtan2
: func
= &atan2_ka
; break;
6422 case opHypot
: func
= &hypot_ka
; break;
6423 case opHypotx
: func
= &hypotx_ka
; break;
6424 case opPow
: func
= &pow_ka_nova
; break;
6425 case opRing1
: func
= &ring1_ka
; break;
6426 case opRing2
: func
= &ring2_ka
; break;
6427 case opRing3
: func
= &ring3_ka
; break;
6428 case opRing4
: func
= &ring4_ka
; break;
6429 case opDifSqr
: func
= &difsqr_ka
; break;
6430 case opSumSqr
: func
= &sumsqr_ka
; break;
6431 case opSqrSum
: func
= &sqrsum_ka
; break;
6432 case opSqrDif
: func
= &sqrdif_ka
; break;
6433 case opAbsDif
: func
= &absdif_ka
; break;
6434 case opThresh
: func
= &thresh_ka
; break;
6435 case opAMClip
: func
= &amclip_ka
; break;
6436 case opScaleNeg
: func
= &scaleneg_ka
; break;
6437 case opClip2
: func
= &clip2_ka_nova
; break;
6438 case opFold2
: func
= &fold2_ka
; break;
6439 case opWrap2
: func
= &wrap2_ka
; break;
6440 case opExcess
: func
= &excess_ka
; break;
6441 //case opFirstArg : func = &firstarg_aa; break;
6442 //case opSecondArg : func = &secondarg_aa; break;
6443 default : func
= &add_ka
; break;
6446 // this should have been caught by mBufLength == 1
6450 case calc_ScalarRate
:
6451 if (rateB
== calc_FullRate
) {
6452 switch (unit
->mSpecialIndex
) {
6453 //case opSilence2 : func = &zero_aa; break;
6454 case opAdd
: func
= &add_ia_nova
; break;
6455 case opSub
: func
= &sub_ia_nova
; break;
6456 case opMul
: func
= &mul_ia_nova
; break;
6457 case opFDiv
: func
= &div_ia_nova
; break;
6458 case opMod
: func
= &mod_ia
; break;
6459 case opEQ
: func
= &eq_ia_nova
; break;
6460 case opNE
: func
= &neq_ia_nova
; break;
6461 case opLT
: func
= <_ia_nova
; break;
6462 case opGT
: func
= >_ia_nova
; break;
6463 case opLE
: func
= &le_ia_nova
; break;
6464 case opGE
: func
= &ge_ia_nova
; break;
6465 case opMin
: func
= &min_ia_nova
; break;
6466 case opMax
: func
= &max_ia_nova
; break;
6467 case opBitAnd
: func
= &and_ia
; break;
6468 case opBitOr
: func
= &or_ia
; break;
6469 case opBitXor
: func
= &xor_ia
; break;
6470 case opShiftRight
: func
= &rightShift_ia
; break;
6471 case opShiftLeft
: func
= &leftShift_ia
; break;
6472 case opRound
: func
= &round_ia
; break;
6473 case opRoundUp
: func
= &roundUp_ia
; break;
6474 case opTrunc
: func
= &trunc_ia
; break;
6475 case opAtan2
: func
= &atan2_ia
; break;
6476 case opHypot
: func
= &hypot_ia
; break;
6477 case opHypotx
: func
= &hypotx_ia
; break;
6478 case opPow
: func
= &pow_ia_nova
; break;
6479 case opRing1
: func
= &ring1_ia
; break;
6480 case opRing2
: func
= &ring2_ia
; break;
6481 case opRing3
: func
= &ring3_ia
; break;
6482 case opRing4
: func
= &ring4_ia
; break;
6483 case opDifSqr
: func
= &difsqr_ia
; break;
6484 case opSumSqr
: func
= &sumsqr_ia
; break;
6485 case opSqrSum
: func
= &sqrsum_ia
; break;
6486 case opSqrDif
: func
= &sqrdif_ia
; break;
6487 case opAbsDif
: func
= &absdif_ia
; break;
6488 case opThresh
: func
= &thresh_ia
; break;
6489 case opAMClip
: func
= &amclip_ia
; break;
6490 case opScaleNeg
: func
= &scaleneg_ia
; break;
6491 case opClip2
: func
= &clip2_ia_nova
; break;
6492 case opFold2
: func
= &fold2_ia
; break;
6493 case opWrap2
: func
= &wrap2_ia
; break;
6494 case opExcess
: func
= &excess_ia
; break;
6495 //case opFirstArg : func = &firstarg_aa; break;
6496 //case opSecondArg : func = &secondarg_aa; break;
6497 default : func
= &add_ia
; break;
6500 // this should have been caught by mBufLength == 1
6511 bool ChooseOperatorFunc(BinaryOpUGen
*unit
)
6513 //Print("->ChooseOperatorFunc %d\n", unit->mSpecialIndex);
6514 BinaryOpFunc func
= &zero_aa
;
6517 if (BUFLENGTH
== 1) {
6518 if (unit
->mCalcRate
== calc_DemandRate
) {
6519 func
= ChooseDemandFunc(unit
);
6521 func
= ChooseOneSampleFunc(unit
);
6523 #if defined(NOVA_SIMD)
6524 } else if (!(BUFLENGTH
& 15)) {
6525 /* select normal function for initialization */
6526 func
= ChooseNormalFunc(unit
);
6529 /* select simd function */
6530 func
= ChooseNovaSimdFunc(unit
);
6534 func
= ChooseNormalFunc(unit
);
6536 unit
->mCalcFunc
= (UnitCalcFunc
)func
;
6537 //Print("<-ChooseOperatorFunc %p\n", func);
6538 //Print("calc %d\n", unit->mCalcRate);
6545 ////////////////////////////////////////////////////////////////////////////////////////////////////////
6548 PluginLoad(BinaryOp
)
6552 DefineSimpleUnit(BinaryOpUGen
);