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"
27 #include "simd_memory.hpp"
28 #include "simd_binary_arithmetic.hpp"
29 #include "simd_ternary_arithmetic.hpp"
31 using nova::wrap_argument
;
33 #if defined(__GNUC__) && !defined(__clang__)
34 #define inline_functions __attribute__ ((flatten))
36 #define inline_functions
44 static InterfaceTable
*ft
;
46 //////////////////////////////////////////////////////////////////////////////////////////////////
51 struct MulAdd
: public Unit
53 float mPrevMul
, mPrevAdd
;
58 void MulAdd_Ctor(MulAdd
*unit
);
60 // mul add functions for every occasion:
61 void ampmix_k(MulAdd
*unit
, int inNumSamples
);
63 void ampmix_aa(MulAdd
*unit
, int inNumSamples
);
64 void ampmix_ak(MulAdd
*unit
, int inNumSamples
);
65 void ampmix_ai(MulAdd
*unit
, int inNumSamples
);
67 void ampmix_ka(MulAdd
*unit
, int inNumSamples
);
68 void ampmix_kk(MulAdd
*unit
, int inNumSamples
);
69 void ampmix_ki(MulAdd
*unit
, int inNumSamples
);
71 void ampmix_ia(MulAdd
*unit
, int inNumSamples
);
72 void ampmix_ik(MulAdd
*unit
, int inNumSamples
);
73 void ampmix_ii(MulAdd
*unit
, int inNumSamples
);
76 ////////////////////////////////////////////////////////////////////////////////////////////////////////
79 void ampmix_k(MulAdd
*unit
, int inNumSamples
);
80 void ampmix_k(MulAdd
*unit
, int inNumSamples
)
82 ZOUT0(0) = ZIN0(0) * MULIN
[0] + ADDIN
[0];
85 void ampmix_aa(MulAdd
*unit
, int inNumSamples
);
86 void ampmix_aa(MulAdd
*unit
, int inNumSamples
)
90 float *amp
= MULIN
- ZOFF
;
91 float *mix
= ADDIN
- ZOFF
;
93 LOOP1(inNumSamples
, ZXP(out
) = ZXP(amp
) * ZXP(in
) + ZXP(mix
); );
96 void ampmix_ak(MulAdd
*unit
, int inNumSamples
);
97 void ampmix_ak(MulAdd
*unit
, int inNumSamples
)
100 float *out
= ZOUT(0);
101 float *amp
= MULIN
- ZOFF
;
103 float mix_cur
= unit
->mPrevAdd
;
104 float nextMix
= ADDIN
[0];
105 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
106 if (mix_slope
== 0.f
) {
107 if (mix_cur
== 0.f
) {
108 LOOP1(inNumSamples
, ZXP(out
) = ZXP(amp
) * ZXP(in
); );
110 LOOP1(inNumSamples
, ZXP(out
) = ZXP(amp
) * ZXP(in
) + mix_cur
; );
113 LOOP1(inNumSamples
, ZXP(out
) = ZXP(amp
) * ZXP(in
) + mix_cur
; mix_cur
+= mix_slope
; );
114 unit
->mPrevAdd
= nextMix
;
118 void ampmix_ai(MulAdd
*unit
, int inNumSamples
);
119 void ampmix_ai(MulAdd
*unit
, int inNumSamples
)
122 float *out
= ZOUT(0);
123 float *amp
= MULIN
- ZOFF
;
124 float mix_cur
= unit
->mPrevAdd
;
126 LOOP1(inNumSamples
, ZXP(out
) = ZXP(amp
) * ZXP(in
) + mix_cur
; );
129 void ampmix_ka(MulAdd
*unit
, int inNumSamples
);
130 void ampmix_ka(MulAdd
*unit
, int inNumSamples
)
133 float *out
= ZOUT(0);
134 float *mix
= ADDIN
- ZOFF
;
135 float amp_cur
= unit
->mPrevMul
;
136 float nextAmp
= MULIN
[0];
137 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
139 if (amp_slope
== 0.f
) {
140 if (amp_cur
== 0.f
) {
141 ZCopy(inNumSamples
, out
, mix
);
142 } else if (amp_cur
== 1.f
) {
143 LOOP1(inNumSamples
, ZXP(out
) = ZXP(in
) + ZXP(mix
); );
145 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + ZXP(mix
); );
148 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + ZXP(mix
); amp_cur
+= amp_slope
; );
149 unit
->mPrevMul
= nextAmp
;
153 void ampmix_kk(MulAdd
*unit
, int inNumSamples
);
154 void ampmix_kk(MulAdd
*unit
, int inNumSamples
)
157 float *out
= ZOUT(0);
159 float amp_cur
= unit
->mPrevMul
;
160 float nextAmp
= MULIN
[0];
161 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
162 float mix_cur
= unit
->mPrevAdd
;
163 float nextMix
= ADDIN
[0];
164 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
166 if (amp_slope
== 0.f
) {
167 if (mix_slope
== 0.f
) {
168 if (mix_cur
== 0.f
) {
169 if (amp_cur
== 1.f
) {
171 } else if (amp_cur
== 0.f
) {
172 ZClear(inNumSamples
, out
);
174 LOOP1(inNumSamples
, ZXP(out
) = ZXP(in
) * amp_cur
;);
177 if (amp_cur
== 1.f
) {
178 LOOP1(inNumSamples
, ZXP(out
) = ZXP(in
) + mix_cur
;);
179 } else if (amp_cur
== 0.f
) {
180 LOOP1(inNumSamples
, ZXP(out
) = mix_cur
;);
182 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; );
186 if (amp_cur
== 1.f
) {
187 LOOP1(inNumSamples
, ZXP(out
) = ZXP(in
) + mix_cur
; mix_cur
+= mix_slope
;);
188 } else if (amp_cur
== 0.f
) {
189 LOOP1(inNumSamples
, ZXP(out
) = mix_cur
; mix_cur
+= mix_slope
;);
191 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; mix_cur
+= mix_slope
; );
193 unit
->mPrevAdd
= nextMix
;
196 if (mix_slope
== 0.f
) {
197 if (mix_cur
== 0.f
) {
198 LOOP1(inNumSamples
, ZXP(out
) = ZXP(in
) * amp_cur
; amp_cur
+= amp_slope
; );
200 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; amp_cur
+= amp_slope
; );
203 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; amp_cur
+= amp_slope
; mix_cur
+= mix_slope
; );
204 unit
->mPrevAdd
= nextMix
;
206 unit
->mPrevMul
= nextAmp
;
210 void ampmix_ki(MulAdd
*unit
, int inNumSamples
);
211 void ampmix_ki(MulAdd
*unit
, int inNumSamples
)
214 float *out
= ZOUT(0);
216 float amp_cur
= unit
->mPrevMul
;
217 float nextAmp
= MULIN
[0];
218 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
219 float mix_cur
= unit
->mPrevAdd
;
220 //postbuf("ampmix_ki %p %g %g\n", out, amp_cur, mix_cur);
222 if (amp_slope
== 0.f
) {
223 if (amp_cur
== 1.f
) {
224 LOOP1(inNumSamples
, ZXP(out
) = ZXP(in
) + mix_cur
;);
225 } else if (amp_cur
== 0.f
) {
226 LOOP1(inNumSamples
, ZXP(out
) = mix_cur
;);
228 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; );
231 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; amp_cur
+= amp_slope
; );
232 unit
->mPrevMul
= nextAmp
;
236 void ampmix_ia(MulAdd
*unit
, int inNumSamples
);
237 void ampmix_ia(MulAdd
*unit
, int inNumSamples
)
240 float *out
= ZOUT(0);
241 float *mix
= ADDIN
- ZOFF
;
242 float amp_cur
= unit
->mPrevMul
;
248 vscalarmul(in
, amp_cur
, in
, inNumSamples
);
249 vadd(out
, in
, mix
, inNumSamples
);
251 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + ZXP(mix
); );
256 void ampmix_ik(MulAdd
*unit
, int inNumSamples
);
257 void ampmix_ik(MulAdd
*unit
, int inNumSamples
)
260 float *out
= ZOUT(0);
262 float amp_cur
= unit
->mPrevMul
;
263 float mix_cur
= unit
->mPrevAdd
;
264 float nextMix
= ADDIN
[0];
265 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
267 if (mix_slope
== 0.f
) {
268 if (mix_cur
== 0.f
) {
269 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
); );
271 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; );
274 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; mix_cur
+= mix_slope
; );
275 unit
->mPrevAdd
= nextMix
;
279 void ampmix_ii(MulAdd
*unit
, int inNumSamples
);
280 void ampmix_ii(MulAdd
*unit
, int inNumSamples
)
283 float *out
= ZOUT(0);
285 float amp_cur
= unit
->mPrevMul
;
286 float mix_cur
= unit
->mPrevAdd
;
287 LOOP1(inNumSamples
, ZXP(out
) = amp_cur
* ZXP(in
) + mix_cur
; );
291 inline_functions
void ampmix_aa_nova(MulAdd
*unit
, int inNumSamples
)
293 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
294 wrap_argument(ADDIN
), inNumSamples
);
297 inline_functions
void ampmix_aa_nova_64(MulAdd
*unit
, int inNumSamples
)
299 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
), wrap_argument(ADDIN
));
302 inline_functions
void ampmix_ak_nova(MulAdd
*unit
, int inNumSamples
)
304 float mix_cur
= unit
->mPrevAdd
;
305 float nextMix
= ADDIN
[0];
306 if (nextMix
== mix_cur
) {
308 nova::times_vec_simd(OUT(0), IN(0), MULIN
, inNumSamples
);
310 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
311 wrap_argument(mix_cur
), inNumSamples
);
313 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
314 unit
->mPrevAdd
= nextMix
;
315 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
316 wrap_argument(mix_cur
, mix_slope
),inNumSamples
);
320 inline_functions
void ampmix_ak_nova_64(MulAdd
*unit
, int inNumSamples
)
322 float mix_cur
= unit
->mPrevAdd
;
323 float nextMix
= ADDIN
[0];
324 if (nextMix
== mix_cur
) {
326 nova::times_vec_simd
<64>(OUT(0), IN(0), MULIN
);
328 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
329 wrap_argument(mix_cur
));
331 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
332 unit
->mPrevAdd
= nextMix
;
333 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
334 wrap_argument(mix_cur
, mix_slope
));
338 inline_functions
void ampmix_ai_nova(MulAdd
*unit
, int inNumSamples
)
340 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
341 wrap_argument(unit
->mPrevAdd
), inNumSamples
);
344 inline_functions
void ampmix_ai_nova_64(MulAdd
*unit
, int inNumSamples
)
346 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(MULIN
),
347 wrap_argument(unit
->mPrevAdd
));
350 inline_functions
void ampmix_ka_nova(MulAdd
*unit
, int inNumSamples
)
352 float amp_cur
= unit
->mPrevMul
;
353 float nextAmp
= MULIN
[0];
355 if (amp_cur
== nextAmp
) {
357 nova::copyvec_simd(OUT(0), ADDIN
, inNumSamples
);
358 else if (amp_cur
== 1.f
)
359 nova::plus_vec_simd(OUT(0), IN(0), ADDIN
, inNumSamples
);
361 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
362 wrap_argument(ADDIN
), inNumSamples
);
364 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
365 unit
->mPrevMul
= nextAmp
;
366 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
, amp_slope
),
367 wrap_argument(ADDIN
), inNumSamples
);
371 inline_functions
void ampmix_ka_nova_64(MulAdd
*unit
, int inNumSamples
)
373 float amp_cur
= unit
->mPrevMul
;
374 float nextAmp
= MULIN
[0];
376 if (amp_cur
== nextAmp
) {
378 nova::copyvec_simd
<64>(OUT(0), ADDIN
);
379 else if (amp_cur
== 1.f
)
380 nova::plus_vec_simd
<64>(OUT(0), IN(0), ADDIN
);
382 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
383 wrap_argument(ADDIN
));
385 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
386 unit
->mPrevMul
= nextAmp
;
387 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
, amp_slope
),
388 wrap_argument(ADDIN
));
392 inline_functions
void ampmix_kk_nova(MulAdd
*unit
, int inNumSamples
)
394 float amp_cur
= unit
->mPrevMul
;
395 float nextAmp
= MULIN
[0];
396 float mix_cur
= unit
->mPrevAdd
;
397 float nextMix
= ADDIN
[0];
399 if (nextAmp
== amp_cur
) {
400 if (nextMix
== mix_cur
) {
401 if (mix_cur
== 0.f
) {
402 if (amp_cur
== 1.f
) {
404 } else if (amp_cur
== 0.f
)
405 nova::zerovec_simd(OUT(0), inNumSamples
);
407 nova::times_vec_simd(OUT(0), IN(0), amp_cur
, inNumSamples
);
410 nova::plus_vec_simd(OUT(0), IN(0), mix_cur
, inNumSamples
);
411 else if (amp_cur
== 0.f
)
412 nova::setvec_simd(OUT(0), mix_cur
, inNumSamples
);
414 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
415 wrap_argument(mix_cur
), inNumSamples
);
418 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
420 nova::plus_vec_simd(OUT(0), IN(0), mix_cur
, mix_slope
, inNumSamples
);
421 else if (amp_cur
== 0.f
)
422 nova::set_slope_vec_simd(OUT(0), mix_cur
, mix_slope
, inNumSamples
);
424 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
425 wrap_argument(mix_cur
, mix_slope
), inNumSamples
);
426 unit
->mPrevAdd
= nextMix
;
429 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
430 if (nextMix
== mix_cur
) {
432 nova::times_vec_simd(OUT(0), IN(0), amp_cur
, amp_slope
, inNumSamples
);
434 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
, amp_slope
),
435 wrap_argument(mix_cur
), inNumSamples
);
437 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
438 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
, amp_slope
),
439 wrap_argument(mix_cur
, mix_slope
), inNumSamples
);
440 unit
->mPrevAdd
= nextMix
;
442 unit
->mPrevMul
= nextAmp
;
446 inline_functions
void ampmix_ki_nova(MulAdd
*unit
, int inNumSamples
)
448 float amp_cur
= unit
->mPrevMul
;
449 float nextAmp
= MULIN
[0];
450 float mix_cur
= unit
->mPrevAdd
;
452 if (nextAmp
== amp_cur
) {
454 nova::plus_vec_simd(OUT(0), IN(0), mix_cur
, inNumSamples
);
455 else if (amp_cur
== 0.f
)
456 nova::setvec_simd(OUT(0), mix_cur
, inNumSamples
);
458 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
459 wrap_argument(mix_cur
), inNumSamples
);
461 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
462 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
, amp_slope
),
463 wrap_argument(mix_cur
), inNumSamples
);
464 unit
->mPrevMul
= nextAmp
;
468 inline_functions
void ampmix_ki_nova_64(MulAdd
*unit
, int inNumSamples
)
470 float amp_cur
= unit
->mPrevMul
;
471 float nextAmp
= MULIN
[0];
472 float mix_cur
= unit
->mPrevAdd
;
474 if (nextAmp
== amp_cur
) {
476 nova::plus_vec_simd
<64>(OUT(0), IN(0), mix_cur
);
477 else if (amp_cur
== 0.f
)
478 nova::setvec_simd
<64>(OUT(0), mix_cur
);
480 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
481 wrap_argument(mix_cur
));
483 float amp_slope
= CALCSLOPE(nextAmp
, amp_cur
);
484 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
, amp_slope
),
485 wrap_argument(mix_cur
));
486 unit
->mPrevMul
= nextAmp
;
490 inline_functions
void ampmix_ia_nova(MulAdd
*unit
, int inNumSamples
)
492 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(unit
->mPrevMul
),
493 wrap_argument(ADDIN
), inNumSamples
);
496 inline_functions
void ampmix_ia_nova_64(MulAdd
*unit
, int inNumSamples
)
498 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(unit
->mPrevMul
),
499 wrap_argument(ADDIN
));
502 inline_functions
void ampmix_ik_nova(MulAdd
*unit
, int inNumSamples
)
504 float amp_cur
= unit
->mPrevMul
;
505 float mix_cur
= unit
->mPrevAdd
;
506 float nextMix
= ADDIN
[0];
508 if (nextMix
== mix_cur
) {
510 nova::times_vec_simd(OUT(0), IN(0), amp_cur
, inNumSamples
);
512 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
513 wrap_argument(mix_cur
), inNumSamples
);
515 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
516 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
517 wrap_argument(mix_cur
, mix_slope
), inNumSamples
);
518 unit
->mPrevAdd
= nextMix
;
522 inline_functions
void ampmix_ik_nova_64(MulAdd
*unit
, int inNumSamples
)
524 float amp_cur
= unit
->mPrevMul
;
525 float mix_cur
= unit
->mPrevAdd
;
526 float nextMix
= ADDIN
[0];
528 if (nextMix
== mix_cur
) {
530 nova::times_vec_simd
<64>(OUT(0), IN(0), amp_cur
);
532 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
), wrap_argument(mix_cur
));
534 float mix_slope
= CALCSLOPE(nextMix
, mix_cur
);
535 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(amp_cur
),
536 wrap_argument(mix_cur
, mix_slope
));
537 unit
->mPrevAdd
= nextMix
;
541 inline_functions
void ampmix_ii_nova(MulAdd
*unit
, int inNumSamples
)
543 nova::muladd_vec_simd(OUT(0), wrap_argument(IN(0)), wrap_argument(unit
->mPrevMul
),
544 wrap_argument(unit
->mPrevAdd
), inNumSamples
);
547 inline_functions
void ampmix_ii_nova_64(MulAdd
*unit
, int inNumSamples
)
549 nova::muladd_vec_simd
<64>(OUT(0), wrap_argument(IN(0)), wrap_argument(unit
->mPrevMul
),
550 wrap_argument(unit
->mPrevAdd
));
558 ////////////////////////////////////////////////////////////////////////////////////////////////////////
560 void MulAdd_Ctor(MulAdd
*unit
)
562 if (unit
->mCalcRate
!= calc_FullRate
) {
563 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_k
;
568 unit
->mPrevMul
= ZIN0(1);
569 unit
->mPrevAdd
= ZIN0(2);
571 int mulRate
= INRATE(1);
572 int addRate
= INRATE(2);
574 //Print("muladd %d %d %g %g\n", mulRate, addRate, unit->mPrevMul, unit->mPrevAdd);
575 //Print("**** %p %p %p %p\n", IN(0), IN(1), IN(2), OUT(0));
578 #if defined (NOVA_SIMD)
579 if ((BUFLENGTH
& 15))
586 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_aa
;
589 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ak
;
591 case calc_ScalarRate
:
592 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ai
;
599 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ka
;
602 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_kk
;
604 case calc_ScalarRate
:
605 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ki
;
609 case calc_ScalarRate
:
612 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ia
;
615 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ik
;
617 case calc_ScalarRate
:
618 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ii
;
624 #if defined (NOVA_SIMD)
626 if (BUFLENGTH
== 64) {
631 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_aa_nova_64
;
634 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ak_nova_64
;
636 case calc_ScalarRate
:
637 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ai_nova_64
;
644 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ka_nova_64
;
647 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_kk_nova
;
649 case calc_ScalarRate
:
650 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ki_nova_64
;
654 case calc_ScalarRate
:
657 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ia_nova_64
;
660 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ik_nova_64
;
662 case calc_ScalarRate
:
663 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ii_nova_64
;
673 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_aa_nova
;
676 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ak_nova
;
678 case calc_ScalarRate
:
679 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ai_nova
;
686 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ka_nova
;
689 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_kk_nova
;
691 case calc_ScalarRate
:
692 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ki_nova
;
696 case calc_ScalarRate
:
699 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ia_nova
;
702 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ik_nova
;
704 case calc_ScalarRate
:
705 unit
->mCalcFunc
= (UnitCalcFunc
)&mix_ii_nova
;
717 ////////////////////////////////////////////////////////////////////////////////////////////////////////
723 DefineSimpleUnit(MulAdd
);