1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2013 Academy of Motion Picture Arts and Sciences
3 // ("A.M.P.A.S."). Portions contributed by others as indicated.
4 // All rights reserved.
5 //
6 // A worldwide, royalty-free, non-exclusive right to copy, modify, create
7 // derivatives, and use, in source and binary forms, is hereby granted,
8 // subject to acceptance of this license. Performance of any of the
9 // aforementioned acts indicates acceptance to be bound by the following
10 // terms and conditions:
11 //
12 //  * Copies of source code, in whole or in part, must retain the
13 //    above copyright notice, this list of conditions and the
14 //    Disclaimer of Warranty.
15 //
16 //  * Use in binary form must retain the above copyright notice,
17 //    this list of conditions and the Disclaimer of Warranty in the
18 //    documentation and/or other materials provided with the distribution.
19 //
20 //  * Nothing in this license shall be deemed to grant any rights to
21 //    trademarks, copyrights, patents, trade secrets or any other
22 //    intellectual property of A.M.P.A.S. or any contributors, except
23 //    as expressly stated herein.
24 //
25 //  * Neither the name "A.M.P.A.S." nor the name of any other
26 //    contributors to this software may be used to endorse or promote
27 //    products derivative of or based on this software without express
28 //    prior written permission of A.M.P.A.S. or the contributors, as
29 //    appropriate.
30 //
31 // This license shall be construed pursuant to the laws of the State of
32 // California, and any disputes related thereto shall be subject to the
33 // jurisdiction of the courts therein.
34 //
35 // Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY A.M.P.A.S. AND
36 // CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
37 // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
38 // FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
39 // EVENT SHALL A.M.P.A.S., OR ANY CONTRIBUTORS OR DISTRIBUTORS, BE LIABLE
40 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, RESITUTIONARY,
41 // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
42 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
43 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
44 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
46 // THE POSSIBILITY OF SUCH DAMAGE.
47 //
48 // WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE ACADEMY
49 // SPECIFICALLY DISCLAIMS ANY REPRESENTATIONS OR WARRANTIES WHATSOEVER
50 // RELATED TO PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS IN THE ACADEMY
51 // COLOR ENCODING SYSTEM, OR APPLICATIONS THEREOF, HELD BY PARTIES OTHER
52 // THAN A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED.
53 ///////////////////////////////////////////////////////////////////////////
54 
55 //-----------------------------------------------------------------------------
56 //
57 //	A class that generates the function and data types needed
58 //	for the SIMD version of the CTL standard library.
59 //
60 //-----------------------------------------------------------------------------
61 
62 #include <CtlSimdStdTypes.h>
63 #include <CtlSymbolTable.h>
64 #include <CtlLContext.h>
65 
66 using namespace std;
67 
68 namespace Ctl {
69 
70 
SimdStdTypes(LContext & lcontext)71 SimdStdTypes::SimdStdTypes (LContext &lcontext): _lcontext (lcontext)
72 {
73     // empty
74 }
75 
76 
~SimdStdTypes()77 SimdStdTypes::~SimdStdTypes ()
78 {
79     // empty
80 }
81 
82 
83 DataTypePtr
type_v()84 SimdStdTypes::type_v ()
85 {
86     // void
87 
88     return _lcontext.newVoidType();
89 }
90 
91 
92 DataTypePtr
type_b()93 SimdStdTypes::type_b ()
94 {
95     // bool
96 
97     return _lcontext.newBoolType();
98 }
99 
100 
101 DataTypePtr
type_i()102 SimdStdTypes::type_i ()
103 {
104     // int
105 
106     return _lcontext.newIntType();
107 }
108 
109 
110 DataTypePtr
type_ui()111 SimdStdTypes::type_ui ()
112 {
113     // unsigned int
114 
115     return _lcontext.newUIntType();
116 }
117 
118 
119 DataTypePtr
type_h()120 SimdStdTypes::type_h ()
121 {
122     // unsigned int
123 
124     return _lcontext.newHalfType();
125 }
126 
127 
128 DataTypePtr
type_f()129 SimdStdTypes::type_f ()
130 {
131     // float
132 
133     return _lcontext.newFloatType();
134 }
135 
136 
137 DataTypePtr
type_s()138 SimdStdTypes::type_s ()
139 {
140     // string
141 
142     return _lcontext.newStringType();
143 }
144 
145 
146 DataTypePtr
type_i2()147 SimdStdTypes::type_i2 ()
148 {
149     // int[2]
150 
151     if (!_type_i2)
152 	_type_i2 = _lcontext.newArrayType (type_i(), 2);
153 
154     return _type_i2;
155 }
156 
157 
158 DataTypePtr
type_f2()159 SimdStdTypes::type_f2 ()
160 {
161     // float[2]
162 
163     if (!_type_f2)
164 	_type_f2 = _lcontext.newArrayType (type_f(), 2);
165 
166     return _type_f2;
167 }
168 
169 
170 DataTypePtr
type_f3()171 SimdStdTypes::type_f3 ()
172 {
173     // float[3]
174 
175     if (!_type_f3)
176 	_type_f3 = _lcontext.newArrayType (type_f(), 3);
177 
178     return _type_f3;
179 }
180 
181 
182 DataTypePtr
type_f33()183 SimdStdTypes::type_f33 ()
184 {
185     // float[3][3]
186 
187     if (!_type_f33)
188 	_type_f33 =
189 	    _lcontext.newArrayType (_lcontext.newArrayType (type_f(), 3), 3);
190 
191     return _type_f33;
192 }
193 
194 
195 DataTypePtr
type_f44()196 SimdStdTypes::type_f44 ()
197 {
198     // float[4][4]
199 
200     if (!_type_f44)
201 	_type_f44 =
202 	    _lcontext.newArrayType (_lcontext.newArrayType (type_f(), 4), 4);
203 
204     return _type_f44;
205 }
206 
207 
208 DataTypePtr
type_box2i()209 SimdStdTypes::type_box2i ()
210 {
211     // struct Box2i
212     // {
213     //     int min[2];
214     //     int max[2];
215     // };
216 
217     if (!_type_box2i)
218     {
219 	string structName =
220 	    _lcontext.symtab().getAbsoluteName ("Box2i");
221 
222 	MemberVector m;
223 	m.push_back (Member ("min", type_i2()));
224 	m.push_back (Member ("max", type_i2()));
225 
226 	_type_box2i = _lcontext.newStructType (structName, m);
227 	SymbolInfoPtr info = new SymbolInfo (0, RWA_NONE, true, _type_box2i);
228 	_lcontext.symtab().defineSymbol (structName, info);
229     }
230 
231     return _type_box2i;
232 }
233 
234 
235 DataTypePtr
type_box2f()236 SimdStdTypes::type_box2f ()
237 {
238     // struct Box2f
239     // {
240     //     float min[2];
241     //     float max[2];
242     // };
243 
244     if (!_type_box2f)
245     {
246 	string structName =
247 	    _lcontext.symtab().getAbsoluteName ("Box2f");
248 
249 	MemberVector m;
250 	m.push_back (Member ("min", type_f2()));
251 	m.push_back (Member ("max", type_f2()));
252 
253 	_type_box2f = _lcontext.newStructType (structName, m);
254 	SymbolInfoPtr info = new SymbolInfo (0, RWA_NONE, true, _type_box2f);
255 	_lcontext.symtab().defineSymbol (structName, info);
256     }
257 
258     return _type_box2f;
259 }
260 
261 
262 DataTypePtr
type_chr()263 SimdStdTypes::type_chr ()
264 {
265     // struct Chromaticities
266     // {
267     //     float red[2];
268     //     float green[2];
269     //     float blue[2];
270     //     float white[2];
271     // };
272 
273     if (!_type_chr)
274     {
275 	string structName =
276 	    _lcontext.symtab().getAbsoluteName ("Chromaticities");
277 
278 	MemberVector m;
279 	m.push_back (Member ("red", type_f2()));
280 	m.push_back (Member ("green", type_f2()));
281 	m.push_back (Member ("blue", type_f2()));
282 	m.push_back (Member ("white", type_f2()));
283 
284 	_type_chr = _lcontext.newStructType (structName, m);
285 	SymbolInfoPtr info = new SymbolInfo (0, RWA_NONE, true, _type_chr);
286 	_lcontext.symtab().defineSymbol (structName, info);
287     }
288 
289     return _type_chr;
290 }
291 
292 
293 FunctionTypePtr
funcType_v_b()294 SimdStdTypes::funcType_v_b ()
295 {
296     // void func (bool)
297 
298     if (!_funcType_v_b)
299     {
300 	ParamVector p;
301 	p.push_back (Param ("a1", type_b(), 0, RWA_READ, false));
302 	_funcType_v_b = _lcontext.newFunctionType (type_v(), false, p);
303     }
304 
305     return _funcType_v_b;
306 }
307 
308 
309 FunctionTypePtr
funcType_v_i()310 SimdStdTypes::funcType_v_i ()
311 {
312     // void func (int)
313 
314     if (!_funcType_v_i)
315     {
316 	ParamVector p;
317 	p.push_back (Param ("a1", type_i(), 0, RWA_READ, false));
318 	_funcType_v_i = _lcontext.newFunctionType (type_v(), false, p);
319     }
320 
321     return _funcType_v_i;
322 }
323 
324 
325 FunctionTypePtr
funcType_v_ui()326 SimdStdTypes::funcType_v_ui ()
327 {
328     // void func (unsigned int)
329 
330     if (!_funcType_v_ui)
331     {
332 	ParamVector p;
333 	p.push_back (Param ("a1", type_ui(), 0, RWA_READ, false));
334 	_funcType_v_ui = _lcontext.newFunctionType (type_v(), false, p);
335     }
336 
337     return _funcType_v_ui;
338 }
339 
340 
341 FunctionTypePtr
funcType_v_h()342 SimdStdTypes::funcType_v_h ()
343 {
344     // void func (half)
345 
346     if (!_funcType_v_h)
347     {
348 	ParamVector p;
349 	p.push_back (Param ("a1", type_h(), 0, RWA_READ, false));
350 	_funcType_v_h = _lcontext.newFunctionType (type_v(), false, p);
351     }
352 
353     return _funcType_v_h;
354 }
355 
356 
357 FunctionTypePtr
funcType_v_f()358 SimdStdTypes::funcType_v_f ()
359 {
360     // void func (float)
361 
362     if (!_funcType_v_f)
363     {
364 	ParamVector p;
365 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
366 	_funcType_v_f = _lcontext.newFunctionType (type_v(), false, p);
367     }
368 
369     return _funcType_v_f;
370 }
371 
372 
373 FunctionTypePtr
funcType_v_s()374 SimdStdTypes::funcType_v_s ()
375 {
376     // void func (string)
377 
378     if (!_funcType_v_s)
379     {
380 	ParamVector p;
381 	p.push_back (Param ("a1", type_s(), 0, RWA_READ, false));
382 	_funcType_v_s = _lcontext.newFunctionType (type_v(), false, p);
383     }
384 
385     return _funcType_v_s;
386 }
387 
388 
389 FunctionTypePtr
funcType_b_h()390 SimdStdTypes::funcType_b_h ()
391 {
392     // bool func (half)
393 
394     if (!_funcType_b_h)
395     {
396 	ParamVector p;
397 	p.push_back (Param ("a1", type_h(), 0, RWA_READ, false));
398 	_funcType_b_h = _lcontext.newFunctionType (type_b(), false, p);
399     }
400 
401     return _funcType_b_h;
402 }
403 
404 
405 FunctionTypePtr
funcType_b_f()406 SimdStdTypes::funcType_b_f ()
407 {
408     // bool func (float)
409 
410     if (!_funcType_b_f)
411     {
412 	ParamVector p;
413 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
414 	_funcType_b_f = _lcontext.newFunctionType (type_b(), false, p);
415     }
416 
417     return _funcType_b_f;
418 }
419 
420 
421 FunctionTypePtr
funcType_f_f()422 SimdStdTypes::funcType_f_f ()
423 {
424     // float func (float)
425 
426     if (!_funcType_f_f)
427     {
428 	ParamVector p;
429 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
430 	_funcType_f_f = _lcontext.newFunctionType (type_f(), false, p);
431     }
432 
433     return _funcType_f_f;
434 }
435 
436 
437 FunctionTypePtr
funcType_h_f()438 SimdStdTypes::funcType_h_f ()
439 {
440     // half func (float)
441 
442     if (!_funcType_h_f)
443     {
444 	ParamVector p;
445 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
446 	_funcType_h_f = _lcontext.newFunctionType (type_h(), false, p);
447     }
448 
449     return _funcType_h_f;
450 }
451 
452 
453 FunctionTypePtr
funcType_f_h()454 SimdStdTypes::funcType_f_h ()
455 {
456     // float func (half)
457 
458     if (!_funcType_f_h)
459     {
460 	ParamVector p;
461 	p.push_back (Param ("a1", type_h(), 0, RWA_READ, false));
462 	_funcType_f_h = _lcontext.newFunctionType (type_f(), false, p);
463     }
464 
465     return _funcType_f_h;
466 }
467 
468 
469 FunctionTypePtr
funcType_f_f_f()470 SimdStdTypes::funcType_f_f_f ()
471 {
472     // float func (float, float)
473 
474     if (!_funcType_f_f_f)
475     {
476 	ParamVector p;
477 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
478 	p.push_back (Param ("a2", type_f(), 0, RWA_READ, false));
479 	_funcType_f_f_f = _lcontext.newFunctionType (type_f(), false, p);
480     }
481 
482     return _funcType_f_f_f;
483 }
484 
485 
486 FunctionTypePtr
funcType_h_h_f()487 SimdStdTypes::funcType_h_h_f ()
488 {
489     // half func (half, float)
490 
491     if (!_funcType_h_h_f)
492     {
493 	ParamVector p;
494 	p.push_back (Param ("a1", type_h(), 0, RWA_READ, false));
495 	p.push_back (Param ("a2", type_f(), 0, RWA_READ, false));
496 	_funcType_h_h_f = _lcontext.newFunctionType (type_h(), false, p);
497     }
498 
499     return _funcType_h_h_f;
500 }
501 
502 
503 FunctionTypePtr
funcType_f33_f33()504 SimdStdTypes::funcType_f33_f33 ()
505 {
506     // float[3][3] func (float[3][3])
507 
508     if (!_funcType_f33_f33)
509     {
510 	ParamVector p;
511 	p.push_back (Param ("a1", type_f33(), 0, RWA_READ, false));
512 	_funcType_f33_f33 = _lcontext.newFunctionType (type_f33(), false, p);
513     }
514 
515     return _funcType_f33_f33;
516 }
517 
518 
519 FunctionTypePtr
funcType_f44_f44()520 SimdStdTypes::funcType_f44_f44 ()
521 {
522     // float[4][4] func (float[4][4])
523 
524     if (!_funcType_f44_f44)
525     {
526 	ParamVector p;
527 	p.push_back (Param ("a1", type_f44(), 0, RWA_READ, false));
528 	_funcType_f44_f44 = _lcontext.newFunctionType (type_f44(), false, p);
529     }
530 
531     return _funcType_f44_f44;
532 }
533 
534 
535 FunctionTypePtr
funcType_f33_f33_f33()536 SimdStdTypes::funcType_f33_f33_f33 ()
537 {
538     // float[3][3] func (float[3][3], float[3][3])
539 
540     if (!_funcType_f33_f33_f33)
541     {
542 	ParamVector p;
543 	p.push_back (Param ("a1", type_f33(), 0, RWA_READ, false));
544 	p.push_back (Param ("a2", type_f33(), 0, RWA_READ, false));
545 
546 	_funcType_f33_f33_f33 =
547 	    _lcontext.newFunctionType (type_f33(), false, p);
548     }
549 
550     return _funcType_f33_f33_f33;
551 }
552 
553 
554 FunctionTypePtr
funcType_f44_f44_f44()555 SimdStdTypes::funcType_f44_f44_f44 ()
556 {
557     // float[4][4] func (float[4][4], float[4][4])
558 
559     if (!_funcType_f44_f44_f44)
560     {
561 	ParamVector p;
562 	p.push_back (Param ("a1", type_f44(), 0, RWA_READ, false));
563 	p.push_back (Param ("a2", type_f44(), 0, RWA_READ, false));
564 
565 	_funcType_f44_f44_f44 =
566 	    _lcontext.newFunctionType (type_f44(), false, p);
567     }
568 
569     return _funcType_f44_f44_f44;
570 }
571 
572 
573 FunctionTypePtr
funcType_f33_f_f33()574 SimdStdTypes::funcType_f33_f_f33 ()
575 {
576     // float[3][3] func (float, float[3][3])
577 
578     if (!_funcType_f33_f_f33)
579     {
580 	ParamVector p;
581 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
582 	p.push_back (Param ("a2", type_f33(), 0, RWA_READ, false));
583 
584 	_funcType_f33_f_f33 =
585 	    _lcontext.newFunctionType (type_f33(), false, p);
586     }
587 
588     return _funcType_f33_f_f33;
589 }
590 
591 
592 FunctionTypePtr
funcType_f44_f_f44()593 SimdStdTypes::funcType_f44_f_f44 ()
594 {
595     // float[4][4] func (float, float[4][4])
596 
597     if (!_funcType_f44_f_f44)
598     {
599 	ParamVector p;
600 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
601 	p.push_back (Param ("a2", type_f44(), 0, RWA_READ, false));
602 
603 	_funcType_f44_f_f44 =
604 	    _lcontext.newFunctionType (type_f44(), false, p);
605     }
606 
607     return _funcType_f44_f_f44;
608 }
609 
610 
611 FunctionTypePtr
funcType_f3_f3_f33()612 SimdStdTypes::funcType_f3_f3_f33 ()
613 {
614     // float[3] func (float[3], float[3][3])
615 
616     if (!_funcType_f3_f3_f33)
617     {
618 	ParamVector p;
619 	p.push_back (Param ("a1", type_f3(), 0, RWA_READ, false));
620 	p.push_back (Param ("a2", type_f33(), 0, RWA_READ, false));
621 
622 	_funcType_f3_f3_f33 =
623 	    _lcontext.newFunctionType (type_f3(), false, p);
624     }
625 
626     return _funcType_f3_f3_f33;
627 }
628 
629 
630 FunctionTypePtr
funcType_f3_f3_f44()631 SimdStdTypes::funcType_f3_f3_f44 ()
632 {
633     // float[3] func (float[3], float[4][4])
634 
635     if (!_funcType_f3_f3_f44)
636     {
637 	ParamVector p;
638 	p.push_back (Param ("a1", type_f3(), 0, RWA_READ, false));
639 	p.push_back (Param ("a2", type_f44(), 0, RWA_READ, false));
640 
641 	_funcType_f3_f3_f44 =
642 	    _lcontext.newFunctionType (type_f3(), false, p);
643     }
644 
645     return _funcType_f3_f3_f44;
646 }
647 
648 
649 FunctionTypePtr
funcType_f3_f3_f3()650 SimdStdTypes::funcType_f3_f3_f3 ()
651 {
652     // float[3] func (float[3], float[3])
653 
654     if (!_funcType_f3_f3_f3)
655     {
656 	ParamVector p;
657 	p.push_back (Param ("a1", type_f3(), 0, RWA_READ, false));
658 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
659 
660 	_funcType_f3_f3_f3 =
661 	    _lcontext.newFunctionType (type_f3(), false, p);
662     }
663 
664     return _funcType_f3_f3_f3;
665 }
666 
667 
668 FunctionTypePtr
funcType_f3_f_f3()669 SimdStdTypes::funcType_f3_f_f3 ()
670 {
671     // float[3] func (float, float[3])
672 
673     if (!_funcType_f3_f_f3)
674     {
675 	ParamVector p;
676 	p.push_back (Param ("a1", type_f(), 0, RWA_READ, false));
677 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
678 
679 	_funcType_f3_f_f3 =
680 	    _lcontext.newFunctionType (type_f3(), false, p);
681     }
682 
683     return _funcType_f3_f_f3;
684 }
685 
686 
687 FunctionTypePtr
funcType_f_f3_f3()688 SimdStdTypes::funcType_f_f3_f3 ()
689 {
690     // float func (float[3], float[3])
691 
692     if (!_funcType_f_f3_f3)
693     {
694 	ParamVector p;
695 	p.push_back (Param ("a1", type_f3(), 0, RWA_READ, false));
696 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
697 
698 	_funcType_f_f3_f3 =
699 	    _lcontext.newFunctionType (type_f(), false, p);
700     }
701 
702     return _funcType_f_f3_f3;
703 }
704 
705 
706 FunctionTypePtr
funcType_f_f3()707 SimdStdTypes::funcType_f_f3 ()
708 {
709     // float func (float[3])
710 
711     if (!_funcType_f_f3)
712     {
713 	ParamVector p;
714 	p.push_back (Param ("a1", type_f3(), 0, RWA_READ, false));
715 
716 	_funcType_f_f3 =
717 	    _lcontext.newFunctionType (type_f(), false, p);
718     }
719 
720     return _funcType_f_f3;
721 }
722 
723 
724 FunctionTypePtr
funcType_f44_chr_f()725 SimdStdTypes::funcType_f44_chr_f ()
726 {
727     // float func (Chromaticities, float)
728 
729     if (!_funcType_f44_chr_f)
730     {
731 	ParamVector p;
732 	p.push_back (Param ("a1", type_chr(), 0, RWA_READ, false));
733 	p.push_back (Param ("a2", type_f(), 0, RWA_READ, false));
734 
735 	_funcType_f44_chr_f =
736 	    _lcontext.newFunctionType (type_f44(), false, p);
737     }
738 
739     return _funcType_f44_chr_f;
740 }
741 
742 
743 FunctionTypePtr
funcType_f_f0_f_f_f()744 SimdStdTypes::funcType_f_f0_f_f_f ()
745 {
746     // float func (float[], float, float, float)
747 
748     if (!_funcType_f_f0_f_f_f)
749     {
750 	SizeVector sizes;
751 	sizes.push_back (0);
752 
753 	DataTypePtr type_f0 =
754 	    _lcontext.newArrayType (type_f(), sizes, LContext::PARAMETER);
755 
756 	ParamVector p;
757 	p.push_back (Param ("a1", type_f0,  0, RWA_READ, false));
758 	p.push_back (Param ("a2", type_f(), 0, RWA_READ, false));
759 	p.push_back (Param ("a3", type_f(), 0, RWA_READ, false));
760 	p.push_back (Param ("a4", type_f(), 0, RWA_READ, false));
761 
762 	_funcType_f_f0_f_f_f =
763 	    _lcontext.newFunctionType (type_f(), false, p);
764     }
765 
766     return _funcType_f_f0_f_f_f;
767 }
768 
769 
770 FunctionTypePtr
funcType_f_f02_f()771 SimdStdTypes::funcType_f_f02_f ()
772 {
773     // float func (float[][2], float)
774 
775     if (!_funcType_f_f02_f)
776     {
777 	SizeVector sizes;
778 	sizes.push_back (0);
779 	sizes.push_back (2);
780 
781 	DataTypePtr type_f02 =
782 	    _lcontext.newArrayType (type_f(), sizes, LContext::PARAMETER);
783 
784 	ParamVector p;
785 	p.push_back (Param ("a1", type_f02,  0, RWA_READ, false));
786 	p.push_back (Param ("a2", type_f(), 0, RWA_READ, false));
787 
788 	_funcType_f_f02_f =
789 	    _lcontext.newFunctionType (type_f(), false, p);
790     }
791 
792     return _funcType_f_f02_f;
793 }
794 
795 
796 FunctionTypePtr
funcType_f3_f0003_f3_f3_f3()797 SimdStdTypes::funcType_f3_f0003_f3_f3_f3 ()
798 {
799     // float[3] func (float[][][][3], float[3], float[3], float[3])
800 
801     if (!_funcType_f3_f0003_f3_f3_f3)
802     {
803 	SizeVector sizes;
804 	sizes.push_back (0);
805 	sizes.push_back (0);
806 	sizes.push_back (0);
807 	sizes.push_back (3);
808 
809 	DataTypePtr type_f0003 =
810 	    _lcontext.newArrayType (type_f(), sizes, LContext::PARAMETER);
811 
812 	ParamVector p;
813 	p.push_back (Param ("a1", type_f0003, 0, RWA_READ, false));
814 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
815 	p.push_back (Param ("a3", type_f3(), 0, RWA_READ, false));
816 	p.push_back (Param ("a4", type_f3(), 0, RWA_READ, false));
817 
818 	_funcType_f3_f0003_f3_f3_f3 =
819 	    _lcontext.newFunctionType (type_f3(), false, p);
820     }
821 
822     return _funcType_f3_f0003_f3_f3_f3;
823 }
824 
825 
826 FunctionTypePtr
funcType_v_f0003_f3_f3_fff_offf()827 SimdStdTypes::funcType_v_f0003_f3_f3_fff_offf ()
828 {
829     // void func (float[][][][3], float[3], float[3],
830     //		  float, float, float,
831     //		  output float, output float, output float)
832 
833     if (!_funcType_v_f0003_f3_f3_fff_offf)
834     {
835 	SizeVector sizes;
836 	sizes.push_back (0);
837 	sizes.push_back (0);
838 	sizes.push_back (0);
839 	sizes.push_back (3);
840 
841 	DataTypePtr type_f0003 =
842 	    _lcontext.newArrayType (type_f(), sizes, LContext::PARAMETER);
843 
844 	ParamVector p;
845 	p.push_back (Param ("a1", type_f0003,  0, RWA_READ, false));
846 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
847 	p.push_back (Param ("a3", type_f3(), 0, RWA_READ, false));
848 	p.push_back (Param ("a4", type_f(), 0, RWA_READ, false));
849 	p.push_back (Param ("a5", type_f(), 0, RWA_READ, false));
850 	p.push_back (Param ("a6", type_f(), 0, RWA_READ, false));
851 	p.push_back (Param ("a7", type_f(), 0, RWA_WRITE, false));
852 	p.push_back (Param ("a8", type_f(), 0, RWA_WRITE, false));
853 	p.push_back (Param ("a9", type_f(), 0, RWA_WRITE, false));
854 
855 	_funcType_v_f0003_f3_f3_fff_offf =
856 	    _lcontext.newFunctionType (type_v(), false, p);
857     }
858 
859     return _funcType_v_f0003_f3_f3_fff_offf;
860 }
861 
862 
863 FunctionTypePtr
funcType_v_f0003_f3_f3_hhh_ohhh()864 SimdStdTypes::funcType_v_f0003_f3_f3_hhh_ohhh ()
865 {
866     // void func (float[][][][3], float[3], float[3],
867     //		  half, half, half,
868     //		  output half, output half, output half)
869 
870     if (!_funcType_v_f0003_f3_f3_hhh_ohhh)
871     {
872 	SizeVector sizes;
873 	sizes.push_back (0);
874 	sizes.push_back (0);
875 	sizes.push_back (0);
876 	sizes.push_back (3);
877 
878 	DataTypePtr type_f0003 =
879 	    _lcontext.newArrayType (type_f(), sizes, LContext::PARAMETER);
880 
881 	ParamVector p;
882 	p.push_back (Param ("a1", type_f0003, 0, RWA_READ, false));
883 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
884 	p.push_back (Param ("a3", type_f3(), 0, RWA_READ, false));
885 	p.push_back (Param ("a4", type_h(), 0, RWA_READ, false));
886 	p.push_back (Param ("a5", type_h(), 0, RWA_READ, false));
887 	p.push_back (Param ("a6", type_h(), 0, RWA_READ, false));
888 	p.push_back (Param ("a7", type_h(), 0, RWA_WRITE, false));
889 	p.push_back (Param ("a8", type_h(), 0, RWA_WRITE, false));
890 	p.push_back (Param ("a9", type_h(), 0, RWA_WRITE, false));
891 
892 	_funcType_v_f0003_f3_f3_hhh_ohhh =
893 	    _lcontext.newFunctionType (type_v(), false, p);
894     }
895 
896     return _funcType_v_f0003_f3_f3_hhh_ohhh;
897 }
898 
899 
900 FunctionTypePtr
funcType_v_f023_f3_f3_of0003()901 SimdStdTypes::funcType_v_f023_f3_f3_of0003 ()
902 {
903     // void func (float[][2][3], float[3], float[3], output float[][][][3])
904 
905     if (!_funcType_v_f023_f3_f3_of0003)
906     {
907 	SizeVector inSizes;
908 	inSizes.push_back (0);
909 	inSizes.push_back (2);
910 	inSizes.push_back (3);
911 
912 	DataTypePtr type_f023 =
913 	    _lcontext.newArrayType (type_f(), inSizes, LContext::PARAMETER);
914 
915 	SizeVector outSizes;
916 	outSizes.push_back (0);
917 	outSizes.push_back (0);
918 	outSizes.push_back (0);
919 	outSizes.push_back (3);
920 
921 	DataTypePtr type_f0003 =
922 	    _lcontext.newArrayType (type_f(), outSizes, LContext::PARAMETER);
923 
924 	ParamVector p;
925 	p.push_back (Param ("a1", type_f023, 0, RWA_READ, false));
926 	p.push_back (Param ("a2", type_f3(), 0, RWA_READ, false));
927 	p.push_back (Param ("a3", type_f3(), 0, RWA_READ, false));
928 	p.push_back (Param ("a4", type_f0003, 0, RWA_WRITE, false));
929 
930 	_funcType_v_f023_f3_f3_of0003 =
931 	    _lcontext.newFunctionType (type_v(), false, p);
932     }
933 
934     return _funcType_v_f023_f3_f3_of0003;
935 }
936 
937 
938 } // namespace Ctl
939