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), 1.f
/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
);
3148 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3155 FLATTEN
void pow_ka_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3157 float *out
= ZOUT(0);
3158 float xa
= unit
->mPrevA
;
3160 float next_a
= ZIN0(0);
3164 nova::pow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3166 nova::spow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3169 float slope
= CALCSLOPE(next_a
, xa
);
3172 ZXP(out
) = xa
>= 0.f
? pow(xa
, xb
) : -pow(-xa
, xb
);
3180 FLATTEN
void pow_ia_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3184 nova::pow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3186 nova::spow_vec_simd(OUT(0), xa
, IN(1), inNumSamples
);
3191 FLATTEN
void pow_ai_nova(BinaryOpUGen
*unit
, int inNumSamples
)
3194 nova::spow_vec_simd(OUT(0), IN(0), xb
, inNumSamples
);
3200 void ring1_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3202 float *out
= ZOUT(0);
3209 ZXP(out
) = xa
* xb
+ xa
;
3213 void ring1_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3215 float *out
= ZOUT(0);
3217 float xb
= unit
->mPrevB
;
3218 float next_b
= ZIN0(1);
3222 ZCopy(inNumSamples
, out
, a
);
3223 } else if (xb
== 1.f
) {
3231 ZXP(out
) = xa
* xb
+ xa
;
3235 float slope
= CALCSLOPE(next_b
, xb
);
3238 ZXP(out
) = xa
* xb
+ xa
;
3245 void ring1_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3247 float *out
= ZOUT(0);
3248 float xa
= unit
->mPrevA
;
3250 float next_a
= ZIN0(0);
3260 ZXP(out
) = xa
* xb
+ xa
;
3264 float slope
= CALCSLOPE(next_a
, xa
);
3267 ZXP(out
) = xa
* xb
+ xa
;
3274 void ring1_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3276 float *out
= ZOUT(0);
3282 ZXP(out
) = xa
* xb
+ xa
;
3288 void ring1_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3290 float *out
= ZOUT(0);
3296 ZXP(out
) = xa
* xb
+ xa
;
3304 void ring2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3306 float *out
= ZOUT(0);
3313 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3317 void ring2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3319 float *out
= ZOUT(0);
3321 float xb
= unit
->mPrevB
;
3322 float next_b
= ZIN0(1);
3326 ZCopy(inNumSamples
, out
, a
);
3330 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3334 float slope
= CALCSLOPE(next_b
, xb
);
3337 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3344 void ring2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3346 float *out
= ZOUT(0);
3347 float xa
= unit
->mPrevA
;
3349 float next_a
= ZIN0(0);
3353 ZCopy(inNumSamples
, out
, b
);
3357 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3361 float slope
= CALCSLOPE(next_a
, xa
);
3364 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3371 void ring2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3373 float *out
= ZOUT(0);
3379 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3385 void ring2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3387 float *out
= ZOUT(0);
3393 ZXP(out
) = xa
* xb
+ xa
+ xb
;
3401 void ring3_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3403 float *out
= ZOUT(0);
3410 ZXP(out
) = xa
* xa
* xb
;
3414 void ring3_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3416 float *out
= ZOUT(0);
3418 float xb
= unit
->mPrevB
;
3419 float next_b
= ZIN0(1);
3423 ZClear(inNumSamples
, out
);
3424 } else if (xb
== 1.f
) {
3432 ZXP(out
) = xa
* xa
* xb
;
3436 float slope
= CALCSLOPE(next_b
, xb
);
3439 ZXP(out
) = xa
* xa
* xb
;
3446 void ring3_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3448 float *out
= ZOUT(0);
3449 float xa
= unit
->mPrevA
;
3451 float next_a
= ZIN0(0);
3455 ZClear(inNumSamples
, out
);
3456 } else if (xa
== 1.f
) {
3457 ZCopy(inNumSamples
, out
, b
);
3461 ZXP(out
) = xa
* xa
* xb
;
3465 float slope
= CALCSLOPE(next_a
, xa
);
3468 ZXP(out
) = xa
* xa
* xb
;
3475 void ring3_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3477 float *out
= ZOUT(0);
3483 ZXP(out
) = xa
* xa
* xb
;
3489 void ring3_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3491 float *out
= ZOUT(0);
3497 ZXP(out
) = xa
* xa
* xb
;
3504 void ring4_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3506 float *out
= ZOUT(0);
3513 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3517 void ring4_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3519 float *out
= ZOUT(0);
3521 float xb
= unit
->mPrevB
;
3522 float next_b
= ZIN0(1);
3526 ZClear(inNumSamples
, out
);
3527 } else if (xb
== 1.f
) {
3530 ZXP(out
) = xa
* xa
- xa
;
3535 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3539 float slope
= CALCSLOPE(next_b
, xb
);
3542 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3549 void ring4_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3551 float *out
= ZOUT(0);
3552 float xa
= unit
->mPrevA
;
3554 float next_a
= ZIN0(0);
3558 ZClear(inNumSamples
, out
);
3559 } else if (xa
== 1.f
) {
3562 ZXP(out
) = xb
- xb
* xb
;
3567 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3571 float slope
= CALCSLOPE(next_a
, xa
);
3574 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3581 void ring4_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3583 float *out
= ZOUT(0);
3589 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3595 void ring4_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3597 float *out
= ZOUT(0);
3603 ZXP(out
) = xa
* xa
* xb
- xa
* xb
* xb
;
3610 void thresh_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3612 float *out
= ZOUT(0);
3619 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3623 void thresh_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3625 float *out
= ZOUT(0);
3627 float xb
= unit
->mPrevB
;
3628 float next_b
= ZIN0(1);
3633 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3636 float slope
= CALCSLOPE(next_b
, xb
);
3639 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3646 void thresh_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3648 float *out
= ZOUT(0);
3649 float xa
= unit
->mPrevA
;
3651 float next_a
= ZIN0(0);
3656 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3659 float slope
= CALCSLOPE(next_a
, xa
);
3662 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3669 void thresh_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3671 float *out
= ZOUT(0);
3677 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3683 void thresh_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3685 float *out
= ZOUT(0);
3691 ZXP(out
) = xa
< xb
? 0.f
: xa
;
3698 void clip2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3700 float *out
= ZOUT(0);
3707 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3711 void clip2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3713 float *out
= ZOUT(0);
3715 float xb
= unit
->mPrevB
;
3716 float next_b
= ZIN0(1);
3721 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3724 float slope
= CALCSLOPE(next_b
, xb
);
3727 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3734 void clip2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3736 float *out
= ZOUT(0);
3737 float xa
= unit
->mPrevA
;
3739 float next_a
= ZIN0(0);
3744 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3747 float slope
= CALCSLOPE(next_a
, xa
);
3750 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3757 void clip2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3759 float *out
= ZOUT(0);
3765 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3771 void clip2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3773 float *out
= ZOUT(0);
3779 ZXP(out
) = xa
> xb
? xb
: (xa
< -xb
? -xb
: xa
);
3786 NOVA_BINARY_WRAPPER_K(clip2
, clip2
)
3790 void excess_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3792 float *out
= ZOUT(0);
3799 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3803 void excess_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3805 float *out
= ZOUT(0);
3807 float xb
= unit
->mPrevB
;
3808 float next_b
= ZIN0(1);
3813 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3816 float slope
= CALCSLOPE(next_b
, xb
);
3819 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3826 void excess_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3828 float *out
= ZOUT(0);
3829 float xa
= unit
->mPrevA
;
3831 float next_a
= ZIN0(0);
3836 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3839 float slope
= CALCSLOPE(next_a
, xa
);
3842 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3849 void excess_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3851 float *out
= ZOUT(0);
3857 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3863 void excess_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3865 float *out
= ZOUT(0);
3871 ZXP(out
) = xa
> xb
? xa
-xb
: (xa
< -xb
? xa
+xb
: 0.f
);
3878 void lt_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3880 float *out
= ZOUT(0);
3887 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3892 NOVA_BINARY_WRAPPER_K(lt
, less
)
3896 void lt_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3898 float *out
= ZOUT(0);
3900 float xb
= unit
->mPrevB
;
3901 float next_b
= ZIN0(1);
3906 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3909 float slope
= CALCSLOPE(next_b
, xb
);
3912 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3919 void lt_ka(BinaryOpUGen
*unit
, int inNumSamples
)
3921 float *out
= ZOUT(0);
3922 float xa
= unit
->mPrevA
;
3924 float next_a
= ZIN0(0);
3929 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3932 float slope
= CALCSLOPE(next_a
, xa
);
3935 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3942 void lt_ia(BinaryOpUGen
*unit
, int inNumSamples
)
3944 float *out
= ZOUT(0);
3950 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3956 void lt_ai(BinaryOpUGen
*unit
, int inNumSamples
)
3958 float *out
= ZOUT(0);
3964 ZXP(out
) = xa
< xb
? 1.f
: 0.f
;
3971 void le_aa(BinaryOpUGen
*unit
, int inNumSamples
)
3973 float *out
= ZOUT(0);
3980 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
3985 NOVA_BINARY_WRAPPER_K(le
, less_equal
)
3988 void le_ak(BinaryOpUGen
*unit
, int inNumSamples
)
3990 float *out
= ZOUT(0);
3992 float xb
= unit
->mPrevB
;
3993 float next_b
= ZIN0(1);
3998 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4001 float slope
= CALCSLOPE(next_b
, xb
);
4004 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4011 void le_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4013 float *out
= ZOUT(0);
4014 float xa
= unit
->mPrevA
;
4016 float next_a
= ZIN0(0);
4021 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4024 float slope
= CALCSLOPE(next_a
, xa
);
4027 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4034 void le_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4036 float *out
= ZOUT(0);
4042 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4048 void le_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4050 float *out
= ZOUT(0);
4056 ZXP(out
) = xa
<= xb
? 1.f
: 0.f
;
4063 void gt_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4065 float *out
= ZOUT(0);
4072 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4077 NOVA_BINARY_WRAPPER_K(gt
, greater
)
4081 void gt_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4083 float *out
= ZOUT(0);
4085 float xb
= unit
->mPrevB
;
4086 float next_b
= ZIN0(1);
4091 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4094 float slope
= CALCSLOPE(next_b
, xb
);
4097 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4104 void gt_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4106 float *out
= ZOUT(0);
4107 float xa
= unit
->mPrevA
;
4109 float next_a
= ZIN0(0);
4114 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4117 float slope
= CALCSLOPE(next_a
, xa
);
4120 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4127 void gt_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4129 float *out
= ZOUT(0);
4135 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4141 void gt_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4143 float *out
= ZOUT(0);
4149 ZXP(out
) = xa
> xb
? 1.f
: 0.f
;
4156 void ge_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4158 float *out
= ZOUT(0);
4165 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4170 NOVA_BINARY_WRAPPER_K(ge
, greater_equal
)
4174 void ge_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4176 float *out
= ZOUT(0);
4178 float xb
= unit
->mPrevB
;
4179 float next_b
= ZIN0(1);
4184 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4187 float slope
= CALCSLOPE(next_b
, xb
);
4190 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4197 void ge_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4199 float *out
= ZOUT(0);
4200 float xa
= unit
->mPrevA
;
4202 float next_a
= ZIN0(0);
4207 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4210 float slope
= CALCSLOPE(next_a
, xa
);
4213 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4220 void ge_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4222 float *out
= ZOUT(0);
4228 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4234 void ge_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4236 float *out
= ZOUT(0);
4242 ZXP(out
) = xa
>= xb
? 1.f
: 0.f
;
4249 void eq_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4251 float *out
= ZOUT(0);
4258 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4263 NOVA_BINARY_WRAPPER_K(eq
, equal
)
4266 void eq_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4268 float *out
= ZOUT(0);
4270 float xb
= unit
->mPrevB
;
4271 float next_b
= ZIN0(1);
4276 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4279 float slope
= CALCSLOPE(next_b
, xb
);
4282 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4289 void eq_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4291 float *out
= ZOUT(0);
4292 float xa
= unit
->mPrevA
;
4294 float next_a
= ZIN0(0);
4299 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4302 float slope
= CALCSLOPE(next_a
, xa
);
4305 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4312 void eq_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4314 float *out
= ZOUT(0);
4320 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4326 void eq_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4328 float *out
= ZOUT(0);
4334 ZXP(out
) = xa
== xb
? 1.f
: 0.f
;
4341 void neq_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4343 float *out
= ZOUT(0);
4350 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4355 NOVA_BINARY_WRAPPER_K(neq
, notequal
)
4359 void neq_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4361 float *out
= ZOUT(0);
4363 float xb
= unit
->mPrevB
;
4364 float next_b
= ZIN0(1);
4369 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4372 float slope
= CALCSLOPE(next_b
, xb
);
4375 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4382 void neq_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4384 float *out
= ZOUT(0);
4385 float xa
= unit
->mPrevA
;
4387 float next_a
= ZIN0(0);
4392 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4395 float slope
= CALCSLOPE(next_a
, xa
);
4398 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4405 void neq_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4407 float *out
= ZOUT(0);
4413 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4419 void neq_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4421 float *out
= ZOUT(0);
4427 ZXP(out
) = xa
!= xb
? 1.f
: 0.f
;
4433 void sumsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4435 float *out
= ZOUT(0);
4442 ZXP(out
) = xa
* xa
+ xb
* xb
;
4446 void sumsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4448 float *out
= ZOUT(0);
4450 float xb
= unit
->mPrevB
;
4451 float next_b
= ZIN0(1);
4456 ZXP(out
) = xa
* xa
+ xb
* xb
;
4459 float slope
= CALCSLOPE(next_b
, xb
);
4462 ZXP(out
) = xa
* xa
+ xb
* xb
;
4469 void sumsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4471 float *out
= ZOUT(0);
4472 float xa
= unit
->mPrevA
;
4474 float next_a
= ZIN0(0);
4479 ZXP(out
) = xa
* xa
+ xb
* xb
;
4482 float slope
= CALCSLOPE(next_a
, xa
);
4485 ZXP(out
) = xa
* xa
+ xb
* xb
;
4493 void sumsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4495 float *out
= ZOUT(0);
4501 ZXP(out
) = xa
* xa
+ xb
* xb
;
4507 void sumsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4509 float *out
= ZOUT(0);
4515 ZXP(out
) = xa
* xa
+ xb
* xb
;
4522 void difsqr_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4524 float *out
= ZOUT(0);
4531 ZXP(out
) = xa
* xa
- xb
* xb
;
4535 void difsqr_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4537 float *out
= ZOUT(0);
4539 float xb
= unit
->mPrevB
;
4540 float next_b
= ZIN0(1);
4545 ZXP(out
) = xa
* xa
- xb
* xb
;
4548 float slope
= CALCSLOPE(next_b
, xb
);
4551 ZXP(out
) = xa
* xa
- xb
* xb
;
4558 void difsqr_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4560 float *out
= ZOUT(0);
4561 float xa
= unit
->mPrevA
;
4563 float next_a
= ZIN0(0);
4568 ZXP(out
) = xa
* xa
- xb
* xb
;
4571 float slope
= CALCSLOPE(next_a
, xa
);
4574 ZXP(out
) = xa
* xa
- xb
* xb
;
4581 void difsqr_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4583 float *out
= ZOUT(0);
4589 ZXP(out
) = xa
* xa
- xb
* xb
;
4595 void difsqr_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4597 float *out
= ZOUT(0);
4603 ZXP(out
) = xa
* xa
- xb
* xb
;
4609 void sqrsum_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4611 float *out
= ZOUT(0);
4616 float sum
= ZXP(a
) + ZXP(b
);
4617 ZXP(out
) = sum
* sum
;
4621 void sqrsum_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4623 float *out
= ZOUT(0);
4625 float xb
= unit
->mPrevB
;
4626 float next_b
= ZIN0(1);
4631 float sum
= xa
+ xb
;
4632 ZXP(out
) = sum
* sum
;
4635 float slope
= CALCSLOPE(next_b
, xb
);
4638 float sum
= xa
+ xb
;
4639 ZXP(out
) = sum
* sum
;
4646 void sqrsum_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4648 float *out
= ZOUT(0);
4649 float xa
= unit
->mPrevA
;
4651 float next_a
= ZIN0(0);
4656 float sum
= xa
+ xb
;
4657 ZXP(out
) = sum
* sum
;
4660 float slope
= CALCSLOPE(next_a
, xa
);
4663 float sum
= xa
+ xb
;
4664 ZXP(out
) = sum
* sum
;
4671 void sqrsum_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4673 float *out
= ZOUT(0);
4679 float sum
= xa
+ xb
;
4680 ZXP(out
) = sum
* sum
;
4686 void sqrsum_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4688 float *out
= ZOUT(0);
4694 float sum
= xa
+ xb
;
4695 ZXP(out
) = sum
* sum
;
4701 void sqrdif_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4703 float *out
= ZOUT(0);
4708 float dif
= ZXP(a
) - ZXP(b
);
4709 ZXP(out
) = dif
* dif
;
4713 void sqrdif_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4715 float *out
= ZOUT(0);
4717 float xb
= unit
->mPrevB
;
4718 float next_b
= ZIN0(1);
4723 float dif
= xa
- xb
;
4724 ZXP(out
) = dif
* dif
;
4727 float slope
= CALCSLOPE(next_b
, xb
);
4730 float dif
= xa
- xb
;
4731 ZXP(out
) = dif
* dif
;
4738 void sqrdif_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4740 float *out
= ZOUT(0);
4741 float xa
= unit
->mPrevA
;
4743 float next_a
= ZIN0(0);
4748 float dif
= xa
- xb
;
4749 ZXP(out
) = dif
* dif
;
4752 float slope
= CALCSLOPE(next_a
, xa
);
4755 float dif
= xa
- xb
;
4756 ZXP(out
) = dif
* dif
;
4764 void sqrdif_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4766 float *out
= ZOUT(0);
4772 float dif
= xa
- xb
;
4773 ZXP(out
) = dif
* dif
;
4779 void sqrdif_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4781 float *out
= ZOUT(0);
4787 float dif
= xa
- xb
;
4788 ZXP(out
) = dif
* dif
;
4794 void absdif_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4796 float *out
= ZOUT(0);
4801 float dif
= ZXP(a
) - ZXP(b
);
4802 ZXP(out
) = fabs(dif
);
4806 void absdif_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4808 float *out
= ZOUT(0);
4810 float xb
= unit
->mPrevB
;
4811 float next_b
= ZIN0(1);
4816 float dif
= xa
- xb
;
4817 ZXP(out
) = fabs(dif
);
4820 float slope
= CALCSLOPE(next_b
, xb
);
4823 float dif
= xa
- xb
;
4824 ZXP(out
) = fabs(dif
);
4831 void absdif_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4833 float *out
= ZOUT(0);
4834 float xa
= unit
->mPrevA
;
4836 float next_a
= ZIN0(0);
4841 float dif
= xa
- xb
;
4842 ZXP(out
) = fabs(dif
);
4845 float slope
= CALCSLOPE(next_a
, xa
);
4848 float dif
= xa
- xb
;
4849 ZXP(out
) = fabs(dif
);
4856 void absdif_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4858 float *out
= ZOUT(0);
4864 float dif
= xa
- xb
;
4865 ZXP(out
) = fabs(dif
);
4871 void absdif_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4873 float *out
= ZOUT(0);
4879 float dif
= xa
- xb
;
4880 ZXP(out
) = fabs(dif
);
4886 void round_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4888 float *out
= ZOUT(0);
4895 ZXP(out
) = sc_round(xa
, xb
);
4899 void round_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4901 float *out
= ZOUT(0);
4903 float xb
= unit
->mPrevB
;
4904 float next_b
= ZIN0(1);
4909 ZXP(out
) = sc_round(xa
, xb
);
4912 float slope
= CALCSLOPE(next_b
, xb
);
4915 ZXP(out
) = sc_round(xa
, xb
);
4922 void round_ka(BinaryOpUGen
*unit
, int inNumSamples
)
4924 float *out
= ZOUT(0);
4925 float xa
= unit
->mPrevA
;
4927 float next_a
= ZIN0(0);
4932 ZXP(out
) = sc_round(xa
, xb
);
4935 float slope
= CALCSLOPE(next_a
, xa
);
4938 ZXP(out
) = sc_round(xa
, xb
);
4946 void round_ia(BinaryOpUGen
*unit
, int inNumSamples
)
4948 float *out
= ZOUT(0);
4954 ZXP(out
) = sc_round(xa
, xb
);
4960 void round_ai(BinaryOpUGen
*unit
, int inNumSamples
)
4962 float *out
= ZOUT(0);
4968 ZXP(out
) = sc_round(xa
, xb
);
4976 void roundUp_aa(BinaryOpUGen
*unit
, int inNumSamples
)
4978 float *out
= ZOUT(0);
4985 ZXP(out
) = sc_roundUp(xa
, xb
);
4989 void roundUp_ak(BinaryOpUGen
*unit
, int inNumSamples
)
4991 float *out
= ZOUT(0);
4993 float xb
= unit
->mPrevB
;
4994 float next_b
= ZIN0(1);
4999 ZXP(out
) = sc_roundUp(xa
, xb
);
5002 float slope
= CALCSLOPE(next_b
, xb
);
5005 ZXP(out
) = sc_roundUp(xa
, xb
);
5012 void roundUp_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5014 float *out
= ZOUT(0);
5015 float xa
= unit
->mPrevA
;
5017 float next_a
= ZIN0(0);
5022 ZXP(out
) = sc_roundUp(xa
, xb
);
5025 float slope
= CALCSLOPE(next_a
, xa
);
5028 ZXP(out
) = sc_roundUp(xa
, xb
);
5036 void roundUp_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5038 float *out
= ZOUT(0);
5044 ZXP(out
) = sc_roundUp(xa
, xb
);
5050 void roundUp_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5052 float *out
= ZOUT(0);
5058 ZXP(out
) = sc_roundUp(xa
, xb
);
5065 void trunc_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5067 float *out
= ZOUT(0);
5074 ZXP(out
) = sc_trunc(xa
, xb
);
5078 void trunc_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5080 float *out
= ZOUT(0);
5082 float xb
= unit
->mPrevB
;
5083 float next_b
= ZIN0(1);
5088 ZXP(out
) = sc_trunc(xa
, xb
);
5091 float slope
= CALCSLOPE(next_b
, xb
);
5094 ZXP(out
) = sc_trunc(xa
, xb
);
5101 void trunc_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5103 float *out
= ZOUT(0);
5104 float xa
= unit
->mPrevA
;
5106 float next_a
= ZIN0(0);
5111 ZXP(out
) = sc_trunc(xa
, xb
);
5114 float slope
= CALCSLOPE(next_a
, xa
);
5117 ZXP(out
) = sc_trunc(xa
, xb
);
5124 void trunc_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5126 float *out
= ZOUT(0);
5132 ZXP(out
) = sc_trunc(xa
, xb
);
5138 void trunc_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5140 float *out
= ZOUT(0);
5146 ZXP(out
) = sc_trunc(xa
, xb
);
5153 void fold2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5155 float *out
= ZOUT(0);
5162 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5166 void fold2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5168 float *out
= ZOUT(0);
5170 float xb
= unit
->mPrevB
;
5171 float next_b
= ZIN0(1);
5176 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5179 float slope
= CALCSLOPE(next_b
, xb
);
5182 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5189 void fold2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5191 float *out
= ZOUT(0);
5192 float xa
= unit
->mPrevA
;
5194 float next_a
= ZIN0(0);
5199 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5202 float slope
= CALCSLOPE(next_a
, xa
);
5205 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5212 void fold2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5214 float *out
= ZOUT(0);
5220 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5226 void fold2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5228 float *out
= ZOUT(0);
5234 ZXP(out
) = sc_fold(xa
, -xb
, xb
);
5242 void wrap2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5244 float *out
= ZOUT(0);
5251 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5255 void wrap2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5257 float *out
= ZOUT(0);
5259 float xb
= unit
->mPrevB
;
5260 float next_b
= ZIN0(1);
5265 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5268 float slope
= CALCSLOPE(next_b
, xb
);
5271 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5278 void wrap2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5280 float *out
= ZOUT(0);
5281 float xa
= unit
->mPrevA
;
5283 float next_a
= ZIN0(0);
5288 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5291 float slope
= CALCSLOPE(next_a
, xa
);
5294 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5301 void wrap2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5303 float *out
= ZOUT(0);
5309 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5315 void wrap2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5317 float *out
= ZOUT(0);
5323 ZXP(out
) = sc_wrap(xa
, -xb
, xb
);
5330 void atan2_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5332 float *out
= ZOUT(0);
5339 ZXP(out
) = atan2(xa
, xb
);
5343 void atan2_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5345 float *out
= ZOUT(0);
5347 float xb
= unit
->mPrevB
;
5348 float next_b
= ZIN0(1);
5353 ZXP(out
) = atan2(xa
, xb
);
5356 float slope
= CALCSLOPE(next_b
, xb
);
5359 ZXP(out
) = atan2(xa
, xb
);
5366 void atan2_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5368 float *out
= ZOUT(0);
5369 float xa
= unit
->mPrevA
;
5371 float next_a
= ZIN0(0);
5376 ZXP(out
) = atan2(xa
, xb
);
5379 float slope
= CALCSLOPE(next_a
, xa
);
5382 ZXP(out
) = atan2(xa
, xb
);
5389 void atan2_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5391 float *out
= ZOUT(0);
5397 ZXP(out
) = atan2(xa
, xb
);
5403 void atan2_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5405 float *out
= ZOUT(0);
5411 ZXP(out
) = atan2(xa
, xb
);
5417 void hypot_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5419 float *out
= ZOUT(0);
5426 ZXP(out
) = hypotf(xa
, xb
);
5430 void hypot_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5432 float *out
= ZOUT(0);
5434 float xb
= unit
->mPrevB
;
5435 float next_b
= ZIN0(1);
5440 ZXP(out
) = hypotf(xa
, xb
);
5443 float slope
= CALCSLOPE(next_b
, xb
);
5446 ZXP(out
) = hypotf(xa
, xb
);
5453 void hypot_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5455 float *out
= ZOUT(0);
5456 float xa
= unit
->mPrevA
;
5458 float next_a
= ZIN0(0);
5463 ZXP(out
) = hypotf(xa
, xb
);
5466 float slope
= CALCSLOPE(next_a
, xa
);
5469 ZXP(out
) = hypotf(xa
, xb
);
5476 void hypot_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5478 float *out
= ZOUT(0);
5484 ZXP(out
) = hypotf(xa
, xb
);
5490 void hypot_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5492 float *out
= ZOUT(0);
5498 ZXP(out
) = hypotf(xa
, xb
);
5505 void hypotx_aa(BinaryOpUGen
*unit
, int inNumSamples
)
5507 float *out
= ZOUT(0);
5514 ZXP(out
) = sc_hypotx(xa
, xb
);
5518 void hypotx_ak(BinaryOpUGen
*unit
, int inNumSamples
)
5520 float *out
= ZOUT(0);
5522 float xb
= unit
->mPrevB
;
5523 float next_b
= ZIN0(1);
5528 ZXP(out
) = sc_hypotx(xa
, xb
);
5531 float slope
= CALCSLOPE(next_b
, xb
);
5534 ZXP(out
) = sc_hypotx(xa
, xb
);
5541 void hypotx_ka(BinaryOpUGen
*unit
, int inNumSamples
)
5543 float *out
= ZOUT(0);
5544 float xa
= unit
->mPrevA
;
5546 float next_a
= ZIN0(0);
5551 ZXP(out
) = sc_hypotx(xa
, xb
);
5554 float slope
= CALCSLOPE(next_a
, xa
);
5557 ZXP(out
) = sc_hypotx(xa
, xb
);
5564 void hypotx_ia(BinaryOpUGen
*unit
, int inNumSamples
)
5566 float *out
= ZOUT(0);
5572 ZXP(out
) = sc_hypotx(xa
, xb
);
5578 void hypotx_ai(BinaryOpUGen
*unit
, int inNumSamples
)
5580 float *out
= ZOUT(0);
5586 ZXP(out
) = sc_hypotx(xa
, xb
);
5591 static BinaryOpFunc
ChooseOneSampleFunc(BinaryOpUGen
*unit
)
5593 BinaryOpFunc func
= &zero_1
;
5595 switch (unit
->mSpecialIndex
) {
5596 //case opSilence2 : func = &zero_1; break;
5597 case opAdd
: func
= &add_1
; break;
5598 case opSub
: func
= &sub_1
; break;
5599 case opMul
: func
= &mul_1
; break;
5600 case opFDiv
: func
= &div_1
; break;
5601 case opMod
: func
= &mod_1
; break;
5602 case opEQ
: func
= &eq_1
; break;
5603 case opNE
: func
= &neq_1
; break;
5604 case opLT
: func
= <_1
; break;
5605 case opGT
: func
= >_1
; break;
5606 case opLE
: func
= &le_1
; break;
5607 case opGE
: func
= &ge_1
; break;
5608 case opMin
: func
= &min_1
; break;
5609 case opMax
: func
= &max_1
; break;
5610 case opBitAnd
: func
= &and_1
; break;
5611 case opBitOr
: func
= &or_1
; break;
5612 case opBitXor
: func
= &xor_1
; break;
5613 case opShiftRight
: func
= &rightShift_1
; break;
5614 case opShiftLeft
: func
= &leftShift_1
; break;
5615 case opRound
: func
= &round_1
; break;
5616 case opRoundUp
: func
= &roundUp_1
; break;
5617 case opTrunc
: func
= &trunc_1
; break;
5618 case opAtan2
: func
= &atan2_1
; break;
5619 case opHypot
: func
= &hypot_1
; break;
5620 case opHypotx
: func
= &hypotx_1
; break;
5621 case opPow
: func
= &pow_1
; break;
5622 case opRing1
: func
= &ring1_1
; break;
5623 case opRing2
: func
= &ring2_1
; break;
5624 case opRing3
: func
= &ring3_1
; break;
5625 case opRing4
: func
= &ring4_1
; break;
5626 case opDifSqr
: func
= &difsqr_1
; break;
5627 case opSumSqr
: func
= &sumsqr_1
; break;
5628 case opSqrSum
: func
= &sqrsum_1
; break;
5629 case opSqrDif
: func
= &sqrdif_1
; break;
5630 case opAbsDif
: func
= &absdif_1
; break;
5631 case opThresh
: func
= &thresh_1
; break;
5632 case opAMClip
: func
= &amclip_1
; break;
5633 case opScaleNeg
: func
= &scaleneg_1
; break;
5634 case opClip2
: func
= &clip2_1
; break;
5635 case opFold2
: func
= &fold2_1
; break;
5636 case opWrap2
: func
= &wrap2_1
; break;
5637 case opExcess
: func
= &excess_1
; break;
5638 case opFirstArg
: func
= &firstarg_1
; break;
5639 //case opSecondArg : func = &secondarg_1; break;
5640 default : func
= &add_1
; break;
5646 static BinaryOpFunc
ChooseDemandFunc(BinaryOpUGen
*unit
)
5648 BinaryOpFunc func
= &zero_1
;
5650 switch (unit
->mSpecialIndex
) {
5651 //case opSilence2 : func = &zero_d; break;
5652 case opAdd
: func
= &add_d
; break;
5653 case opSub
: func
= &sub_d
; break;
5654 case opMul
: func
= &mul_d
; break;
5655 case opFDiv
: func
= &div_d
; break;
5656 case opMod
: func
= &mod_d
; break;
5657 case opEQ
: func
= &eq_d
; break;
5658 case opNE
: func
= &neq_d
; break;
5659 case opLT
: func
= <_d
; break;
5660 case opGT
: func
= >_d
; break;
5661 case opLE
: func
= &le_d
; break;
5662 case opGE
: func
= &ge_d
; break;
5663 case opMin
: func
= &min_d
; break;
5664 case opMax
: func
= &max_d
; break;
5665 case opBitAnd
: func
= &and_d
; break;
5666 case opBitOr
: func
= &or_d
; break;
5667 case opBitXor
: func
= &xor_d
; break;
5668 case opShiftRight
: func
= &rightShift_d
; break;
5669 case opShiftLeft
: func
= &leftShift_d
; break;
5670 case opRound
: func
= &round_d
; break;
5671 case opRoundUp
: func
= &roundUp_d
; break;
5672 case opTrunc
: func
= &trunc_d
; break;
5673 case opAtan2
: func
= &atan2_d
; break;
5674 case opHypot
: func
= &hypot_d
; break;
5675 case opHypotx
: func
= &hypotx_d
; break;
5676 case opPow
: func
= &pow_d
; break;
5677 case opRing1
: func
= &ring1_d
; break;
5678 case opRing2
: func
= &ring2_d
; break;
5679 case opRing3
: func
= &ring3_d
; break;
5680 case opRing4
: func
= &ring4_d
; break;
5681 case opDifSqr
: func
= &difsqr_d
; break;
5682 case opSumSqr
: func
= &sumsqr_d
; break;
5683 case opSqrSum
: func
= &sqrsum_d
; break;
5684 case opSqrDif
: func
= &sqrdif_d
; break;
5685 case opAbsDif
: func
= &absdif_d
; break;
5686 case opThresh
: func
= &thresh_d
; break;
5687 case opAMClip
: func
= &amclip_d
; break;
5688 case opScaleNeg
: func
= &scaleneg_d
; break;
5689 case opClip2
: func
= &clip2_d
; break;
5690 case opFold2
: func
= &fold2_d
; break;
5691 case opWrap2
: func
= &wrap2_d
; break;
5692 case opExcess
: func
= &excess_d
; break;
5693 case opFirstArg
: func
= &firstarg_d
; break;
5694 //case opSecondArg : func = &secondarg_d; break;
5695 default : func
= &add_d
; break;
5701 static BinaryOpFunc
ChooseNormalFunc(BinaryOpUGen
*unit
)
5703 BinaryOpFunc func
= &zero_1
;
5705 int rateA
= INRATE(0);
5706 int rateB
= INRATE(1);
5712 switch (unit
->mSpecialIndex
) {
5713 //case opSilence2 : func = &zero_aa; break;
5714 case opAdd
: func
= &add_aa
; break;
5715 case opSub
: func
= &sub_aa
; break;
5716 case opMul
: func
= &mul_aa
; break;
5717 case opFDiv
: func
= &div_aa
; break;
5718 case opMod
: func
= &mod_aa
; break;
5719 case opEQ
: func
= &eq_aa
; break;
5720 case opNE
: func
= &neq_aa
; break;
5721 case opLT
: func
= <_aa
; break;
5722 case opGT
: func
= >_aa
; break;
5723 case opLE
: func
= &le_aa
; break;
5724 case opGE
: func
= &ge_aa
; break;
5725 case opMin
: func
= &min_aa
; break;
5726 case opMax
: func
= &max_aa
; break;
5727 case opBitAnd
: func
= &and_aa
; break;
5728 case opBitOr
: func
= &or_aa
; break;
5729 case opBitXor
: func
= &xor_aa
; break;
5730 case opShiftRight
: func
= &rightShift_aa
; break;
5731 case opShiftLeft
: func
= &leftShift_aa
; break;
5732 case opRound
: func
= &round_aa
; break;
5733 case opRoundUp
: func
= &roundUp_aa
; break;
5734 case opTrunc
: func
= &trunc_aa
; break;
5735 case opAtan2
: func
= &atan2_aa
; break;
5736 case opHypot
: func
= &hypot_aa
; break;
5737 case opHypotx
: func
= &hypotx_aa
; break;
5738 case opPow
: func
= &pow_aa
; break;
5739 case opRing1
: func
= &ring1_aa
; break;
5740 case opRing2
: func
= &ring2_aa
; break;
5741 case opRing3
: func
= &ring3_aa
; break;
5742 case opRing4
: func
= &ring4_aa
; break;
5743 case opDifSqr
: func
= &difsqr_aa
; break;
5744 case opSumSqr
: func
= &sumsqr_aa
; break;
5745 case opSqrSum
: func
= &sqrsum_aa
; break;
5746 case opSqrDif
: func
= &sqrdif_aa
; break;
5747 case opAbsDif
: func
= &absdif_aa
; break;
5748 case opThresh
: func
= &thresh_aa
; break;
5749 case opAMClip
: func
= &amclip_aa
; break;
5750 case opScaleNeg
: func
= &scaleneg_aa
; break;
5751 case opClip2
: func
= &clip2_aa
; break;
5752 case opFold2
: func
= &fold2_aa
; break;
5753 case opWrap2
: func
= &wrap2_aa
; break;
5754 case opExcess
: func
= &excess_aa
; break;
5755 case opFirstArg
: func
= &firstarg_aa
; break;
5756 //case opSecondArg : func = &secondarg_aa; break;
5757 default : func
= &add_aa
; break;
5761 switch (unit
->mSpecialIndex
) {
5762 //case opSilence2 : func = &zero_aa; break;
5763 case opAdd
: func
= &add_ak
; break;
5764 case opSub
: func
= &sub_ak
; break;
5765 case opMul
: func
= &mul_ak
; break;
5766 case opFDiv
: func
= &div_ak
; break;
5767 case opMod
: func
= &mod_ak
; break;
5768 case opEQ
: func
= &eq_ak
; break;
5769 case opNE
: func
= &neq_ak
; break;
5770 case opLT
: func
= <_ak
; break;
5771 case opGT
: func
= >_ak
; break;
5772 case opLE
: func
= &le_ak
; break;
5773 case opGE
: func
= &ge_ak
; break;
5774 case opMin
: func
= &min_ak
; break;
5775 case opMax
: func
= &max_ak
; break;
5776 case opBitAnd
: func
= &and_ak
; break;
5777 case opBitOr
: func
= &or_ak
; break;
5778 case opBitXor
: func
= &xor_ak
; break;
5779 case opShiftRight
: func
= &rightShift_ak
; break;
5780 case opShiftLeft
: func
= &leftShift_ak
; break;
5781 case opRound
: func
= &round_ak
; break;
5782 case opRoundUp
: func
= &roundUp_ak
; break;
5783 case opTrunc
: func
= &trunc_ak
; break;
5784 case opAtan2
: func
= &atan2_ak
; break;
5785 case opHypot
: func
= &hypot_ak
; break;
5786 case opHypotx
: func
= &hypotx_ak
; break;
5787 case opPow
: func
= &pow_ak
; break;
5788 case opRing1
: func
= &ring1_ak
; break;
5789 case opRing2
: func
= &ring2_ak
; break;
5790 case opRing3
: func
= &ring3_ak
; break;
5791 case opRing4
: func
= &ring4_ak
; break;
5792 case opDifSqr
: func
= &difsqr_ak
; break;
5793 case opSumSqr
: func
= &sumsqr_ak
; break;
5794 case opSqrSum
: func
= &sqrsum_ak
; break;
5795 case opSqrDif
: func
= &sqrdif_ak
; break;
5796 case opAbsDif
: func
= &absdif_ak
; break;
5797 case opThresh
: func
= &thresh_ak
; break;
5798 case opAMClip
: func
= &amclip_ak
; break;
5799 case opScaleNeg
: func
= &scaleneg_ak
; break;
5800 case opClip2
: func
= &clip2_ak
; break;
5801 case opFold2
: func
= &fold2_ak
; break;
5802 case opWrap2
: func
= &wrap2_ak
; break;
5803 case opExcess
: func
= &excess_ak
; break;
5804 case opFirstArg
: func
= &firstarg_aa
; break;
5805 //case opSecondArg : func = &secondarg_aa; break;
5806 default : func
= &add_ak
; break;
5809 case calc_ScalarRate
:
5810 switch (unit
->mSpecialIndex
) {
5811 //case opSilence2 : func = &zero_aa; break;
5812 case opAdd
: func
= &add_ai
; break;
5813 case opSub
: func
= &sub_ai
; break;
5814 case opMul
: func
= &mul_ai
; break;
5815 case opFDiv
: func
= &div_ai
; break;
5816 case opMod
: func
= &mod_ai
; break;
5817 case opEQ
: func
= &eq_ai
; break;
5818 case opNE
: func
= &neq_ai
; break;
5819 case opLT
: func
= <_ai
; break;
5820 case opGT
: func
= >_ai
; break;
5821 case opLE
: func
= &le_ai
; break;
5822 case opGE
: func
= &ge_ai
; break;
5823 case opMin
: func
= &min_ai
; break;
5824 case opMax
: func
= &max_ai
; break;
5825 case opBitAnd
: func
= &and_ai
; break;
5826 case opBitOr
: func
= &or_ai
; break;
5827 case opBitXor
: func
= &xor_ai
; break;
5828 case opShiftRight
: func
= &rightShift_ai
; break;
5829 case opShiftLeft
: func
= &leftShift_ai
; break;
5830 case opRound
: func
= &round_ai
; break;
5831 case opRoundUp
: func
= &roundUp_ai
; break;
5832 case opTrunc
: func
= &trunc_ai
; break;
5833 case opAtan2
: func
= &atan2_ai
; break;
5834 case opHypot
: func
= &hypot_ai
; break;
5835 case opHypotx
: func
= &hypotx_ai
; break;
5836 case opPow
: func
= &pow_ai
; break;
5837 case opRing1
: func
= &ring1_ai
; break;
5838 case opRing2
: func
= &ring2_ai
; break;
5839 case opRing3
: func
= &ring3_ai
; break;
5840 case opRing4
: func
= &ring4_ai
; break;
5841 case opDifSqr
: func
= &difsqr_ai
; break;
5842 case opSumSqr
: func
= &sumsqr_ai
; break;
5843 case opSqrSum
: func
= &sqrsum_ai
; break;
5844 case opSqrDif
: func
= &sqrdif_ai
; break;
5845 case opAbsDif
: func
= &absdif_ai
; break;
5846 case opThresh
: func
= &thresh_ai
; break;
5847 case opAMClip
: func
= &amclip_ai
; break;
5848 case opScaleNeg
: func
= &scaleneg_ai
; break;
5849 case opClip2
: func
= &clip2_ai
; break;
5850 case opFold2
: func
= &fold2_ai
; break;
5851 case opWrap2
: func
= &wrap2_ai
; break;
5852 case opExcess
: func
= &excess_ai
; break;
5853 case opFirstArg
: func
= &firstarg_aa
; break;
5854 //case opSecondArg : func = &secondarg_aa; break;
5855 default : func
= &add_ai
; break;
5860 if (rateB
== calc_FullRate
) {
5861 switch (unit
->mSpecialIndex
) {
5862 //case opSilence2 : func = &zero_aa; break;
5863 case opAdd
: func
= &add_ka
; break;
5864 case opSub
: func
= &sub_ka
; break;
5865 case opMul
: func
= &mul_ka
; break;
5866 case opFDiv
: func
= &div_ka
; break;
5867 case opMod
: func
= &mod_ka
; break;
5868 case opEQ
: func
= &eq_ka
; break;
5869 case opNE
: func
= &neq_ka
; break;
5870 case opLT
: func
= <_ka
; break;
5871 case opGT
: func
= >_ka
; break;
5872 case opLE
: func
= &le_ka
; break;
5873 case opGE
: func
= &ge_ka
; break;
5874 case opMin
: func
= &min_ka
; break;
5875 case opMax
: func
= &max_ka
; break;
5876 case opBitAnd
: func
= &and_ka
; break;
5877 case opBitOr
: func
= &or_ka
; break;
5878 case opBitXor
: func
= &xor_ka
; break;
5879 case opShiftRight
: func
= &rightShift_ka
; break;
5880 case opShiftLeft
: func
= &leftShift_ka
; break;
5881 case opRound
: func
= &round_ka
; break;
5882 case opRoundUp
: func
= &roundUp_ka
; break;
5883 case opTrunc
: func
= &trunc_ka
; break;
5884 case opAtan2
: func
= &atan2_ka
; break;
5885 case opHypot
: func
= &hypot_ka
; break;
5886 case opHypotx
: func
= &hypotx_ka
; break;
5887 case opPow
: func
= &pow_ka
; break;
5888 case opRing1
: func
= &ring1_ka
; break;
5889 case opRing2
: func
= &ring2_ka
; break;
5890 case opRing3
: func
= &ring3_ka
; break;
5891 case opRing4
: func
= &ring4_ka
; break;
5892 case opDifSqr
: func
= &difsqr_ka
; break;
5893 case opSumSqr
: func
= &sumsqr_ka
; break;
5894 case opSqrSum
: func
= &sqrsum_ka
; break;
5895 case opSqrDif
: func
= &sqrdif_ka
; break;
5896 case opAbsDif
: func
= &absdif_ka
; break;
5897 case opThresh
: func
= &thresh_ka
; break;
5898 case opAMClip
: func
= &amclip_ka
; break;
5899 case opScaleNeg
: func
= &scaleneg_ka
; break;
5900 case opClip2
: func
= &clip2_ka
; break;
5901 case opFold2
: func
= &fold2_ka
; break;
5902 case opWrap2
: func
= &wrap2_ka
; break;
5903 case opExcess
: func
= &excess_ka
; break;
5904 //case opFirstArg : func = &firstarg_aa; break;
5905 //case opSecondArg : func = &secondarg_aa; break;
5906 default : func
= &add_ka
; break;
5909 // this should have been caught by mBufLength == 1
5913 case calc_ScalarRate
:
5914 if (rateB
== calc_FullRate
) {
5915 switch (unit
->mSpecialIndex
) {
5916 //case opSilence2 : func = &zero_aa; break;
5917 case opAdd
: func
= &add_ia
; break;
5918 case opSub
: func
= &sub_ia
; break;
5919 case opMul
: func
= &mul_ia
; break;
5920 case opFDiv
: func
= &div_ia
; break;
5921 case opMod
: func
= &mod_ia
; break;
5922 case opEQ
: func
= &eq_ia
; break;
5923 case opNE
: func
= &neq_ia
; break;
5924 case opLT
: func
= <_ia
; break;
5925 case opGT
: func
= >_ia
; break;
5926 case opLE
: func
= &le_ia
; break;
5927 case opGE
: func
= &ge_ia
; break;
5928 case opMin
: func
= &min_ia
; break;
5929 case opMax
: func
= &max_ia
; break;
5930 case opBitAnd
: func
= &and_ia
; break;
5931 case opBitOr
: func
= &or_ia
; break;
5932 case opBitXor
: func
= &xor_ia
; break;
5933 case opShiftRight
: func
= &rightShift_ia
; break;
5934 case opShiftLeft
: func
= &leftShift_ia
; break;
5935 case opRound
: func
= &round_ia
; break;
5936 case opRoundUp
: func
= &roundUp_ia
; break;
5937 case opTrunc
: func
= &trunc_ia
; break;
5938 case opAtan2
: func
= &atan2_ia
; break;
5939 case opHypot
: func
= &hypot_ia
; break;
5940 case opHypotx
: func
= &hypotx_ia
; break;
5941 case opPow
: func
= &pow_ia
; break;
5942 case opRing1
: func
= &ring1_ia
; break;
5943 case opRing2
: func
= &ring2_ia
; break;
5944 case opRing3
: func
= &ring3_ia
; break;
5945 case opRing4
: func
= &ring4_ia
; break;
5946 case opDifSqr
: func
= &difsqr_ia
; break;
5947 case opSumSqr
: func
= &sumsqr_ia
; break;
5948 case opSqrSum
: func
= &sqrsum_ia
; break;
5949 case opSqrDif
: func
= &sqrdif_ia
; break;
5950 case opAbsDif
: func
= &absdif_ia
; break;
5951 case opThresh
: func
= &thresh_ia
; break;
5952 case opAMClip
: func
= &amclip_ia
; break;
5953 case opScaleNeg
: func
= &scaleneg_ia
; break;
5954 case opClip2
: func
= &clip2_ia
; break;
5955 case opFold2
: func
= &fold2_ia
; break;
5956 case opWrap2
: func
= &wrap2_ia
; break;
5957 case opExcess
: func
= &excess_ia
; break;
5958 //case opFirstArg : func = &firstarg_aa; break;
5959 //case opSecondArg : func = &secondarg_aa; break;
5960 default : func
= &add_ia
; break;
5963 // this should have been caught by mBufLength == 1
5973 static BinaryOpFunc
ChooseNovaSimdFunc_64(BinaryOpUGen
*unit
)
5975 BinaryOpFunc func
= &zero_1
;
5977 int rateA
= INRATE(0);
5978 int rateB
= INRATE(1);
5984 switch (unit
->mSpecialIndex
) {
5985 //case opSilence2 : func = &zero_aa; break;
5986 case opAdd
: func
= &add_aa_nova_64
; break;
5987 case opSub
: func
= &sub_aa_nova_64
; break;
5988 case opMul
: func
= &mul_aa_nova_64
; break;
5989 case opFDiv
: func
= &div_aa_nova
; break;
5990 case opMod
: func
= &mod_aa
; break;
5991 case opEQ
: func
= &eq_aa_nova_64
; break;
5992 case opNE
: func
= &neq_aa_nova_64
; break;
5993 case opLT
: func
= <_aa_nova_64
; break;
5994 case opGT
: func
= >_aa_nova_64
; break;
5995 case opLE
: func
= &le_aa_nova_64
; break;
5996 case opGE
: func
= &ge_aa_nova_64
; break;
5997 case opMin
: func
= &min_aa_nova_64
; break;
5998 case opMax
: func
= &max_aa_nova_64
; break;
5999 case opBitAnd
: func
= &and_aa
; break;
6000 case opBitOr
: func
= &or_aa
; break;
6001 case opBitXor
: func
= &xor_aa
; break;
6002 case opShiftRight
: func
= &rightShift_aa
; break;
6003 case opShiftLeft
: func
= &leftShift_aa
; break;
6004 case opRound
: func
= &round_aa
; break;
6005 case opRoundUp
: func
= &roundUp_aa
; break;
6006 case opTrunc
: func
= &trunc_aa
; break;
6007 case opAtan2
: func
= &atan2_aa
; break;
6008 case opHypot
: func
= &hypot_aa
; break;
6009 case opHypotx
: func
= &hypotx_aa
; break;
6010 case opPow
: func
= &pow_aa_nova
; break;
6011 case opRing1
: func
= &ring1_aa
; break;
6012 case opRing2
: func
= &ring2_aa
; break;
6013 case opRing3
: func
= &ring3_aa
; break;
6014 case opRing4
: func
= &ring4_aa
; break;
6015 case opDifSqr
: func
= &difsqr_aa
; break;
6016 case opSumSqr
: func
= &sumsqr_aa
; break;
6017 case opSqrSum
: func
= &sqrsum_aa
; break;
6018 case opSqrDif
: func
= &sqrdif_aa
; break;
6019 case opAbsDif
: func
= &absdif_aa
; break;
6020 case opThresh
: func
= &thresh_aa
; break;
6021 case opAMClip
: func
= &amclip_aa
; break;
6022 case opScaleNeg
: func
= &scaleneg_aa
; break;
6023 case opClip2
: func
= &clip2_aa_nova_64
; break;
6024 case opFold2
: func
= &fold2_aa
; break;
6025 case opWrap2
: func
= &wrap2_aa
; break;
6026 case opExcess
: func
= &excess_aa
; break;
6027 case opFirstArg
: func
= &firstarg_aa_nova
; break;
6028 //case opSecondArg : func = &secondarg_aa_nova; break;
6029 default : func
= &add_aa
; break;
6033 switch (unit
->mSpecialIndex
) {
6034 //case opSilence2 : func = &zero_aa; break;
6035 case opAdd
: func
= &add_ak_nova_64
; break;
6036 case opSub
: func
= &sub_ak_nova_64
; break;
6037 case opMul
: func
= &mul_ak_nova_64
; break;
6038 case opFDiv
: func
= &div_ak_nova
; break;
6039 case opMod
: func
= &mod_ak
; break;
6040 case opEQ
: func
= &eq_ak_nova_64
; break;
6041 case opNE
: func
= &neq_ak_nova_64
; break;
6042 case opLT
: func
= <_ak_nova_64
; break;
6043 case opGT
: func
= >_ak_nova_64
; break;
6044 case opLE
: func
= &le_ak_nova_64
; break;
6045 case opGE
: func
= &ge_ak_nova_64
; break;
6046 case opMin
: func
= &min_ak_nova_64
; break;
6047 case opMax
: func
= &max_ak_nova_64
; break;
6048 case opBitAnd
: func
= &and_ak
; break;
6049 case opBitOr
: func
= &or_ak
; break;
6050 case opBitXor
: func
= &xor_ak
; break;
6051 case opShiftRight
: func
= &rightShift_ak
; break;
6052 case opShiftLeft
: func
= &leftShift_ak
; break;
6053 case opRound
: func
= &round_ak
; break;
6054 case opRoundUp
: func
= &roundUp_ak
; break;
6055 case opTrunc
: func
= &trunc_ak
; break;
6056 case opAtan2
: func
= &atan2_ak
; break;
6057 case opHypot
: func
= &hypot_ak
; break;
6058 case opHypotx
: func
= &hypotx_ak
; break;
6059 case opPow
: func
= &pow_ak_nova
; break;
6060 case opRing1
: func
= &ring1_ak
; break;
6061 case opRing2
: func
= &ring2_ak
; break;
6062 case opRing3
: func
= &ring3_ak
; break;
6063 case opRing4
: func
= &ring4_ak
; break;
6064 case opDifSqr
: func
= &difsqr_ak
; break;
6065 case opSumSqr
: func
= &sumsqr_ak
; break;
6066 case opSqrSum
: func
= &sqrsum_ak
; break;
6067 case opSqrDif
: func
= &sqrdif_ak
; break;
6068 case opAbsDif
: func
= &absdif_ak
; break;
6069 case opThresh
: func
= &thresh_ak
; break;
6070 case opAMClip
: func
= &amclip_ak
; break;
6071 case opScaleNeg
: func
= &scaleneg_ak
; break;
6072 case opClip2
: func
= &clip2_ak_nova_64
; break;
6073 case opFold2
: func
= &fold2_ak
; break;
6074 case opWrap2
: func
= &wrap2_ak
; break;
6075 case opExcess
: func
= &excess_ak
; break;
6076 case opFirstArg
: func
= &firstarg_aa
; break;
6077 //case opSecondArg : func = &secondarg_aa; break;
6078 default : func
= &add_ak
; break;
6081 case calc_ScalarRate
:
6082 switch (unit
->mSpecialIndex
) {
6083 //case opSilence2 : func = &zero_aa; break;
6084 case opAdd
: func
= &add_ai_nova_64
; break;
6085 case opSub
: func
= &sub_ai_nova_64
; break;
6086 case opMul
: func
= &mul_ai_nova_64
; break;
6087 case opFDiv
: func
= &div_ai_nova
; break;
6088 case opMod
: func
= &mod_ai
; break;
6089 case opEQ
: func
= &eq_ai_nova_64
; break;
6090 case opNE
: func
= &neq_ai_nova_64
; break;
6091 case opLT
: func
= <_ai_nova_64
; break;
6092 case opGT
: func
= >_ai_nova_64
; break;
6093 case opLE
: func
= &le_ai_nova_64
; break;
6094 case opGE
: func
= &ge_ai_nova_64
; break;
6095 case opMin
: func
= &min_ai_nova_64
; break;
6096 case opMax
: func
= &max_ai_nova_64
; break;
6097 case opBitAnd
: func
= &and_ai
; break;
6098 case opBitOr
: func
= &or_ai
; break;
6099 case opBitXor
: func
= &xor_ai
; break;
6100 case opShiftRight
: func
= &rightShift_ai
; break;
6101 case opShiftLeft
: func
= &leftShift_ai
; break;
6102 case opRound
: func
= &round_ai
; break;
6103 case opRoundUp
: func
= &roundUp_ai
; break;
6104 case opTrunc
: func
= &trunc_ai
; break;
6105 case opAtan2
: func
= &atan2_ai
; break;
6106 case opHypot
: func
= &hypot_ai
; break;
6107 case opHypotx
: func
= &hypotx_ai
; break;
6108 case opPow
: func
= &pow_ai_nova
; break;
6109 case opRing1
: func
= &ring1_ai
; break;
6110 case opRing2
: func
= &ring2_ai
; break;
6111 case opRing3
: func
= &ring3_ai
; break;
6112 case opRing4
: func
= &ring4_ai
; break;
6113 case opDifSqr
: func
= &difsqr_ai
; break;
6114 case opSumSqr
: func
= &sumsqr_ai
; break;
6115 case opSqrSum
: func
= &sqrsum_ai
; break;
6116 case opSqrDif
: func
= &sqrdif_ai
; break;
6117 case opAbsDif
: func
= &absdif_ai
; break;
6118 case opThresh
: func
= &thresh_ai
; break;
6119 case opAMClip
: func
= &amclip_ai
; break;
6120 case opScaleNeg
: func
= &scaleneg_ai
; break;
6121 case opClip2
: func
= &clip2_ai_nova_64
; break;
6122 case opFold2
: func
= &fold2_ai
; break;
6123 case opWrap2
: func
= &wrap2_ai
; break;
6124 case opExcess
: func
= &excess_ai
; break;
6125 case opFirstArg
: func
= &firstarg_aa
; break;
6126 //case opSecondArg : func = &secondarg_aa; break;
6127 default : func
= &add_ai
; break;
6132 if (rateB
== calc_FullRate
) {
6133 switch (unit
->mSpecialIndex
) {
6134 //case opSilence2 : func = &zero_aa; break;
6135 case opAdd
: func
= &add_ka_nova_64
; break;
6136 case opSub
: func
= &sub_ka_nova_64
; break;
6137 case opMul
: func
= &mul_ka_nova_64
; break;
6138 case opFDiv
: func
= &div_ka_nova
; break;
6139 case opMod
: func
= &mod_ka
; break;
6140 case opEQ
: func
= &eq_ka_nova_64
; break;
6141 case opNE
: func
= &neq_ka_nova_64
; break;
6142 case opLT
: func
= <_ka_nova_64
; break;
6143 case opGT
: func
= >_ka_nova_64
; break;
6144 case opLE
: func
= &le_ka_nova_64
; break;
6145 case opGE
: func
= &ge_ka_nova_64
; break;
6146 case opMin
: func
= &min_ka_nova_64
; break;
6147 case opMax
: func
= &max_ka_nova_64
; break;
6148 case opBitAnd
: func
= &and_ka
; break;
6149 case opBitOr
: func
= &or_ka
; break;
6150 case opBitXor
: func
= &xor_ka
; break;
6151 case opShiftRight
: func
= &rightShift_ka
; break;
6152 case opShiftLeft
: func
= &leftShift_ka
; break;
6153 case opRound
: func
= &round_ka
; break;
6154 case opRoundUp
: func
= &roundUp_ka
; break;
6155 case opTrunc
: func
= &trunc_ka
; break;
6156 case opAtan2
: func
= &atan2_ka
; break;
6157 case opHypot
: func
= &hypot_ka
; break;
6158 case opHypotx
: func
= &hypotx_ka
; break;
6159 case opPow
: func
= &pow_ka_nova
; break;
6160 case opRing1
: func
= &ring1_ka
; break;
6161 case opRing2
: func
= &ring2_ka
; break;
6162 case opRing3
: func
= &ring3_ka
; break;
6163 case opRing4
: func
= &ring4_ka
; break;
6164 case opDifSqr
: func
= &difsqr_ka
; break;
6165 case opSumSqr
: func
= &sumsqr_ka
; break;
6166 case opSqrSum
: func
= &sqrsum_ka
; break;
6167 case opSqrDif
: func
= &sqrdif_ka
; break;
6168 case opAbsDif
: func
= &absdif_ka
; break;
6169 case opThresh
: func
= &thresh_ka
; break;
6170 case opAMClip
: func
= &amclip_ka
; break;
6171 case opScaleNeg
: func
= &scaleneg_ka
; break;
6172 case opClip2
: func
= &clip2_ka_nova_64
; break;
6173 case opFold2
: func
= &fold2_ka
; break;
6174 case opWrap2
: func
= &wrap2_ka
; break;
6175 case opExcess
: func
= &excess_ka
; break;
6176 //case opFirstArg : func = &firstarg_aa; break;
6177 //case opSecondArg : func = &secondarg_aa; break;
6178 default : func
= &add_ka
; break;
6181 // this should have been caught by mBufLength == 1
6185 case calc_ScalarRate
:
6186 if (rateB
== calc_FullRate
) {
6187 switch (unit
->mSpecialIndex
) {
6188 //case opSilence2 : func = &zero_aa; break;
6189 case opAdd
: func
= &add_ia_nova_64
; break;
6190 case opSub
: func
= &sub_ia_nova_64
; break;
6191 case opMul
: func
= &mul_ia_nova_64
; break;
6192 case opFDiv
: func
= &div_ia_nova
; break;
6193 case opMod
: func
= &mod_ia
; break;
6194 case opEQ
: func
= &eq_ia_nova_64
; break;
6195 case opNE
: func
= &neq_ia_nova_64
; break;
6196 case opLT
: func
= <_ia_nova_64
; break;
6197 case opGT
: func
= >_ia_nova_64
; break;
6198 case opLE
: func
= &le_ia_nova_64
; break;
6199 case opGE
: func
= &ge_ia_nova_64
; break;
6200 case opMin
: func
= &min_ia_nova_64
; break;
6201 case opMax
: func
= &max_ia_nova_64
; break;
6202 case opBitAnd
: func
= &and_ia
; break;
6203 case opBitOr
: func
= &or_ia
; break;
6204 case opBitXor
: func
= &xor_ia
; break;
6205 case opShiftRight
: func
= &rightShift_ia
; break;
6206 case opShiftLeft
: func
= &leftShift_ia
; break;
6207 case opRound
: func
= &round_ia
; break;
6208 case opRoundUp
: func
= &roundUp_ia
; break;
6209 case opTrunc
: func
= &trunc_ia
; break;
6210 case opAtan2
: func
= &atan2_ia
; break;
6211 case opHypot
: func
= &hypot_ia
; break;
6212 case opHypotx
: func
= &hypotx_ia
; break;
6213 case opPow
: func
= &pow_ia_nova
; break;
6214 case opRing1
: func
= &ring1_ia
; break;
6215 case opRing2
: func
= &ring2_ia
; break;
6216 case opRing3
: func
= &ring3_ia
; break;
6217 case opRing4
: func
= &ring4_ia
; break;
6218 case opDifSqr
: func
= &difsqr_ia
; break;
6219 case opSumSqr
: func
= &sumsqr_ia
; break;
6220 case opSqrSum
: func
= &sqrsum_ia
; break;
6221 case opSqrDif
: func
= &sqrdif_ia
; break;
6222 case opAbsDif
: func
= &absdif_ia
; break;
6223 case opThresh
: func
= &thresh_ia
; break;
6224 case opAMClip
: func
= &amclip_ia
; break;
6225 case opScaleNeg
: func
= &scaleneg_ia
; break;
6226 case opClip2
: func
= &clip2_ia_nova_64
; break;
6227 case opFold2
: func
= &fold2_ia
; break;
6228 case opWrap2
: func
= &wrap2_ia
; break;
6229 case opExcess
: func
= &excess_ia
; break;
6230 //case opFirstArg : func = &firstarg_aa; break;
6231 //case opSecondArg : func = &secondarg_aa; break;
6232 default : func
= &add_ia
; break;
6235 // this should have been caught by mBufLength == 1
6245 static BinaryOpFunc
ChooseNovaSimdFunc(BinaryOpUGen
*unit
)
6247 if (BUFLENGTH
== 64)
6248 return ChooseNovaSimdFunc_64(unit
);
6250 BinaryOpFunc func
= &zero_1
;
6252 int rateA
= INRATE(0);
6253 int rateB
= INRATE(1);
6259 switch (unit
->mSpecialIndex
) {
6260 //case opSilence2 : func = &zero_aa; break;
6261 case opAdd
: func
= &add_aa_nova
; break;
6262 case opSub
: func
= &sub_aa_nova
; break;
6263 case opMul
: func
= &mul_aa_nova
; break;
6264 case opFDiv
: func
= &div_aa_nova
; break;
6265 case opMod
: func
= &mod_aa
; break;
6266 case opEQ
: func
= &eq_aa_nova
; break;
6267 case opNE
: func
= &neq_aa_nova
; break;
6268 case opLT
: func
= <_aa_nova
; break;
6269 case opGT
: func
= >_aa_nova
; break;
6270 case opLE
: func
= &le_aa_nova
; break;
6271 case opGE
: func
= &ge_aa_nova
; break;
6272 case opMin
: func
= &min_aa_nova
; break;
6273 case opMax
: func
= &max_aa_nova
; break;
6274 case opBitAnd
: func
= &and_aa
; break;
6275 case opBitOr
: func
= &or_aa
; break;
6276 case opBitXor
: func
= &xor_aa
; break;
6277 case opShiftRight
: func
= &rightShift_aa
; break;
6278 case opShiftLeft
: func
= &leftShift_aa
; break;
6279 case opRound
: func
= &round_aa
; break;
6280 case opRoundUp
: func
= &roundUp_aa
; break;
6281 case opTrunc
: func
= &trunc_aa
; break;
6282 case opAtan2
: func
= &atan2_aa
; break;
6283 case opHypot
: func
= &hypot_aa
; break;
6284 case opHypotx
: func
= &hypotx_aa
; break;
6285 case opPow
: func
= &pow_aa_nova
; break;
6286 case opRing1
: func
= &ring1_aa
; break;
6287 case opRing2
: func
= &ring2_aa
; break;
6288 case opRing3
: func
= &ring3_aa
; break;
6289 case opRing4
: func
= &ring4_aa
; break;
6290 case opDifSqr
: func
= &difsqr_aa
; break;
6291 case opSumSqr
: func
= &sumsqr_aa
; break;
6292 case opSqrSum
: func
= &sqrsum_aa
; break;
6293 case opSqrDif
: func
= &sqrdif_aa
; break;
6294 case opAbsDif
: func
= &absdif_aa
; break;
6295 case opThresh
: func
= &thresh_aa
; break;
6296 case opAMClip
: func
= &amclip_aa
; break;
6297 case opScaleNeg
: func
= &scaleneg_aa
; break;
6298 case opClip2
: func
= &clip2_aa_nova
; break;
6299 case opFold2
: func
= &fold2_aa
; break;
6300 case opWrap2
: func
= &wrap2_aa
; break;
6301 case opExcess
: func
= &excess_aa
; break;
6302 case opFirstArg
: func
= &firstarg_aa_nova
; break;
6303 //case opSecondArg : func = &secondarg_aa_nova; break;
6304 default : func
= &add_aa
; break;
6308 switch (unit
->mSpecialIndex
) {
6309 //case opSilence2 : func = &zero_aa; break;
6310 case opAdd
: func
= &add_ak_nova
; break;
6311 case opSub
: func
= &sub_ak_nova
; break;
6312 case opMul
: func
= &mul_ak_nova
; break;
6313 case opFDiv
: func
= &div_ak_nova
; break;
6314 case opMod
: func
= &mod_ak
; break;
6315 case opEQ
: func
= &eq_ak_nova
; break;
6316 case opNE
: func
= &neq_ak_nova
; break;
6317 case opLT
: func
= <_ak_nova
; break;
6318 case opGT
: func
= >_ak_nova
; break;
6319 case opLE
: func
= &le_ak_nova
; break;
6320 case opGE
: func
= &ge_ak_nova
; break;
6321 case opMin
: func
= &min_ak_nova
; break;
6322 case opMax
: func
= &max_ak_nova
; break;
6323 case opBitAnd
: func
= &and_ak
; break;
6324 case opBitOr
: func
= &or_ak
; break;
6325 case opBitXor
: func
= &xor_ak
; break;
6326 case opShiftRight
: func
= &rightShift_ak
; break;
6327 case opShiftLeft
: func
= &leftShift_ak
; break;
6328 case opRound
: func
= &round_ak
; break;
6329 case opRoundUp
: func
= &roundUp_ak
; break;
6330 case opTrunc
: func
= &trunc_ak
; break;
6331 case opAtan2
: func
= &atan2_ak
; break;
6332 case opHypot
: func
= &hypot_ak
; break;
6333 case opHypotx
: func
= &hypotx_ak
; break;
6334 case opPow
: func
= &pow_ak_nova
; break;
6335 case opRing1
: func
= &ring1_ak
; break;
6336 case opRing2
: func
= &ring2_ak
; break;
6337 case opRing3
: func
= &ring3_ak
; break;
6338 case opRing4
: func
= &ring4_ak
; break;
6339 case opDifSqr
: func
= &difsqr_ak
; break;
6340 case opSumSqr
: func
= &sumsqr_ak
; break;
6341 case opSqrSum
: func
= &sqrsum_ak
; break;
6342 case opSqrDif
: func
= &sqrdif_ak
; break;
6343 case opAbsDif
: func
= &absdif_ak
; break;
6344 case opThresh
: func
= &thresh_ak
; break;
6345 case opAMClip
: func
= &amclip_ak
; break;
6346 case opScaleNeg
: func
= &scaleneg_ak
; break;
6347 case opClip2
: func
= &clip2_ak_nova
; break;
6348 case opFold2
: func
= &fold2_ak
; break;
6349 case opWrap2
: func
= &wrap2_ak
; break;
6350 case opExcess
: func
= &excess_ak
; break;
6351 case opFirstArg
: func
= &firstarg_aa
; break;
6352 //case opSecondArg : func = &secondarg_aa; break;
6353 default : func
= &add_ak
; break;
6356 case calc_ScalarRate
:
6357 switch (unit
->mSpecialIndex
) {
6358 //case opSilence2 : func = &zero_aa; break;
6359 case opAdd
: func
= &add_ai_nova
; break;
6360 case opSub
: func
= &sub_ai_nova
; break;
6361 case opMul
: func
= &mul_ai_nova
; break;
6362 case opFDiv
: func
= &div_ai_nova
; break;
6363 case opMod
: func
= &mod_ai
; break;
6364 case opEQ
: func
= &eq_ai_nova
; break;
6365 case opNE
: func
= &neq_ai_nova
; break;
6366 case opLT
: func
= <_ai_nova
; break;
6367 case opGT
: func
= >_ai_nova
; break;
6368 case opLE
: func
= &le_ai_nova
; break;
6369 case opGE
: func
= &ge_ai_nova
; break;
6370 case opMin
: func
= &min_ai_nova
; break;
6371 case opMax
: func
= &max_ai_nova
; break;
6372 case opBitAnd
: func
= &and_ai
; break;
6373 case opBitOr
: func
= &or_ai
; break;
6374 case opBitXor
: func
= &xor_ai
; break;
6375 case opShiftRight
: func
= &rightShift_ai
; break;
6376 case opShiftLeft
: func
= &leftShift_ai
; break;
6377 case opRound
: func
= &round_ai
; break;
6378 case opRoundUp
: func
= &roundUp_ai
; break;
6379 case opTrunc
: func
= &trunc_ai
; break;
6380 case opAtan2
: func
= &atan2_ai
; break;
6381 case opHypot
: func
= &hypot_ai
; break;
6382 case opHypotx
: func
= &hypotx_ai
; break;
6383 case opPow
: func
= &pow_ai_nova
; break;
6384 case opRing1
: func
= &ring1_ai
; break;
6385 case opRing2
: func
= &ring2_ai
; break;
6386 case opRing3
: func
= &ring3_ai
; break;
6387 case opRing4
: func
= &ring4_ai
; break;
6388 case opDifSqr
: func
= &difsqr_ai
; break;
6389 case opSumSqr
: func
= &sumsqr_ai
; break;
6390 case opSqrSum
: func
= &sqrsum_ai
; break;
6391 case opSqrDif
: func
= &sqrdif_ai
; break;
6392 case opAbsDif
: func
= &absdif_ai
; break;
6393 case opThresh
: func
= &thresh_ai
; break;
6394 case opAMClip
: func
= &amclip_ai
; break;
6395 case opScaleNeg
: func
= &scaleneg_ai
; break;
6396 case opClip2
: func
= &clip2_ai_nova
; break;
6397 case opFold2
: func
= &fold2_ai
; break;
6398 case opWrap2
: func
= &wrap2_ai
; break;
6399 case opExcess
: func
= &excess_ai
; break;
6400 case opFirstArg
: func
= &firstarg_aa
; break;
6401 //case opSecondArg : func = &secondarg_aa; break;
6402 default : func
= &add_ai
; break;
6407 if (rateB
== calc_FullRate
) {
6408 switch (unit
->mSpecialIndex
) {
6409 //case opSilence2 : func = &zero_aa; break;
6410 case opAdd
: func
= &add_ka_nova
; break;
6411 case opSub
: func
= &sub_ka_nova
; break;
6412 case opMul
: func
= &mul_ka_nova
; break;
6413 case opFDiv
: func
= &div_ka_nova
; break;
6414 case opMod
: func
= &mod_ka
; break;
6415 case opEQ
: func
= &eq_ka_nova
; break;
6416 case opNE
: func
= &neq_ka_nova
; break;
6417 case opLT
: func
= <_ka_nova
; break;
6418 case opGT
: func
= >_ka_nova
; break;
6419 case opLE
: func
= &le_ka_nova
; break;
6420 case opGE
: func
= &ge_ka_nova
; break;
6421 case opMin
: func
= &min_ka_nova
; break;
6422 case opMax
: func
= &max_ka_nova
; break;
6423 case opBitAnd
: func
= &and_ka
; break;
6424 case opBitOr
: func
= &or_ka
; break;
6425 case opBitXor
: func
= &xor_ka
; break;
6426 case opShiftRight
: func
= &rightShift_ka
; break;
6427 case opShiftLeft
: func
= &leftShift_ka
; break;
6428 case opRound
: func
= &round_ka
; break;
6429 case opRoundUp
: func
= &roundUp_ka
; break;
6430 case opTrunc
: func
= &trunc_ka
; break;
6431 case opAtan2
: func
= &atan2_ka
; break;
6432 case opHypot
: func
= &hypot_ka
; break;
6433 case opHypotx
: func
= &hypotx_ka
; break;
6434 case opPow
: func
= &pow_ka_nova
; break;
6435 case opRing1
: func
= &ring1_ka
; break;
6436 case opRing2
: func
= &ring2_ka
; break;
6437 case opRing3
: func
= &ring3_ka
; break;
6438 case opRing4
: func
= &ring4_ka
; break;
6439 case opDifSqr
: func
= &difsqr_ka
; break;
6440 case opSumSqr
: func
= &sumsqr_ka
; break;
6441 case opSqrSum
: func
= &sqrsum_ka
; break;
6442 case opSqrDif
: func
= &sqrdif_ka
; break;
6443 case opAbsDif
: func
= &absdif_ka
; break;
6444 case opThresh
: func
= &thresh_ka
; break;
6445 case opAMClip
: func
= &amclip_ka
; break;
6446 case opScaleNeg
: func
= &scaleneg_ka
; break;
6447 case opClip2
: func
= &clip2_ka_nova
; break;
6448 case opFold2
: func
= &fold2_ka
; break;
6449 case opWrap2
: func
= &wrap2_ka
; break;
6450 case opExcess
: func
= &excess_ka
; break;
6451 //case opFirstArg : func = &firstarg_aa; break;
6452 //case opSecondArg : func = &secondarg_aa; break;
6453 default : func
= &add_ka
; break;
6456 // this should have been caught by mBufLength == 1
6460 case calc_ScalarRate
:
6461 if (rateB
== calc_FullRate
) {
6462 switch (unit
->mSpecialIndex
) {
6463 //case opSilence2 : func = &zero_aa; break;
6464 case opAdd
: func
= &add_ia_nova
; break;
6465 case opSub
: func
= &sub_ia_nova
; break;
6466 case opMul
: func
= &mul_ia_nova
; break;
6467 case opFDiv
: func
= &div_ia_nova
; break;
6468 case opMod
: func
= &mod_ia
; break;
6469 case opEQ
: func
= &eq_ia_nova
; break;
6470 case opNE
: func
= &neq_ia_nova
; break;
6471 case opLT
: func
= <_ia_nova
; break;
6472 case opGT
: func
= >_ia_nova
; break;
6473 case opLE
: func
= &le_ia_nova
; break;
6474 case opGE
: func
= &ge_ia_nova
; break;
6475 case opMin
: func
= &min_ia_nova
; break;
6476 case opMax
: func
= &max_ia_nova
; break;
6477 case opBitAnd
: func
= &and_ia
; break;
6478 case opBitOr
: func
= &or_ia
; break;
6479 case opBitXor
: func
= &xor_ia
; break;
6480 case opShiftRight
: func
= &rightShift_ia
; break;
6481 case opShiftLeft
: func
= &leftShift_ia
; break;
6482 case opRound
: func
= &round_ia
; break;
6483 case opRoundUp
: func
= &roundUp_ia
; break;
6484 case opTrunc
: func
= &trunc_ia
; break;
6485 case opAtan2
: func
= &atan2_ia
; break;
6486 case opHypot
: func
= &hypot_ia
; break;
6487 case opHypotx
: func
= &hypotx_ia
; break;
6488 case opPow
: func
= &pow_ia_nova
; break;
6489 case opRing1
: func
= &ring1_ia
; break;
6490 case opRing2
: func
= &ring2_ia
; break;
6491 case opRing3
: func
= &ring3_ia
; break;
6492 case opRing4
: func
= &ring4_ia
; break;
6493 case opDifSqr
: func
= &difsqr_ia
; break;
6494 case opSumSqr
: func
= &sumsqr_ia
; break;
6495 case opSqrSum
: func
= &sqrsum_ia
; break;
6496 case opSqrDif
: func
= &sqrdif_ia
; break;
6497 case opAbsDif
: func
= &absdif_ia
; break;
6498 case opThresh
: func
= &thresh_ia
; break;
6499 case opAMClip
: func
= &amclip_ia
; break;
6500 case opScaleNeg
: func
= &scaleneg_ia
; break;
6501 case opClip2
: func
= &clip2_ia_nova
; break;
6502 case opFold2
: func
= &fold2_ia
; break;
6503 case opWrap2
: func
= &wrap2_ia
; break;
6504 case opExcess
: func
= &excess_ia
; break;
6505 //case opFirstArg : func = &firstarg_aa; break;
6506 //case opSecondArg : func = &secondarg_aa; break;
6507 default : func
= &add_ia
; break;
6510 // this should have been caught by mBufLength == 1
6521 bool ChooseOperatorFunc(BinaryOpUGen
*unit
)
6523 //Print("->ChooseOperatorFunc %d\n", unit->mSpecialIndex);
6524 BinaryOpFunc func
= &zero_aa
;
6527 if (BUFLENGTH
== 1) {
6528 if (unit
->mCalcRate
== calc_DemandRate
) {
6529 func
= ChooseDemandFunc(unit
);
6531 func
= ChooseOneSampleFunc(unit
);
6533 #if defined(NOVA_SIMD)
6534 } else if (!(BUFLENGTH
& 15)) {
6535 /* select normal function for initialization */
6536 func
= ChooseNormalFunc(unit
);
6539 /* select simd function */
6540 func
= ChooseNovaSimdFunc(unit
);
6544 func
= ChooseNormalFunc(unit
);
6546 unit
->mCalcFunc
= (UnitCalcFunc
)func
;
6547 //Print("<-ChooseOperatorFunc %p\n", func);
6548 //Print("calc %d\n", unit->mCalcRate);
6555 ////////////////////////////////////////////////////////////////////////////////////////////////////////
6558 PluginLoad(BinaryOp
)
6562 DefineSimpleUnit(BinaryOpUGen
);