drd/tests/swapcontext: Improve the portability of this test further
[valgrind.git] / none / tests / ppc32 / testVMX.c
blobd8d9de621705148ef4258dbb303c294b2d10a41a
2 /* HOW TO COMPILE:
4 gcc -O -g -Wall -maltivec -mabi=altivec -DALTIVEC -DGCC_COMPILER
5 testVMX.c -o testVMX
7 */
9 /*
10 * testVMX - A test program to check the correctness of VMX instructions
12 * Copyright (C) 2004 CEPBA-IBM Research Institute
14 * Authors: Jose Maria Cela, Raul de la Cruz,
15 * Rogeli Grima, Xavier Saez <blade_support@ciri.upc.es>
17 * Web page: http://www.ciri.upc.es/cela_pblade/
19 * This file is part of testVMX.
21 * testVMX is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or
24 * (at your option) any later version.
26 * testVMX is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with testVMX; if not, see <http://www.gnu.org/licenses/>.
36 * Version 0.2.2 2004/09/02
37 * Removed some not useful flags for compilation and changed the GPL license
38 * header updating the contact email and adding the web page URL
40 * Version 0.2.1 2004/07/07
41 * Some flags added in Makefile for XLC compilation (-qalias, -qinline)
43 * Version 0.2 2004/07/02
44 * Makefile and testVMX.c patched to compile with SLES 9 (Linux - GCC 3.3.3),
45 * IBM XLC Enterprise Edition and MacOS X 10.3 (Darwin - GCC 3.3)
47 * Version 0.1 2004/03/05
48 * First public version release
52 #include <stdio.h>
53 #include <stdlib.h>
54 #include <math.h>
55 #include <limits.h>
56 #include <string.h>
58 /* Calloc for align data to 16 bytes boundaries */
60 /* ----------- BEGIN #include "memoryVector.h" ----------- */
63 * testVMX - A test program to check the correctness of VMX instructions
65 * Copyright (C) 2004 CEPBA-IBM Research Institute
67 * Authors: Jose Maria Cela, Raul de la Cruz,
68 * Rogeli Grima, Xavier Saez <blade_support@ciri.upc.es>
70 * Web page: http://www.ciri.upc.es/cela_pblade/
72 * This file is part of testVMX.
74 * testVMX is free software; you can redistribute it and/or modify
75 * it under the terms of the GNU General Public License as published by
76 * the Free Software Foundation; either version 2 of the License, or
77 * (at your option) any later version.
79 * testVMX is distributed in the hope that it will be useful,
80 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82 * GNU General Public License for more details.
84 * You should have received a copy of the GNU General Public License
85 * along with testVMX; if not, see <http://www.gnu.org/licenses/>.
88 #ifndef MEMORY_VECTOR_H
89 # define MEMORY_VECTOR_H
91 # include <stdlib.h>
93 void *calloc_vec( size_t nmemb, size_t size );
94 void free_vec( void *ptr );
96 #endif
98 /* ----------- END #include "memoryVector.h" ----------- */
100 /* ----------- BEGIN #include "memoryVector.c" ----------- */
103 * testVMX - A test program to check the correctness of VMX instructions
105 * Copyright (C) 2004 CEPBA-IBM Research Institute
107 * Authors: Jose Maria Cela, Raul de la Cruz,
108 * Rogeli Grima, Xavier Saez <blade_support@ciri.upc.es>
110 * Web page: http://www.ciri.upc.es/cela_pblade/
112 * This file is part of testVMX.
114 * testVMX is free software; you can redistribute it and/or modify
115 * it under the terms of the GNU General Public License as published by
116 * the Free Software Foundation; either version 2 of the License, or
117 * (at your option) any later version.
119 * testVMX is distributed in the hope that it will be useful,
120 * but WITHOUT ANY WARRANTY; without even the implied warranty of
121 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
122 * GNU General Public License for more details.
124 * You should have received a copy of the GNU General Public License
125 * along with testVMX; if not, see <http://www.gnu.org/licenses/>.
128 #include <stdio.h>
129 #include <string.h>
130 /* #include "memoryVector.h"*/
132 typedef struct
134 char *realAdd;
135 char *returnAdd;
136 } Tmemtab;
139 static Tmemtab *memTab = NULL;
140 static size_t nadd = 0;
141 static size_t MAX_N_ADD = 100;
144 void *calloc_vec( size_t nmemb, size_t size )
146 /* ---------------------------------------------------------- Local Variables */
147 char *realadd;
148 char *retadd;
149 size_t nbytes, cc, rr;
151 /* -------------------------------------------------------------------- BEGIN */
152 if (memTab == (Tmemtab*)NULL)
154 memTab = (Tmemtab *) malloc( MAX_N_ADD*sizeof(Tmemtab) );
155 if (memTab == (Tmemtab*)NULL)
157 fprintf(stderr, "\n------------ FATAL ERRROR ------------------\n");
158 fprintf(stderr, "Memory table out of memory\n");
159 return NULL;
163 /* 16 extra bytes are allocated for adjust alignement */
164 nbytes = (size*nmemb)+16;
166 /* Alloc a block of 'nbytes' */
167 realadd = (char *) malloc( nbytes );
168 if (realadd == (char *)NULL)
170 fprintf(stderr, "\n------------ FATAL ERRROR ------------------\n");
171 fprintf(stderr, "Out of memory\n");
172 return NULL;
175 memset( realadd, 0, nbytes );
177 cc = ((size_t)realadd)/16;
178 rr = ((size_t)realadd)%16;
179 if (rr == 0)
180 retadd = realadd;
181 else
182 retadd = (char *)((cc+1)*16);
184 if (nadd == MAX_N_ADD)
186 MAX_N_ADD += 100;
187 memTab = (Tmemtab*) realloc( memTab, MAX_N_ADD*sizeof(Tmemtab) );
188 if (memTab == (Tmemtab*)NULL)
190 free( realadd );
191 fprintf(stderr, "\n------------ FATAL ERRROR ------------------\n");
192 fprintf(stderr, "Memory table out of memory\n");
193 return NULL;
197 memTab[nadd].realAdd = realadd;
198 memTab[nadd].returnAdd = retadd;;
199 nadd++;
201 return (void*)retadd;
202 /* ---------------------------------------------------------------------- END */
206 void free_vec( void *ptr )
208 /* ---------------------------------------------------------- Local Variables */
209 int ii, pos;
211 /* -------------------------------------------------------------------- BEGIN */
212 pos = -1;
213 for (ii= 0; ii< nadd; ii++)
214 if (memTab[ii].returnAdd == ptr)
216 pos = ii;
217 break;
220 if (pos == -1)
222 fprintf(stderr, "\n------------ WARNING ------------------------\n");
223 fprintf(stderr, "Pointer not found in memory table\n\n");
225 else
227 free( memTab[ii].realAdd );
229 for (ii= pos+1; ii< nadd; ii++)
230 memTab[ii-1] = memTab[ii];
231 nadd--;
233 if (nadd == 0)
235 free( memTab );
236 memTab = NULL;
237 MAX_N_ADD = 100;
240 /* ---------------------------------------------------------------------- END */
244 /* ----------- END #include "memoryVector.c" ----------- */
247 #ifdef ALTIVEC
248 # ifdef GCC_COMPILER
249 # include <altivec.h>
250 # endif
254 //#define TEST_FLOATS
258 /* Redefinition for undefined NAN and xlC compiling C++ code */
259 # if !defined(NAN) || ( defined(__IBMCPP__) && defined(XLC_COMPILER) )
260 # undef NAN
261 # define NAN 0x7FC00000
262 /* # define NAN 0xFFFA5A5A
263 * # define NAN 0x80000000
264 * # define NAN 0x00008000
266 # endif
269 int part1( );
270 int part2( );
271 int part3( );
272 int part4( );
273 int part5( );
276 typedef union
278 vector signed char v;
279 signed char e[16];
280 } TvecChar;
282 typedef union
284 vector unsigned char v;
285 unsigned char e[16];
286 } TvecUChar;
288 typedef union
290 vector bool char v;
291 unsigned char e[16];
292 } TvecBChar;
294 typedef union
296 vector signed short v;
297 signed short e[8];
298 } TvecShort;
300 typedef union
302 vector unsigned short v;
303 unsigned short e[8];
304 } TvecUShort;
306 typedef union
308 vector bool short v;
309 unsigned short e[8];
310 } TvecBShort;
312 typedef union
314 vector signed int v;
315 signed int e[4];
316 } TvecInt;
318 typedef union
320 vector unsigned int v;
321 unsigned int e[4];
322 } TvecUInt;
324 typedef union
326 vector bool int v;
327 unsigned int e[4];
328 } TvecBInt;
330 #if defined TEST_FLOATS
331 typedef union
333 vector float v;
334 float e[4];
335 signed int i[4];
336 } TvecFloat;
337 #endif
339 /* Scalar bool types declaration */
340 typedef unsigned char TboolChar;
341 typedef unsigned short TboolShort;
342 typedef unsigned int TboolInt;
344 #endif
351 /**********************************************************************
352 Main()
353 **********************************************************************/
357 int main()
359 TvecChar Caux1, Caux2, Caux3;//, Caux4;
360 TvecUChar UCaux1, UCaux2, UCaux3;//, UCaux4;
361 TvecBChar BCaux1;//, BCaux2, BCaux3, BCaux4;
362 TvecShort Saux1, Saux2, Saux3;//, Saux4;
363 TvecUShort USaux1, USaux2, USaux3;//, USaux4;
364 TvecBShort BSaux1;//, BSaux2, BSaux3, BSaux4;
365 TvecInt Iaux1, Iaux2, Iaux3;//, Iaux4;
366 TvecUInt UIaux1, UIaux2, UIaux3;//, UIaux4;
367 TvecBInt BIaux1;//, BIaux2, BIaux3, BIaux4;
368 #if defined TEST_FLOATS
369 TvecFloat Faux1, Faux2, Faux3;//, Faux4;
370 #endif
372 int i, err, j;//, b, bAux;
373 #if defined TEST_FLOATS
374 int b;
375 signed int Ivec1, Ivec2, Ivec3;
376 #endif
378 // unsigned char *UCvec1;
379 // signed short *Svec1;
380 // unsigned short *USvec1;
381 // unsigned int *UIvec1;
382 #if defined TEST_FLOATS
383 // float *Fvec1;
384 #endif
386 /* For saturated rutines */
387 // long long int LLaux;
389 signed char Caux;
390 unsigned char UCaux;
391 signed short Saux;
392 unsigned short USaux;
393 signed int Iaux;//, I1, I2;
394 unsigned int UIaux;//, UI1, UI2;
395 #if defined TEST_FLOATS
396 float Faux;
397 #endif
399 /* Scalar bool types definition */
400 TboolChar BCaux;
401 TboolShort BSaux;
402 TboolInt BIaux;
405 union
407 float f;
408 signed int si;
409 unsigned int ui;
410 signed short ss[2];
411 unsigned short us[2];
412 signed char sc[4];
413 unsigned char uc[4];
414 } INTunion1, INTunion2;
416 union
418 signed short ss;
419 unsigned short us;
420 signed char sc[2];
421 unsigned char uc[2];
422 } SHOunion1, SHOunion2;
425 #if defined (GCC_COMPILER)
426 vector signed char Ccons1 = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
427 vector signed char Ccons2 = (vector signed char){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
428 vector signed char Ccons3 = (vector signed char){-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127};
429 vector unsigned char UCcons1 = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7};
430 vector unsigned char UCcons2 = (vector unsigned char){2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
431 vector unsigned char UCcons3 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
432 vector signed short Scons1 = (vector signed short){-4, -3, -2, -1, 0, 1, 2, 3};
433 vector signed short Scons2 = (vector signed short){-32768, 10000, 1, 1, 1, 1, -10000, -10000};
434 vector signed short Scons3 = (vector signed short){-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767};
435 vector unsigned short UScons1 = (vector unsigned short){65532, 65533, 65534, 65535, 0, 1, 2, 3};
436 vector unsigned short UScons2 = (vector unsigned short){1, 1, 1, 1, 1, 1, 1, 1};
437 vector unsigned short UScons3 = (vector unsigned short){1, 2, 3, 4, 1, 2, 3, 4};
438 vector signed int Icons1 = (vector signed int){-4, -1, 1, 4};
439 vector signed int Icons2 = (vector signed int){1, 1, 1, 1};
440 vector signed int Icons3 = (vector signed int){0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF};
441 vector unsigned int UIcons1 = (vector unsigned int){0xFFFFFFFE, 0xFFFFFFFF, 0, 1};
442 vector unsigned int UIcons2 = (vector unsigned int){1, 1, 1, 1};
443 vector unsigned int UIcons3 = (vector unsigned int){1, 2, 1, 2};
445 #if defined TEST_FLOATS
446 vector float Fcons1 = (vector float){-1.5, 1.0, 0.5, -3.999};
447 vector float Fcons2 = (vector float){1.0, 1.0, 1.0, 1.0};
448 vector float Fcons3 = (vector float){100000000000.0, 1.0, -1.0, -1234567890.0};
449 #endif
451 #elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
452 vector signed char Ccons1 = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
453 vector signed char Ccons2 = (vector signed char)(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
454 vector signed char Ccons3 = (vector signed char)(-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127);
455 vector unsigned char UCcons1 = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7);
456 vector unsigned char UCcons2 = (vector unsigned char)(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
457 vector unsigned char UCcons3 = (vector unsigned char)(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
458 vector signed short Scons1 = (vector signed short)(-4, -3, -2, -1, 0, 1, 2, 3);
459 vector signed short Scons2 = (vector signed short)(-32768, 10000, 1, 1, 1, 1, -10000, -10000);
460 vector signed short Scons3 = (vector signed short)(-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767);
461 vector unsigned short UScons1 = (vector unsigned short)(65532, 65533, 65534, 65535, 0, 1, 2, 3);
462 vector unsigned short UScons2 = (vector unsigned short)(1, 1, 1, 1, 1, 1, 1, 1);
463 vector unsigned short UScons3 = (vector unsigned short)(1, 2, 3, 4, 1, 2, 3, 4);
464 vector signed int Icons1 = (vector signed int)(-4, -1, 1, 4);
465 vector signed int Icons2 = (vector signed int)(1, 1, 1, 1);
466 vector signed int Icons3 = (vector signed int)(0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF);
467 vector unsigned int UIcons1 = (vector unsigned int)(0xFFFFFFFE, 0xFFFFFFFF, 0, 1);
468 vector unsigned int UIcons2 = (vector unsigned int)(1, 1, 1, 1);
469 vector unsigned int UIcons3 = (vector unsigned int)(1, 2, 1, 2);
471 #if defined TEST_FLOATS
472 vector float Fcons1 = (vector float)(-1.5, 1.0, 0.5, -3.999);
473 vector float Fcons2 = (vector float)(1.0, 1.0, 1.0, 1.0);
474 vector float Fcons3 = (vector float)(100000000000.0, 1.0, -1.0, -1234567890.0);
475 #endif
477 #endif
480 /* Function vec_abs */
481 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
482 err = 0;
483 Caux1.v = vec_abs( Ccons1 );
484 Caux2.v = Ccons1;
485 for( i=0; i< 16; i++ )
486 if (Caux1.e[i] != abs( Caux2.e[i] ))
487 err++;
488 if (err)
489 printf("Function vec_abs [type char] ===> Error\n");
490 else
491 printf("Function vec_abs [type char] ===> OK\n");
493 err = 0;
494 Saux1.v = vec_abs( Scons1 );
495 Saux2.v = Scons1;
496 for( i=0; i< 8; i++ )
497 if (Saux1.e[i] != abs( Saux2.e[i] ))
498 err++;
499 if (err)
500 printf("Function vec_abs [type short] ===> Error\n");
501 else
502 printf("Function vec_abs [type short] ===> OK\n");
504 err = 0;
505 Iaux1.v = vec_abs( Icons1 );
506 Iaux2.v = Icons1;
507 for( i=0; i< 4; i++ )
508 if (Iaux1.e[i] != abs( Iaux2.e[i] ))
509 err++;
510 if (err)
511 printf("Function vec_abs [type integer] ===> Error\n");
512 else
513 printf("Function vec_abs [type integer] ===> OK\n");
515 #if defined TEST_FLOATS
516 err = 0;
517 Faux1.v = vec_abs( Fcons1 );
518 Faux2.v = Fcons1;
519 for( i=0; i< 4; i++ )
520 if (Faux1.e[i] != fabs( Faux2.e[i] ))
521 err++;
522 if (err)
523 printf("Function vec_abs [type float] ===> Error\n");
524 else
525 printf("Function vec_abs [type float] ===> OK\n");
526 #endif
528 /* Function vec_abss */
529 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
530 err = 0;
531 Caux1.v = vec_abss( Ccons1 );
532 Caux2.v = Ccons1;
533 for( i=0; i< 16; i++ )
534 if (Caux1.e[i] != abs( Caux2.e[i] ))
535 err++;
536 if (err)
537 printf("Function vec_abss [type char] ===> Error\n");
538 else
539 printf("Function vec_abss [type char] ===> OK\n");
541 err = 0;
542 Saux1.v = vec_abss( Scons1 );
543 Saux2.v = Scons1;
544 for( i=0; i< 8; i++ )
545 if (Saux1.e[i] != abs( Saux2.e[i] ))
546 err++;
547 if (err)
548 printf("Function vec_abss [type short] ===> Error\n");
549 else
550 printf("Function vec_abss [type short] ===> OK\n");
552 err = 0;
553 Iaux1.v = vec_abss( Icons1 );
554 Iaux2.v = Icons1;
555 for( i=0; i< 4; i++ )
556 if (Iaux1.e[i] != abs( Iaux2.e[i] ))
557 err++;
558 if (err)
559 printf("Function vec_abss [type integer] ===> Error\n");
560 else
561 printf("Function vec_abss [type integer] ===> OK\n");
563 /* Function vec_add */
564 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
565 err = 0;
566 Caux1.v = vec_add( Ccons1, Ccons2 );
567 Caux2.v = Ccons1;
568 Caux3.v = Ccons2;
569 for( i=0; i< 16; i++ )
571 Caux = Caux2.e[i]+Caux3.e[i];
572 if (Caux1.e[i] != Caux)
573 err++;
575 if (err)
576 printf("Function vec_add [type char] ===> Error\n");
577 else
578 printf("Function vec_add [type char] ===> OK\n");
580 err = 0;
581 UCaux1.v = vec_add( UCcons1, UCcons2 );
582 UCaux2.v = UCcons1;
583 UCaux3.v = UCcons2;
584 for( i=0; i< 16; i++ )
586 UCaux = UCaux2.e[i]+UCaux3.e[i];
587 if (UCaux1.e[i] != UCaux)
588 err++;
590 if (err)
591 printf("Function vec_add [type unsigned char] ===> Error\n");
592 else
593 printf("Function vec_add [type unsigned char] ===> OK\n");
595 err = 0;
596 Saux1.v = vec_add( Scons1, Scons2 );
597 Saux2.v = Scons1;
598 Saux3.v = Scons2;
599 for( i=0; i< 8; i++ )
601 Saux = Saux2.e[i]+Saux3.e[i];
602 if (Saux1.e[i] != Saux)
603 err++;
605 if (err)
606 printf("Function vec_add [type short] ===> Error\n");
607 else
608 printf("Function vec_add [type short] ===> OK\n");
610 err = 0;
611 USaux1.v = vec_add( UScons1, UScons2 );
612 USaux2.v = UScons1;
613 USaux3.v = UScons2;
614 for( i=0; i< 8; i++ )
616 USaux = USaux2.e[i]+USaux3.e[i];
617 if (USaux1.e[i] != USaux)
618 err++;
620 if (err)
621 printf("Function vec_add [type unsigned short] ===> Error\n");
622 else
623 printf("Function vec_add [type unsigned short] ===> OK\n");
625 err = 0;
626 Iaux1.v = vec_add( Icons1, Icons2 );
627 Iaux2.v = Icons1;
628 Iaux3.v = Icons2;
629 for( i=0; i< 4; i++ )
631 Iaux = Iaux2.e[i]+Iaux3.e[i];
632 if (Iaux1.e[i] != Iaux)
633 err++;
635 if (err)
636 printf("Function vec_add [type integer] ===> Error\n");
637 else
638 printf("Function vec_add [type integer] ===> OK\n");
640 err = 0;
641 UIaux1.v = vec_add( UIcons1, UIcons3 );
642 UIaux2.v = UIcons1;
643 UIaux3.v = UIcons3;
644 for( i=0; i< 4; i++ )
646 UIaux = UIaux2.e[i]+UIaux3.e[i];
647 if (UIaux1.e[i] != UIaux)
648 err++;
650 if (err)
651 printf("Function vec_add [type unsigned int] ===> Error\n");
652 else
653 printf("Function vec_add [type unsigned int] ===> OK\n");
655 #if defined TEST_FLOATS
656 err = 0;
657 Faux1.v = vec_add( Fcons1, Fcons2 );
658 Faux2.v = Fcons1;
659 Faux3.v = Fcons2;
660 for( i=0; i< 4; i++ )
662 Faux = Faux2.e[i]+Faux3.e[i];
663 if (Faux1.e[i] != Faux)
664 err++;
666 if (err)
667 printf("Function vec_add [type float] ===> Error\n");
668 else
669 printf("Function vec_add [type float] ===> OK\n");
670 #endif
673 /* Function vec_addc */
674 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
675 err = 0;
676 UIaux1.v = vec_addc( UIcons1, UIcons3 );
677 UIaux2.v = UIcons1;
678 UIaux3.v = UIcons3;
679 for( i=0; i< 4; i++ )
681 UIaux = (unsigned int)(UIaux2.e[i]+UIaux3.e[i]);
682 if ((UIaux< UIaux2.e[i]) || (UIaux< UIaux3.e[i]))
683 UIaux=1;
684 else
685 UIaux=0;
686 if (UIaux1.e[i] != UIaux)
687 err++;
689 if (err)
690 printf("Function vec_addc [type unsigned int] ===> Error\n");
691 else
692 printf("Function vec_addc [type unsigned int] ===> OK\n");
694 /* Function vec_adds */
695 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
696 err = 0;
697 Caux1.v = vec_adds( Ccons1, Ccons3 );
698 Caux2.v = Ccons1;
699 Caux3.v = Ccons3;
700 for( i=0; i< 16; i++ )
702 Caux = Caux2.e[i]+Caux3.e[i];
703 if ((Caux2.e[i]>0)&&(Caux3.e[i]>0))
705 if (Caux< 0)
706 Caux=0x7F;
708 else if ((Caux2.e[i]<0)&&(Caux3.e[i]<0))
710 if (Caux> 0)
711 Caux=0x80;
713 if (Caux1.e[i] != Caux)
714 err++;
716 if (err)
717 printf("Function vec_adds [type char] ===> Error\n");
718 else
719 printf("Function vec_adds [type char] ===> OK\n");
721 err = 0;
722 UCaux1.v = vec_adds( UCcons1, UCcons3 );
723 UCaux2.v = UCcons1;
724 UCaux3.v = UCcons3;
725 for( i=0; i< 16; i++ )
727 UCaux = (unsigned char)(UCaux2.e[i]+UCaux3.e[i]);
728 if ((UCaux< UCaux2.e[i]) || (UCaux< UCaux3.e[i]))
729 UCaux=0xFF;
730 if (UCaux1.e[i] != UCaux)
731 err++;
733 if (err)
734 printf("Function vec_adds [type unsigned char] ===> Error\n");
735 else
736 printf("Function vec_adds [type unsigned char] ===> OK\n");
738 err = 0;
739 Saux1.v = vec_adds( Scons1, Scons3 );
740 Saux2.v = Scons1;
741 Saux3.v = Scons3;
742 for( i=0; i< 8; i++ )
744 Saux = Saux2.e[i]+Saux3.e[i];
745 if ((Saux2.e[i]>0)&&(Saux3.e[i]>0))
747 if (Saux< 0)
748 Saux=0x7FFF;
750 else if ((Saux2.e[i]<0)&&(Saux3.e[i]<0))
752 if (Saux> 0)
753 Saux=0x8000;
755 if (Saux1.e[i] != Saux)
756 err++;
758 if (err)
759 printf("Function vec_adds [type short] ===> Error\n");
760 else
761 printf("Function vec_adds [type short] ===> OK\n");
763 err = 0;
764 USaux1.v = vec_adds( UScons1, UScons3 );
765 USaux2.v = UScons1;
766 USaux3.v = UScons3;
767 for( i=0; i< 8; i++ )
769 USaux = (unsigned short)(USaux2.e[i]+USaux3.e[i]);
770 if ((USaux< USaux2.e[i]) || (USaux< USaux3.e[i]))
771 USaux=0xFFFF;
772 if (USaux1.e[i] != USaux)
773 err++;
775 if (err)
776 printf("Function vec_adds [type unsigned short] ===> Error\n");
777 else
778 printf("Function vec_adds [type unsigned short] ===> OK\n");
781 err = 0;
782 Iaux1.v = vec_adds( Icons1, Icons3 );
783 Iaux2.v = Icons1;
784 Iaux3.v = Icons3;
785 for( i=0; i< 4; i++ )
787 Iaux = Iaux2.e[i]+Iaux3.e[i];
788 if ((Iaux2.e[i]>0)&&(Iaux3.e[i]>0))
790 if (Iaux< 0)
791 Iaux=0x7FFFFFFF;
793 else if ((Iaux2.e[i]<0)&&(Iaux3.e[i]<0))
795 if (Iaux> 0)
796 Iaux=0x80000000;
798 if (Iaux1.e[i] != Iaux)
799 err++;
801 if (err)
802 printf("Function vec_adds [type integer] ===> Error\n");
803 else
804 printf("Function vec_adds [type integer] ===> OK\n");
806 err = 0;
807 UIaux1.v = vec_adds( UIcons1, UIcons3 );
808 UIaux2.v = UIcons1;
809 UIaux3.v = UIcons3;
810 for( i=0; i< 4; i++ )
812 UIaux = (unsigned int)(UIaux2.e[i]+UIaux3.e[i]);
813 if ((UIaux< UIaux2.e[i]) || (UIaux< UIaux3.e[i]))
814 UIaux=0xFFFFFFFF;
815 if (UIaux1.e[i] != UIaux)
816 err++;
818 if (err)
819 printf("Function vec_adds [type unsigned int] ===> Error\n");
820 else
821 printf("Function vec_adds [type unsigned int] ===> OK\n");
823 /* Function vec_and */
824 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
825 err = 0;
826 Caux1.v = vec_and( Ccons1, Ccons2 );
827 Caux2.v = Ccons1;
828 Caux3.v = Ccons2;
829 for( i=0; i< 16; i++ )
830 if (Caux1.e[i] != (Caux2.e[i] & Caux3.e[i]))
831 err++;
832 if (err)
833 printf("Function vec_and [type char] ===> Error\n");
834 else
835 printf("Function vec_and [type char] ===> OK\n");
837 err = 0;
838 UCaux1.v = vec_and( UCcons1, UCcons2 );
839 UCaux2.v = UCcons1;
840 UCaux3.v = UCcons2;
841 for( i=0; i< 16; i++ )
842 if (UCaux1.e[i] != (UCaux2.e[i] & UCaux3.e[i]))
843 err++;
844 if (err)
845 printf("Function vec_and [type unsigned char] ===> Error\n");
846 else
847 printf("Function vec_and [type unsigned char] ===> OK\n");
849 err = 0;
850 Saux1.v = vec_and( Scons1, Scons2 );
851 Saux2.v = Scons1;
852 Saux3.v = Scons2;
853 for( i=0; i< 8; i++ )
854 if (Saux1.e[i] != (Saux2.e[i] & Saux3.e[i]))
855 err++;
856 if (err)
857 printf("Function vec_and [type short] ===> Error\n");
858 else
859 printf("Function vec_and [type short] ===> OK\n");
861 err = 0;
862 USaux1.v = vec_and( UScons1, UScons2 );
863 USaux2.v = UScons1;
864 USaux3.v = UScons2;
865 for( i=0; i< 8; i++ )
866 if (USaux1.e[i] != (USaux2.e[i] & USaux3.e[i]))
867 err++;
868 if (err)
869 printf("Function vec_and [type unsigned short] ===> Error\n");
870 else
871 printf("Function vec_and [type unsigned short] ===> OK\n");
873 err = 0;
874 Iaux1.v = vec_and( Icons1, Icons2 );
875 Iaux2.v = Icons1;
876 Iaux3.v = Icons2;
877 for( i=0; i< 4; i++ )
878 if (Iaux1.e[i] != (Iaux2.e[i] & Iaux3.e[i]))
879 err++;
880 if (err)
881 printf("Function vec_and [type integer] ===> Error\n");
882 else
883 printf("Function vec_and [type integer] ===> OK\n");
885 err = 0;
886 UIaux1.v = vec_and( UIcons1, UIcons2 );
887 UIaux2.v = UIcons1;
888 UIaux3.v = UIcons2;
889 for( i=0; i< 4; i++ )
890 if (UIaux1.e[i] != (UIaux2.e[i] & UIaux3.e[i]))
891 err++;
892 if (err)
893 printf("Function vec_and [type unsigned int] ===> Error\n");
894 else
895 printf("Function vec_and [type unsigned int] ===> OK\n");
897 #if defined TEST_FLOATS
898 err = 0;
899 Faux1.v = vec_and( Fcons1, Fcons2 );
900 Faux2.v = Fcons1;
901 Faux3.v = Fcons2;
902 for( i=0; i< 4; i++ )
904 Ivec1 = Faux1.i[i];
905 Ivec2 = Faux2.i[i];
906 Ivec3 = Faux3.i[i];
907 if ((Ivec1) != ((Ivec2) & (Ivec3)))
908 err++;
910 if (err)
911 printf("Function vec_and [type float] ===> Error\n");
912 else
913 printf("Function vec_and [type float] ===> OK\n");
914 #endif
916 /* Function vec_andc */
917 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
918 err = 0;
919 Caux1.v = vec_andc( Ccons1, Ccons2 );
920 Caux2.v = Ccons1;
921 Caux3.v = Ccons2;
922 for( i=0; i< 16; i++ )
923 if (Caux1.e[i] != (Caux2.e[i] & ~Caux3.e[i]))
924 err++;
925 if (err)
926 printf("Function vec_andc [type char] ===> Error\n");
927 else
928 printf("Function vec_andc [type char] ===> OK\n");
930 err = 0;
931 UCaux1.v = vec_andc( UCcons1, UCcons2 );
932 UCaux2.v = UCcons1;
933 UCaux3.v = UCcons2;
934 for( i=0; i< 16; i++ )
935 if (UCaux1.e[i] != (UCaux2.e[i] & ~UCaux3.e[i]))
936 err++;
937 if (err)
938 printf("Function vec_andc [type unsigned char] ===> Error\n");
939 else
940 printf("Function vec_andc [type unsigned char] ===> OK\n");
942 err = 0;
943 Saux1.v = vec_andc( Scons1, Scons2 );
944 Saux2.v = Scons1;
945 Saux3.v = Scons2;
946 for( i=0; i< 8; i++ )
947 if (Saux1.e[i] != (Saux2.e[i] & ~Saux3.e[i]))
948 err++;
949 if (err)
950 printf("Function vec_andc [type short] ===> Error\n");
951 else
952 printf("Function vec_andc [type short] ===> OK\n");
954 err = 0;
955 USaux1.v = vec_andc( UScons1, UScons2 );
956 USaux2.v = UScons1;
957 USaux3.v = UScons2;
958 for( i=0; i< 8; i++ )
959 if (USaux1.e[i] != (USaux2.e[i] & ~USaux3.e[i]))
960 err++;
961 if (err)
962 printf("Function vec_andc [type unsigned short] ===> Error\n");
963 else
964 printf("Function vec_andc [type unsigned short] ===> OK\n");
966 err = 0;
967 Iaux1.v = vec_andc( Icons1, Icons2 );
968 Iaux2.v = Icons1;
969 Iaux3.v = Icons2;
970 for( i=0; i< 4; i++ )
971 if (Iaux1.e[i] != (Iaux2.e[i] & ~Iaux3.e[i]))
972 err++;
973 if (err)
974 printf("Function vec_andc [type integer] ===> Error\n");
975 else
976 printf("Function vec_andc [type integer] ===> OK\n");
978 err = 0;
979 UIaux1.v = vec_andc( UIcons1, UIcons2 );
980 UIaux2.v = UIcons1;
981 UIaux3.v = UIcons2;
982 for( i=0; i< 4; i++ )
983 if (UIaux1.e[i] != (UIaux2.e[i] & ~UIaux3.e[i]))
984 err++;
985 if (err)
986 printf("Function vec_andc [type unsigned int] ===> Error\n");
987 else
988 printf("Function vec_andc [type unsigned int] ===> OK\n");
990 #if defined TEST_FLOATS
991 err = 0;
992 Faux1.v = vec_andc( Fcons1, Fcons2 );
993 Faux2.v = Fcons1;
994 Faux3.v = Fcons2;
995 for( i=0; i< 4; i++ )
997 Ivec1 = Faux1.i[i];
998 Ivec2 = Faux2.i[i];
999 Ivec3 = Faux3.i[i];
1000 if ((Ivec1) != ((Ivec2) & ~(Ivec3)))
1001 err++;
1003 if (err)
1004 printf("Function vec_andc [type float] ===> Error\n");
1005 else
1006 printf("Function vec_andc [type float] ===> OK\n");
1007 #endif
1009 /* Function vec_avg */
1010 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1011 err = 0;
1012 Caux1.v = vec_avg( Ccons1, Ccons2 );
1013 Caux2.v = Ccons1;
1014 Caux3.v = Ccons2;
1015 for( i=0; i< 16; i++ )
1017 j = (Caux2.e[i]+Caux3.e[i]+1) >> 1;
1018 if (Caux1.e[i] != j)
1019 err++;
1021 if (err)
1022 printf("Function vec_avg [type char] ===> Error\n");
1023 else
1024 printf("Function vec_avg [type char] ===> OK\n");
1026 err = 0;
1027 UCaux1.v = vec_avg( UCcons1, UCcons2 );
1028 UCaux2.v = UCcons1;
1029 UCaux3.v = UCcons2;
1030 for( i=0; i< 16; i++ )
1032 j = (UCaux2.e[i]+UCaux3.e[i]+1) >> 1;
1033 if (UCaux1.e[i] != j)
1034 err++;
1036 if (err)
1037 printf("Function vec_avg [type unsigned char] ===> Error\n");
1038 else
1039 printf("Function vec_avg [type unsigned char] ===> OK\n");
1041 err = 0;
1042 Saux1.v = vec_avg( Scons1, Scons2 );
1043 Saux2.v = Scons1;
1044 Saux3.v = Scons2;
1045 for( i=0; i< 8; i++ )
1047 j = (Saux2.e[i]+Saux3.e[i]+1) >> 1;
1048 if (Saux1.e[i] != j)
1049 err++;
1051 if (err)
1052 printf("Function vec_avg [type short] ===> Error\n");
1053 else
1054 printf("Function vec_avg [type short] ===> OK\n");
1056 err = 0;
1057 USaux1.v = vec_avg( UScons1, UScons2 );
1058 USaux2.v = UScons1;
1059 USaux3.v = UScons2;
1060 for( i=0; i< 8; i++ )
1062 j = (USaux2.e[i]+USaux3.e[i]+1) >> 1;
1063 if (USaux1.e[i] != j)
1064 err++;
1066 if (err)
1067 printf("Function vec_avg [type unsigned short] ===> Error\n");
1068 else
1069 printf("Function vec_avg [type unsigned short] ===> OK\n");
1071 err = 0;
1072 Iaux1.v = vec_avg( Icons1, Icons2 );
1073 Iaux2.v = Icons1;
1074 Iaux3.v = Icons2;
1075 for( i=0; i< 4; i++ )
1077 Iaux = Iaux2.e[i]%2;
1078 if (Iaux2.e[i]<0)
1079 Iaux = -Iaux;
1081 if (Iaux3.e[i]<0)
1082 Iaux = (Iaux - Iaux3.e[i]%2 + 1)>>1;
1083 else
1084 Iaux = (Iaux + Iaux3.e[i]%2 + 1)>>1;
1085 Iaux = (Iaux2.e[i] >> 1) + (Iaux3.e[i] >> 1) + Iaux;
1086 if (Iaux1.e[i] != Iaux)
1087 err++;
1089 if (err)
1090 printf("Function vec_avg [type integer] ===> Error\n");
1091 else
1092 printf("Function vec_avg [type integer] ===> OK\n");
1094 err = 0;
1095 UIaux1.v = vec_avg( UIcons1, UIcons2 );
1096 UIaux2.v = UIcons1;
1097 UIaux3.v = UIcons2;
1098 for( i=0; i< 4; i++ )
1100 UIaux = (UIaux2.e[i] >> 1) + (UIaux3.e[i] >> 1) +
1101 ((UIaux2.e[i]%2 + UIaux3.e[i]%2 + 1 )>>1);
1102 if (UIaux1.e[i] != UIaux)
1103 err++;
1105 if (err)
1106 printf("Function vec_avg [type unsigned int] ===> Error\n");
1107 else
1108 printf("Function vec_avg [type unsigned int] ===> OK\n");
1110 #if defined TEST_FLOATS
1111 /* Function vec_ceil */
1112 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1113 err = 0;
1114 Faux1.v = vec_ceil( Fcons1 );
1115 Faux2.v = Fcons1;
1116 for( i=0; i< 4; i++ )
1117 if (Faux1.e[i] != ceil(Faux2.e[i]))
1118 err++;
1119 if (err)
1120 printf("Function vec_ceil [type float] ===> Error\n");
1121 else
1122 printf("Function vec_ceil [type float] ===> OK\n");
1123 #endif
1125 #if defined TEST_FLOATS
1126 /* Function vec_cmpb */
1127 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1128 err = 0;
1129 Iaux1.v = vec_cmpb( Fcons1, Fcons2 );
1130 Faux2.v = Fcons1;
1131 Faux3.v = Fcons2;
1132 for( i=0; i< 4; i++ )
1134 j = 0;
1135 if (Faux2.e[i]>Faux3.e[i])
1136 j+=(1 << 31);
1137 if (Faux2.e[i]<-Faux3.e[i])
1138 j+=(1 << 30);
1139 if (Iaux1.e[i] != j)
1140 err++;
1143 if (err)
1144 printf("Function vec_cmpb [type float] ===> Error\n");
1145 else
1146 printf("Function vec_cmpb [type float] ===> OK\n");
1147 #endif
1149 /* Function vec_cmpeq */
1150 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1151 err = 0;
1152 BCaux1.v = vec_cmpeq( Ccons1, Ccons2 );
1153 Caux2.v = Ccons1;
1154 Caux3.v = Ccons2;
1155 for( i=0; i< 16; i++ )
1157 if (Caux2.e[i] == Caux3.e[i])
1158 BCaux = 0xFF;
1159 else
1160 BCaux = 0;
1161 if (BCaux1.e[i] != BCaux)
1162 err++;
1164 if (err)
1165 printf("Function vec_cmpeq [type char] ===> Error\n");
1166 else
1167 printf("Function vec_cmpeq [type char] ===> OK\n");
1169 err = 0;
1170 BCaux1.v = vec_cmpeq( UCcons1, UCcons2 );
1171 UCaux2.v = UCcons1;
1172 UCaux3.v = UCcons2;
1173 for( i=0; i< 16; i++ )
1175 if (UCaux2.e[i] == UCaux3.e[i])
1176 BCaux = 0xFF;
1177 else
1178 BCaux = 0;
1179 if (BCaux1.e[i] != BCaux)
1180 err++;
1182 if (err)
1183 printf("Function vec_cmpeq [type unsigned char] ===> Error\n");
1184 else
1185 printf("Function vec_cmpeq [type unsigned char] ===> OK\n");
1187 err = 0;
1188 BSaux1.v = vec_cmpeq( Scons1, Scons2 );
1189 Saux2.v = Scons1;
1190 Saux3.v = Scons2;
1191 for( i=0; i< 8; i++ )
1193 if (Saux2.e[i] == Saux3.e[i])
1194 BSaux = 0xFFFF;
1195 else
1196 BSaux = 0;
1197 if (BSaux1.e[i] != BSaux)
1198 err++;
1200 if (err)
1201 printf("Function vec_cmpeq [type short] ===> Error\n");
1202 else
1203 printf("Function vec_cmpeq [type short] ===> OK\n");
1205 err = 0;
1206 BSaux1.v = vec_cmpeq( UScons1, UScons2 );
1207 USaux2.v = UScons1;
1208 USaux3.v = UScons2;
1209 for( i=0; i< 8; i++ )
1211 if (USaux2.e[i] == USaux3.e[i])
1212 BSaux = 0xFFFF;
1213 else
1214 BSaux = 0;
1215 if (BSaux1.e[i] != BSaux)
1216 err++;
1218 if (err)
1219 printf("Function vec_cmpeq [type unsigned short] ===> Error\n");
1220 else
1221 printf("Function vec_cmpeq [type unsigned short] ===> OK\n");
1223 err = 0;
1224 BIaux1.v = vec_cmpeq( Icons1, Icons2 );
1225 Iaux2.v = Icons1;
1226 Iaux3.v = Icons2;
1227 for( i=0; i< 4; i++ )
1229 if (Iaux2.e[i] == Iaux3.e[i])
1230 BIaux = 0xFFFFFFFF;
1231 else
1232 BIaux = 0;
1233 if (BIaux1.e[i] != BIaux)
1234 err++;
1236 if (err)
1237 printf("Function vec_cmpeq [type integer] ===> Error\n");
1238 else
1239 printf("Function vec_cmpeq [type integer] ===> OK\n");
1241 err = 0;
1242 BIaux1.v = vec_cmpeq( UIcons1, UIcons2 );
1243 UIaux2.v = UIcons1;
1244 UIaux3.v = UIcons2;
1245 for( i=0; i< 4; i++ )
1247 if (UIaux2.e[i] == UIaux3.e[i])
1248 BIaux = 0xFFFFFFFF;
1249 else
1250 BIaux = 0;
1251 if (BIaux1.e[i] != BIaux)
1252 err++;
1254 if (err)
1255 printf("Function vec_cmpeq [type unsigned int] ===> Error\n");
1256 else
1257 printf("Function vec_cmpeq [type unsigned int] ===> OK\n");
1259 #if defined TEST_FLOATS
1260 err = 0;
1261 BIaux1.v = vec_cmpeq( Fcons1, Fcons2 );
1262 Faux2.v = Fcons1;
1263 Faux3.v = Fcons2;
1264 for( i=0; i< 4; i++ )
1266 if (Faux2.e[i] == Faux3.e[i])
1267 BIaux = 0xFFFFFFFF;
1268 else
1269 BIaux = 0;
1270 if (BIaux1.e[i] != BIaux)
1271 err++;
1273 if (err)
1274 printf("Function vec_cmpeq [type float] ===> Error\n");
1275 else
1276 printf("Function vec_cmpeq [type float] ===> OK\n");
1277 #endif
1279 #if defined TEST_FLOATS
1280 /* Function vec_cmpge */
1281 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1282 err = 0;
1283 BIaux1.v = vec_cmpge( Fcons1, Fcons2 );
1284 Faux2.v = Fcons1;
1285 Faux3.v = Fcons2;
1286 for( i=0; i< 4; i++ )
1288 if (Faux2.e[i] >= Faux3.e[i])
1289 BIaux = 0xFFFFFFFF;
1290 else
1291 BIaux = 0;
1292 if (BIaux1.e[i] != BIaux)
1293 err++;
1295 if (err)
1296 printf("Function vec_cmpge [type float] ===> Error\n");
1297 else
1298 printf("Function vec_cmpge [type float] ===> OK\n");
1299 #endif
1301 /* Function vec_cmpgt */
1302 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1303 err = 0;
1304 BCaux1.v = vec_cmpgt( Ccons1, Ccons2 );
1305 Caux2.v = Ccons1;
1306 Caux3.v = Ccons2;
1307 for( i=0; i< 16; i++ )
1309 if (Caux2.e[i] > Caux3.e[i])
1310 BCaux = 0xFF;
1311 else
1312 BCaux = 0;
1313 if (BCaux1.e[i] != BCaux)
1314 err++;
1316 if (err)
1317 printf("Function vec_cmpgt [type char] ===> Error\n");
1318 else
1319 printf("Function vec_cmpgt [type char] ===> OK\n");
1321 err = 0;
1322 BCaux1.v = vec_cmpgt( UCcons1, UCcons2 );
1323 UCaux2.v = UCcons1;
1324 UCaux3.v = UCcons2;
1325 for( i=0; i< 16; i++ )
1327 if (UCaux2.e[i] > UCaux3.e[i])
1328 BCaux = 0xFF;
1329 else
1330 BCaux = 0;
1331 if (BCaux1.e[i] != BCaux)
1332 err++;
1334 if (err)
1335 printf("Function vec_cmpgt [type unsigned char] ===> Error\n");
1336 else
1337 printf("Function vec_cmpgt [type unsigned char] ===> OK\n");
1339 err = 0;
1340 BSaux1.v = vec_cmpgt( Scons1, Scons2 );
1341 Saux2.v = Scons1;
1342 Saux3.v = Scons2;
1343 for( i=0; i< 8; i++ )
1345 if (Saux2.e[i] > Saux3.e[i])
1346 BSaux = 0xFFFF;
1347 else
1348 BSaux = 0;
1349 if (BSaux1.e[i] != BSaux)
1350 err++;
1352 if (err)
1353 printf("Function vec_cmpgt [type short] ===> Error\n");
1354 else
1355 printf("Function vec_cmpgt [type short] ===> OK\n");
1357 err = 0;
1358 BSaux1.v = vec_cmpgt( UScons1, UScons2 );
1359 USaux2.v = UScons1;
1360 USaux3.v = UScons2;
1361 for( i=0; i< 8; i++ )
1363 if (USaux2.e[i] > USaux3.e[i])
1364 BSaux = 0xFFFF;
1365 else
1366 BSaux = 0;
1367 if (BSaux1.e[i] != BSaux)
1368 err++;
1370 if (err)
1371 printf("Function vec_cmpgt [type unsigned short] ===> Error\n");
1372 else
1373 printf("Function vec_cmpgt [type unsigned short] ===> OK\n");
1375 err = 0;
1376 BIaux1.v = vec_cmpgt( Icons1, Icons2 );
1377 Iaux2.v = Icons1;
1378 Iaux3.v = Icons2;
1379 for( i=0; i< 4; i++ )
1381 if (Iaux2.e[i] > Iaux3.e[i])
1382 BIaux = 0xFFFFFFFF;
1383 else
1384 BIaux = 0;
1385 if (BIaux1.e[i] != BIaux)
1386 err++;
1388 if (err)
1389 printf("Function vec_cmpgt [type integer] ===> Error\n");
1390 else
1391 printf("Function vec_cmpgt [type integer] ===> OK\n");
1393 err = 0;
1394 BIaux1.v = vec_cmpgt( UIcons1, UIcons2 );
1395 UIaux2.v = UIcons1;
1396 UIaux3.v = UIcons2;
1397 for( i=0; i< 4; i++ )
1399 if (UIaux2.e[i] > UIaux3.e[i])
1400 BIaux=0xFFFFFFFF;
1401 else
1402 BIaux = 0;
1403 if (BIaux1.e[i] != BIaux)
1404 err++;
1406 if (err)
1407 printf("Function vec_cmpgt [type unsigned int] ===> Error\n");
1408 else
1409 printf("Function vec_cmpgt [type unsigned int] ===> OK\n");
1411 #if defined TEST_FLOATS
1412 err = 0;
1413 BIaux1.v = vec_cmpgt( Fcons1, Fcons2 );
1414 Faux2.v = Fcons1;
1415 Faux3.v = Fcons2;
1416 for( i=0; i< 4; i++ )
1418 if (Faux2.e[i] > Faux3.e[i])
1419 BIaux = 0xFFFFFFFF;
1420 else
1421 BIaux = 0;
1422 if (BIaux1.e[i] != BIaux)
1423 err++;
1425 if (err)
1426 printf("Function vec_cmpgt [type float] ===> Error\n");
1427 else
1428 printf("Function vec_cmpgt [type float] ===> OK\n");
1429 #endif
1431 #if defined TEST_FLOATS
1432 /* Function vec_cmple */
1433 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1434 err = 0;
1435 BIaux1.v = vec_cmple( Fcons1, Fcons2 );
1436 Faux2.v = Fcons1;
1437 Faux3.v = Fcons2;
1438 for( i=0; i< 4; i++ )
1440 if (Faux2.e[i] <= Faux3.e[i])
1441 BIaux = 0xFFFFFFFF;
1442 else
1443 BIaux = 0;
1444 if (BIaux1.e[i] != BIaux)
1445 err++;
1447 if (err)
1448 printf("Function vec_cmple [type float] ===> Error\n");
1449 else
1450 printf("Function vec_cmple [type float] ===> OK\n");
1451 #endif
1453 /* Function vec_cmplt */
1454 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1455 err = 0;
1456 BCaux1.v = vec_cmplt( Ccons1, Ccons2 );
1457 Caux2.v = Ccons1;
1458 Caux3.v = Ccons2;
1459 for( i=0; i< 16; i++ )
1461 if (Caux2.e[i] < Caux3.e[i])
1462 BCaux = 0xFF;
1463 else
1464 BCaux = 0;
1465 if (BCaux1.e[i] != BCaux)
1466 err++;
1468 if (err)
1469 printf("Function vec_cmplt [type char] ===> Error\n");
1470 else
1471 printf("Function vec_cmplt [type char] ===> OK\n");
1473 err = 0;
1474 BCaux1.v = vec_cmplt( UCcons1, UCcons2 );
1475 UCaux2.v = UCcons1;
1476 UCaux3.v = UCcons2;
1477 for( i=0; i< 16; i++ )
1479 if (UCaux2.e[i] < UCaux3.e[i])
1480 BCaux = 0xFF;
1481 else
1482 BCaux = 0;
1483 if (BCaux1.e[i] != BCaux)
1484 err++;
1486 if (err)
1487 printf("Function vec_cmplt [type unsigned char] ===> Error\n");
1488 else
1489 printf("Function vec_cmplt [type unsigned char] ===> OK\n");
1491 err = 0;
1492 BSaux1.v = vec_cmplt( Scons1, Scons2 );
1493 Saux2.v = Scons1;
1494 Saux3.v = Scons2;
1495 for( i=0; i< 8; i++ )
1497 if (Saux2.e[i] < Saux3.e[i])
1498 BSaux = 0xFFFF;
1499 else
1500 BSaux = 0;
1501 if (BSaux1.e[i] != BSaux)
1502 err++;
1504 if (err)
1505 printf("Function vec_cmplt [type short] ===> Error\n");
1506 else
1507 printf("Function vec_cmplt [type short] ===> OK\n");
1509 err = 0;
1510 BSaux1.v = vec_cmplt( UScons1, UScons2 );
1511 USaux2.v = UScons1;
1512 USaux3.v = UScons2;
1513 for( i=0; i< 8; i++ )
1515 if (USaux2.e[i] < USaux3.e[i])
1516 BSaux = 0xFFFF;
1517 else
1518 BSaux = 0;
1519 if (BSaux1.e[i] != BSaux)
1520 err++;
1522 if (err)
1523 printf("Function vec_cmplt [type unsigned short] ===> Error\n");
1524 else
1525 printf("Function vec_cmplt [type unsigned short] ===> OK\n");
1527 err = 0;
1528 BIaux1.v = vec_cmplt( Icons1, Icons2 );
1529 Iaux2.v = Icons1;
1530 Iaux3.v = Icons2;
1531 for( i=0; i< 4; i++ )
1533 if (Iaux2.e[i] < Iaux3.e[i])
1534 BIaux = 0xFFFFFFFF;
1535 else
1536 BIaux = 0;
1537 if (BIaux1.e[i] != BIaux)
1538 err++;
1540 if (err)
1541 printf("Function vec_cmplt [type integer] ===> Error\n");
1542 else
1543 printf("Function vec_cmplt [type integer] ===> OK\n");
1545 err = 0;
1546 BIaux1.v = vec_cmplt( UIcons1, UIcons2 );
1547 UIaux2.v = UIcons1;
1548 UIaux3.v = UIcons2;
1549 for( i=0; i< 4; i++ )
1551 if (UIaux2.e[i] < UIaux3.e[i])
1552 BIaux=0xFFFFFFFF;
1553 else
1554 BIaux = 0;
1555 if (BIaux1.e[i] != BIaux)
1556 err++;
1558 if (err)
1559 printf("Function vec_cmplt [type unsigned int] ===> Error\n");
1560 else
1561 printf("Function vec_cmplt [type unsigned int] ===> OK\n");
1563 #if defined TEST_FLOATS
1564 err = 0;
1565 BIaux1.v = vec_cmplt( Fcons1, Fcons2 );
1566 Faux2.v = Fcons1;
1567 Faux3.v = Fcons2;
1568 for( i=0; i< 4; i++ )
1570 if (Faux2.e[i] < Faux3.e[i])
1571 BIaux = 0xFFFFFFFF;
1572 else
1573 BIaux = 0;
1574 if (BIaux1.e[i] != BIaux)
1575 err++;
1577 if (err)
1578 printf("Function vec_cmplt [type float] ===> Error\n");
1579 else
1580 printf("Function vec_cmplt [type float] ===> OK\n");
1581 #endif
1583 #if defined TEST_FLOATS
1584 /* Function vec_ctf */
1585 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1586 err = 0;
1587 b = 2;
1588 Faux1.v = vec_ctf( Icons1, 2 );
1589 Iaux1.v = Icons1;
1590 for( i=0; i< 4; i++ )
1591 if (Faux1.e[i] != (((float)Iaux1.e[i])/(1<<b)))
1592 err++;
1593 if (err)
1594 printf("Function vec_ctf [type integer] ===> Error\n");
1595 else
1596 printf("Function vec_ctf [type integer] ===> OK\n");
1598 err = 0;
1599 b = 2;
1600 Faux1.v = vec_ctf( UIcons1, 2 );
1601 UIaux1.v = UIcons1;
1602 for( i=0; i< 4; i++ )
1603 if (Faux1.e[i] != (((float)UIaux1.e[i])/(1<<b)))
1604 err++;
1605 if (err)
1606 printf("Function vec_ctf [type unsigned int] ===> Error\n");
1607 else
1608 printf("Function vec_ctf [type unsigned int] ===> OK\n");
1609 #endif
1611 #if defined TEST_FLOATS
1612 /* Function vec_cts */
1613 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1614 err = 0;
1615 b = 2;
1616 Iaux1.v = vec_cts( Fcons3, 2 );
1617 Faux1.v = Fcons3;
1618 for( i=0; i< 4; i++ )
1619 if (Iaux1.e[i] != (int)(Faux1.e[i]*(1<<b)))
1620 err++;
1621 if (err)
1622 printf("Function vec_cts [type float] ===> Error\n");
1623 else
1624 printf("Function vec_cts [type float] ===> OK\n");
1625 #endif
1627 #if defined TEST_FLOATS
1628 /* Function vec_ctu */
1629 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1630 err = 0;
1631 b = 2;
1632 UIaux1.v = vec_ctu( Fcons3, 2 );
1633 Faux1.v = Fcons3;
1634 for( i=0; i< 4; i++ )
1636 double d = Faux1.e[i]*(1<<b);
1637 if (d > 0xffffffff)
1638 d = 0xffffffff;
1639 if (d < 0)
1640 d = 0;
1641 if (UIaux1.e[i] != (unsigned int)(d))
1642 err++;
1644 if (err)
1645 printf("Function vec_ctu [type float] ===> Error\n");
1646 else
1647 printf("Function vec_ctu [type float] ===> OK\n");
1648 #endif
1650 part1();
1652 part2();
1654 part3();
1656 part4();
1658 part5();
1660 return 0;
1666 int part1()
1668 TvecChar Caux1;//, Caux2, Caux3, Caux4;
1669 TvecUChar UCaux1;//, UCaux2, UCaux3, UCaux4;
1670 TvecShort Saux1;//, Saux2, Saux3, Saux4;
1671 TvecUShort USaux1;//, USaux2, USaux3, USaux4;
1672 TvecInt Iaux1;//, Iaux2, Iaux3, Iaux4;
1673 TvecUInt UIaux1;//, UIaux2, UIaux3, UIaux4;
1674 #if defined TEST_FLOATS
1675 TvecFloat Faux1, Faux2;//, Faux3, Faux4;
1676 #endif
1678 int i, err, j;//, b, bAux;
1679 // signed int Ivec1, Ivec2, Ivec3;
1680 // signed short *Svec1;
1681 // unsigned int *UIvec1;
1682 // unsigned short *USvec1;
1683 // unsigned char *UCvec1;
1684 #if defined TEST_FLOATS
1685 // float *Fvec1;
1686 #endif
1688 /* For saturated rutines */
1689 // long long int LLaux;
1691 #if defined TEST_FLOATS
1692 float Faux;
1693 #endif
1694 signed int Iaux;//, I1, I2;
1695 // unsigned int UIaux, UI1, UI2;
1696 // signed short Saux;
1697 // unsigned short USaux;
1698 // signed char Caux;
1699 // unsigned char UCaux;
1702 union
1704 float f;
1705 signed int si;
1706 unsigned int ui;
1707 signed short ss[2];
1708 unsigned short us[2];
1709 signed char sc[4];
1710 unsigned char uc[4];
1711 } INTunion1, INTunion2;
1713 union
1715 signed short ss;
1716 unsigned short us;
1717 signed char sc[2];
1718 unsigned char uc[2];
1719 } SHOunion1, SHOunion2;
1722 #if defined (GCC_COMPILER)
1723 vector signed char Ccons1 = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
1724 // vector signed char Ccons2 = (vector signed char){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
1725 // vector signed char Ccons3 = (vector signed char){-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127};
1726 vector unsigned char UCcons1 = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7};
1727 // vector unsigned char UCcons2 = (vector unsigned char){2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
1728 // vector unsigned char UCcons3 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
1729 vector signed short Scons1 = (vector signed short){-4, -3, -2, -1, 0, 1, 2, 3};
1730 // vector signed short Scons2 = (vector signed short){-32768, 10000, 1, 1, 1, 1, -10000, -10000};
1731 // vector signed short Scons3 = (vector signed short){-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767};
1732 // vector unsigned short UScons1 = (vector unsigned short){65532, 65533, 65534, 65535, 0, 1, 2, 3};
1733 // vector unsigned short UScons2 = (vector unsigned short){1, 1, 1, 1, 1, 1, 1, 1};
1734 vector unsigned short UScons3 = (vector unsigned short){1, 2, 3, 4, 1, 2, 3, 4};
1735 vector signed int Icons1 = (vector signed int){-4, -1, 1, 4};
1736 // vector signed int Icons2 = (vector signed int){1, 1, 1, 1};
1737 // vector signed int Icons3 = (vector signed int){0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF};
1738 vector unsigned int UIcons1 = (vector unsigned int){0xFFFFFFFE, 0xFFFFFFFF, 0, 1};
1739 // vector unsigned int UIcons2 = (vector unsigned int){1, 1, 1, 1};
1740 // vector unsigned int UIcons3 = (vector unsigned int){1, 2, 1, 2};
1742 #if defined TEST_FLOATS
1743 vector float Fcons1 = (vector float){-1.5, 1.0, 0.5, -3.999};
1744 // vector float Fcons2 = (vector float){1.0, 1.0, 1.0, 1.0};
1745 vector float Fcons3 = (vector float){100000000000.0, 1.0, -1.0, -1234567890.0};
1746 #endif
1748 #elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
1749 vector signed char Ccons1 = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
1750 vector signed char Ccons2 = (vector signed char)(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
1751 vector signed char Ccons3 = (vector signed char)(-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127);
1752 vector unsigned char UCcons1 = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7);
1753 vector unsigned char UCcons2 = (vector unsigned char)(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
1754 vector unsigned char UCcons3 = (vector unsigned char)(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
1755 vector signed short Scons1 = (vector signed short)(-4, -3, -2, -1, 0, 1, 2, 3);
1756 vector signed short Scons2 = (vector signed short)(-32768, 10000, 1, 1, 1, 1, -10000, -10000);
1757 vector signed short Scons3 = (vector signed short)(-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767);
1758 vector unsigned short UScons1 = (vector unsigned short)(65532, 65533, 65534, 65535, 0, 1, 2, 3);
1759 vector unsigned short UScons2 = (vector unsigned short)(1, 1, 1, 1, 1, 1, 1, 1);
1760 vector unsigned short UScons3 = (vector unsigned short)(1, 2, 3, 4, 1, 2, 3, 4);
1761 vector signed int Icons1 = (vector signed int)(-4, -1, 1, 4);
1762 vector signed int Icons2 = (vector signed int)(1, 1, 1, 1);
1763 vector signed int Icons3 = (vector signed int)(0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF);
1764 vector unsigned int UIcons1 = (vector unsigned int)(0xFFFFFFFE, 0xFFFFFFFF, 0, 1);
1765 vector unsigned int UIcons2 = (vector unsigned int)(1, 1, 1, 1);
1766 vector unsigned int UIcons3 = (vector unsigned int)(1, 2, 1, 2);
1768 #if defined TEST_FLOATS
1769 vector float Fcons1 = (vector float)(-1.5, 1.0, 0.5, -3.999);
1770 vector float Fcons2 = (vector float)(1.0, 1.0, 1.0, 1.0);
1771 vector float Fcons3 = (vector float)(100000000000.0, 1.0, -1.0, -1234567890.0);
1772 #endif
1774 #endif
1777 /* Variables to be allocated with calloc_vec (16 bytes aligned) */
1778 unsigned char *UCmem = (unsigned char*)calloc_vec( 1, sizeof(vector unsigned char) );
1779 signed char *Cmem = (signed char*)calloc_vec( 1, sizeof(vector signed char) );
1780 unsigned short *USmem = (unsigned short*)calloc_vec( 1, sizeof(vector unsigned short) );
1781 signed short *Smem = (signed short*)calloc_vec( 1, sizeof(vector signed short) );
1782 unsigned int *UImem = (unsigned int*)calloc_vec( 1, sizeof(vector unsigned int) );
1783 signed int *Imem = (signed int*)calloc_vec( 1, sizeof(vector signed int) );
1784 #if defined TEST_FLOATS
1785 float *Fmem = (float*)calloc_vec( 1, sizeof(vector float) );
1786 #endif
1788 /* Function vec_dss */
1789 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1790 printf("Function vec_dss [Vector data Stream Stop] not checked\n");
1792 /* Function vec_dssall */
1793 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1794 printf("Function vec_dssall [Vector Stream Stop all] not checked\n");
1796 /* Function vec_dst */
1797 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1798 printf("Function vec_dst [Vector Data Stream Touch] not checked\n");
1800 /* Function vec_dstst */
1801 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1802 printf("Function vec_dstst [Vector Data Stream Touch for Store] not checked\n");
1804 /* Function vec_dststt */
1805 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1806 printf("Function vec_dststt [Vector Data Stream Touch for Store Transient] not checked\n");
1808 /* Function vec_dstt */
1809 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1810 printf("Function vec_dstt [Vector Data Stream Touch Transient] not checked\n");
1812 #if defined TEST_FLOATS
1813 /* Function vec_expte */
1814 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1815 err = 0;
1816 Faux1.v = vec_expte( Fcons1 );
1817 Faux2.v = Fcons1;
1818 for( i=0; i< 4; i++ )
1820 Faux = pow(2,Faux2.e[i]);
1822 Ivec1 = (signed int*)(&Faux1.e[i]);
1823 Ivec2 = (signed int*)(&Faux);
1824 *Ivec1 = (*Ivec1) & 0xFFF00000;
1825 *Ivec2 = (*Ivec2) & 0xFFF00000;
1826 if (Faux1.e[i] != Faux)
1827 err++;
1829 Faux = (Faux - Faux1.e[i])/Faux;
1830 if (Faux>0.1)
1831 err++;
1833 if (err)
1834 printf("Function vec_expte [type float] ===> Error\n");
1835 else
1836 printf("Function vec_expte [type float] ===> OK\n");
1837 #endif
1839 #if defined TEST_FLOATS
1840 /* Function vec_floor */
1841 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1842 err = 0;
1843 Faux1.v = vec_floor( Fcons1 );
1844 Faux2.v = Fcons1;
1845 for( i=0; i< 4; i++ )
1846 if (Faux1.e[i] != floor(Faux2.e[i]))
1847 err++;
1848 if (err)
1849 printf("Function vec_floor [type float] ===> Error\n");
1850 else
1851 printf("Function vec_floor [type float] ===> OK\n");
1852 #endif
1854 /* Function vec_ld */
1855 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1856 err = 0;
1857 memcpy( UCmem, &UCcons1, sizeof(vector unsigned char) );
1858 UCaux1.v = vec_ld( 0, UCmem );
1859 Iaux = 1;
1860 for ( i=0; i< 16; i++ )
1862 Iaux = Iaux && (UCaux1.e[i]==UCmem[i]);
1864 if (Iaux!=1) err++;
1866 if (err)
1867 printf("Function vec_ld [type unsigned char] ===> Error\n");
1868 else
1869 printf("Function vec_ld [type unsigned char] ===> OK\n");
1871 err = 0;
1872 memcpy( Cmem, &Ccons1, sizeof(vector signed char) );
1873 Caux1.v = vec_ld( 0, Cmem );
1874 Iaux = 1;
1875 for ( i=0; i< 16; i++ )
1877 Iaux = Iaux && (Caux1.e[i]==Cmem[i]);
1879 if (Iaux!=1) err++;
1881 if (err)
1882 printf("Function vec_ld [type char] ===> Error\n");
1883 else
1884 printf("Function vec_ld [type char] ===> OK\n");
1886 err = 0;
1887 memcpy( USmem, &UScons3, sizeof(vector unsigned short) );
1888 USaux1.v = vec_ld( 0, USmem );
1889 Iaux = 1;
1890 for ( i=0; i< 8; i++ )
1892 Iaux = Iaux && (USaux1.e[i]==USmem[i]);
1894 if (Iaux!=1) err++;
1896 if (err)
1897 printf("Function vec_ld [type unsigned short] ===> Error\n");
1898 else
1899 printf("Function vec_ld [type unsigned short] ===> OK\n");
1901 err = 0;
1902 memcpy( Smem, &Scons1, sizeof(vector signed short) );
1903 Saux1.v = vec_ld( 0, Smem );
1904 Iaux = 1;
1905 for ( i=0; i< 8; i++ )
1907 Iaux = Iaux && (Saux1.e[i]==Smem[i]);
1909 if (Iaux!=1) err++;
1911 if (err)
1912 printf("Function vec_ld [type short] ===> Error\n");
1913 else
1914 printf("Function vec_ld [type short] ===> OK\n");
1916 err = 0;
1917 memcpy( UImem, &UIcons1, sizeof(vector unsigned int) );
1918 UIaux1.v = vec_ld( 0, UImem );
1919 Iaux = 1;
1920 for ( i=0; i< 4; i++ )
1922 Iaux = Iaux && (UIaux1.e[i]==UImem[i]);
1924 if (Iaux!=1) err++;
1926 if (err)
1927 printf("Function vec_ld [type unsigned int] ===> Error\n");
1928 else
1929 printf("Function vec_ld [type unsigned int] ===> OK\n");
1931 err = 0;
1932 memcpy( Imem, &Icons1, sizeof(vector signed int) );
1933 Iaux1.v = vec_ld( 0, Imem );
1934 Iaux = 1;
1935 for ( i=0; i< 4; i++ )
1937 Iaux = Iaux && (Iaux1.e[i]==Imem[i]);
1939 if (Iaux!=1) err++;
1941 if (err)
1942 printf("Function vec_ld [type int] ===> Error\n");
1943 else
1944 printf("Function vec_ld [type int] ===> OK\n");
1946 #if defined TEST_FLOATS
1947 err = 0;
1948 memcpy( Fmem, &Fcons1, sizeof(vector float) );
1949 Faux1.v = vec_ld( 0, Fmem );
1950 Iaux = 1;
1951 for ( i=0; i< 4; i++ )
1953 Iaux = Iaux && (Faux1.e[i]==Fmem[i]);
1955 if (Iaux!=1) err++;
1957 if (err)
1958 printf("Function vec_ld [type float] ===> Error\n");
1959 else
1960 printf("Function vec_ld [type float] ===> OK\n");
1961 #endif
1963 /* Function vec_lde */
1964 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
1966 err = 0;
1967 for (i= 0; i< 16; i++)
1968 UCmem[i] = (unsigned char)i;
1969 j = 1;
1970 i = j*sizeof(unsigned char);
1971 UCaux1.v = vec_lde( i, UCmem );
1973 if (UCaux1.e[j] != UCmem[j]) err++;
1975 if (err)
1976 printf("Function vec_lde [type unsigned char] ===> Error\n");
1977 else
1978 printf("Function vec_lde [type unsigned char] ===> OK\n");
1980 err = 0;
1981 for (i= 0; i< 16; i++)
1982 Cmem[i] = (char)(-i);
1983 j = 1;
1984 i = j*sizeof(char);
1985 Caux1.v = vec_lde( i, Cmem );
1987 if (Caux1.e[j] != Cmem[j]) err++;
1989 if (err)
1990 printf("Function vec_lde [type char] ===> Error\n");
1991 else
1992 printf("Function vec_lde [type char] ===> OK\n");
1994 err = 0;
1995 for (i= 0; i< 8; i++)
1996 USmem[i] = (unsigned short)(i);
1997 j = 1;
1998 i = j*sizeof(unsigned short);
1999 USaux1.v = vec_lde( i, USmem );
2001 if (USaux1.e[j] != USmem[j]) err++;
2003 if (err)
2004 printf("Function vec_lde [type unsigned short] ===> Error\n");
2005 else
2006 printf("Function vec_lde [type unsigned short] ===> OK\n");
2008 err = 0;
2009 for (i= 0; i< 8; i++)
2010 Smem[i] = (short)(-i);
2011 j = 1;
2012 i = j*sizeof(short);
2013 Saux1.v = vec_lde( i, Smem );
2015 if (Saux1.e[j] != Smem[j]) err++;
2017 if (err)
2018 printf("Function vec_lde [type short] ===> Error\n");
2019 else
2020 printf("Function vec_lde [type short] ===> OK\n");
2022 err = 0;
2023 for (i= 0; i< 4; i++)
2024 UImem[i] = (unsigned int)(i);
2025 j = 1;
2026 i = j*sizeof(unsigned int);
2027 UIaux1.v = vec_lde( i, UImem );
2029 if (UIaux1.e[j] != UImem[j]) err++;
2031 if (err)
2032 printf("Function vec_lde [type unsigned int] ===> Error\n");
2033 else
2034 printf("Function vec_lde [type unsigned int] ===> OK\n");
2036 err = 0;
2037 for (i= 0; i< 4; i++)
2038 Imem[i] = (int)(-i);
2039 j = 1;
2040 i = j*sizeof(int);
2041 Iaux1.v = vec_lde( i, Imem );
2043 if (Iaux1.e[j] != Imem[j]) err++;
2045 if (err)
2046 printf("Function vec_lde [type int] ===> Error\n");
2047 else
2048 printf("Function vec_lde [type int] ===> OK\n");
2050 #if defined TEST_FLOATS
2051 err = 0;
2052 for (i= 0; i< 4; i++)
2053 Fmem[i] = ((float)(-i)) - 0.5;
2054 j = 1;
2055 i = j*sizeof(float);
2056 Faux1.v = vec_lde( i, Fmem );
2058 if (Faux1.e[j] != Fmem[j]) err++;
2060 if (err)
2061 printf("Function vec_lde [type float] ===> Error\n");
2062 else
2063 printf("Function vec_lde [type float] ===> OK\n");
2064 #endif
2066 #if 0
2067 /* Function vec_ldl */
2068 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2069 err = 0;
2070 memcpy( UCmem, &UCcons1, sizeof(vector unsigned char) );
2071 UCaux1.v = vec_ldl( 0, UCmem );
2072 Iaux = 1;
2073 for ( i=0; i< 16; i++ )
2075 Iaux = Iaux && (UCaux1.e[i]==UCmem[i]);
2077 if (Iaux!=1) err++;
2079 if (err)
2080 printf("Function vec_ldl [type unsigned char] ===> Error\n");
2081 else
2082 printf("Function vec_ldl [type unsigned char] ===> OK\n");
2084 err = 0;
2085 memcpy( Cmem, &Ccons1, sizeof(vector signed char) );
2086 Caux1.v = vec_ldl( 0, Cmem );
2087 Iaux = 1;
2088 for ( i=0; i< 16; i++ )
2090 Iaux = Iaux && (Caux1.e[i]==Cmem[i]);
2092 if (Iaux!=1) err++;
2094 if (err)
2095 printf("Function vec_ldl [type char] ===> Error\n");
2096 else
2097 printf("Function vec_ldl [type char] ===> OK\n");
2099 err = 0;
2100 memcpy( USmem, &UScons3, sizeof(vector unsigned short) );
2101 USaux1.v = vec_ldl( 0, USmem );
2102 Iaux = 1;
2103 for ( i=0; i< 8; i++ )
2105 Iaux = Iaux && (USaux1.e[i]==USmem[i]);
2107 if (Iaux!=1) err++;
2109 if (err)
2110 printf("Function vec_ldl [type unsigned short] ===> Error\n");
2111 else
2112 printf("Function vec_ldl [type unsigned short] ===> OK\n");
2114 err = 0;
2115 memcpy( Smem, &Scons1, sizeof(vector signed short) );
2116 Saux1.v = vec_ldl( 0, Smem );
2117 Iaux = 1;
2118 for ( i=0; i< 8; i++ )
2120 Iaux = Iaux && (Saux1.e[i]==Smem[i]);
2122 if (Iaux!=1) err++;
2124 if (err)
2125 printf("Function vec_ldl [type short] ===> Error\n");
2126 else
2127 printf("Function vec_ldl [type short] ===> OK\n");
2129 err = 0;
2130 memcpy( UImem, &UIcons1, sizeof(vector unsigned int) );
2131 UIaux1.v = vec_ldl( 0, UImem );
2132 Iaux = 1;
2133 for ( i=0; i< 4; i++ )
2135 Iaux = Iaux && (UIaux1.e[i]==UImem[i]);
2137 if (Iaux!=1) err++;
2139 if (err)
2140 printf("Function vec_ldl [type unsigned int] ===> Error\n");
2141 else
2142 printf("Function vec_ldl [type unsigned int] ===> OK\n");
2144 err = 0;
2145 memcpy( Imem, &Icons1, sizeof(vector signed int) );
2146 Iaux1.v = vec_ldl( 0, Imem );
2147 Iaux = 1;
2148 for ( i=0; i< 4; i++ )
2150 Iaux = Iaux && (Iaux1.e[i]==Imem[i]);
2152 if (Iaux!=1) err++;
2154 if (err)
2155 printf("Function vec_ldl [type int] ===> Error\n");
2156 else
2157 printf("Function vec_ldl [type int] ===> OK\n");
2159 #if defined TEST_FLOATS
2160 err = 0;
2161 memcpy( Fmem, &Fcons1, sizeof(vector float) );
2162 Faux1.v = vec_ldl( 0, Fmem );
2163 Iaux = 1;
2164 for ( i=0; i< 4; i++ )
2166 Iaux = Iaux && (Faux1.e[i]==Fmem[i]);
2168 if (Iaux!=1) err++;
2170 if (err)
2171 printf("Function vec_ldl [type float] ===> Error\n");
2172 else
2173 printf("Function vec_ldl [type float] ===> OK\n");
2174 #endif
2175 #endif // #if 0
2177 /* Free dynamic vector variables */
2178 free_vec( UCmem );
2179 free_vec( Cmem );
2180 free_vec( USmem );
2181 free_vec( Smem );
2182 free_vec( UImem );
2183 free_vec( Imem );
2184 #if defined TEST_FLOATS
2185 free_vec( Fmem );
2186 #endif
2188 #if defined TEST_FLOATS
2189 /* Function vec_loge */
2190 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2191 err = 0;
2192 Faux1.v = vec_loge( Fcons3 );
2193 Faux2.v = Fcons3;
2194 for( i=0; i< 4; i++ )
2196 Faux = log2(Faux2.e[i]);
2197 if (Faux!=0.0)
2198 Faux = (Faux - Faux1.e[i])/Faux;
2199 else
2200 Faux = Faux - Faux1.e[i];
2201 if (Faux>0.1)
2202 err++;
2204 if (err)
2205 printf("Function vec_loge [type float] ===> Error\n");
2206 else
2207 printf("Function vec_loge [type float] ===> OK\n");
2208 #endif
2210 return 0;
2216 int part2()
2218 TvecChar Caux1, Caux2, Caux3;//, Caux4;
2219 TvecUChar UCaux1, UCaux2, UCaux3;//, UCaux4;
2220 TvecShort Saux1, Saux2, Saux3, Saux4;
2221 TvecUShort USaux1, USaux2, USaux3, USaux4;
2222 TvecInt Iaux1, Iaux2, Iaux3;//, Iaux4;
2223 TvecUInt UIaux1, UIaux2, UIaux3;//, UIaux4;
2224 #if defined TEST_FLOATS
2225 TvecFloat Faux1, Faux2, Faux3, Faux4;
2226 #endif
2228 int i, err, j, b, bAux;
2229 #if defined TEST_FLOATS
2230 signed int Ivec1, Ivec2, Ivec3;
2231 #endif
2232 // signed short *Svec1;
2233 // unsigned int *UIvec1;
2234 // unsigned short *USvec1;
2235 // unsigned char *UCvec1;
2236 #if defined TEST_FLOATS
2237 // float *Fvec1;
2238 #endif
2240 /* For saturated rutines */
2241 // long long int LLaux;
2243 #if defined TEST_FLOATS
2244 float Faux;
2245 #endif
2246 signed int Iaux, I1, I2;
2247 unsigned int UIaux, UI1, UI2;
2248 signed short Saux;
2249 unsigned short USaux;
2250 signed char Caux;
2251 unsigned char UCaux;
2253 union
2255 float f;
2256 signed int si;
2257 unsigned int ui;
2258 signed short ss[2];
2259 unsigned short us[2];
2260 signed char sc[4];
2261 unsigned char uc[4];
2262 } INTunion1;//, INTunion2;
2265 union
2267 signed short ss;
2268 unsigned short us;
2269 signed char sc[2];
2270 unsigned char uc[2];
2271 } SHOunion1, SHOunion2;
2274 #if defined (GCC_COMPILER)
2275 vector signed char Ccons1 = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
2276 vector signed char Ccons2 = (vector signed char){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
2277 // vector signed char Ccons3 = (vector signed char){-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127};
2278 vector unsigned char UCcons1 = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7};
2279 vector unsigned char UCcons2 = (vector unsigned char){2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
2280 // vector unsigned char UCcons3 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
2281 vector signed short Scons1 = (vector signed short){256, 320, 340, -1, 0, 1, 2, 3};
2282 vector signed short Scons2 = (vector signed short){256, 320, 340, 1, 1, 1, -10000, -10000};
2283 vector signed short Scons3 = (vector signed short){256, 320, 340, 32767, -32768, 32767, -32768, 32767};
2284 vector unsigned short UScons1 = (vector unsigned short){65532, 65533, 65534, 65535, 0, 1, 2, 3};
2285 vector unsigned short UScons2 = (vector unsigned short){1, 1, 1, 1, 1, 1, 1, 1};
2286 vector unsigned short UScons3 = (vector unsigned short){1, 2, 3, 4, 1, 2, 3, 4};
2287 vector signed int Icons1 = (vector signed int){-4, -1, 1, 4};
2288 vector signed int Icons2 = (vector signed int){1, 1, 1, 1};
2289 vector signed int Icons3 = (vector signed int){0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF};
2290 vector unsigned int UIcons1 = (vector unsigned int){0xFFFFFFFE, 0xFFFFFFFF, 0, 1};
2291 vector unsigned int UIcons2 = (vector unsigned int){1, 1, 1, 1};
2292 vector unsigned int UIcons3 = (vector unsigned int){1, 2, 1, 2};
2294 #if defined TEST_FLOATS
2295 vector float Fcons1 = (vector float){-1.5, 1.0, 0.5, -3.999};
2296 vector float Fcons2 = (vector float){1.0, 1.0, 1.0, 1.0};
2297 vector float Fcons3 = (vector float){100000000000.0, 1.0, -1.0, -1234567890.0};
2298 #endif
2300 #elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
2301 vector signed char Ccons1 = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
2302 vector signed char Ccons2 = (vector signed char)(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
2303 vector signed char Ccons3 = (vector signed char)(-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127);
2304 vector unsigned char UCcons1 = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7);
2305 vector unsigned char UCcons2 = (vector unsigned char)(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
2306 // vector unsigned char UCcons3 = (vector unsigned char)(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
2307 vector signed short Scons1 = (vector signed short)(-4, -3, -2, -1, 0, 1, 2, 3);
2308 vector signed short Scons2 = (vector signed short)(-32768, 10000, 1, 1, 1, 1, -10000, -10000);
2309 vector signed short Scons3 = (vector signed short)(-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767);
2310 vector unsigned short UScons1 = (vector unsigned short)(65532, 65533, 65534, 65535, 0, 1, 2, 3);
2311 vector unsigned short UScons2 = (vector unsigned short)(1, 1, 1, 1, 1, 1, 1, 1);
2312 vector unsigned short UScons3 = (vector unsigned short)(1, 2, 3, 4, 1, 2, 3, 4);
2313 vector signed int Icons1 = (vector signed int)(-4, -1, 1, 4);
2314 vector signed int Icons2 = (vector signed int)(1, 1, 1, 1);
2315 vector signed int Icons3 = (vector signed int)(0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF);
2316 vector unsigned int UIcons1 = (vector unsigned int)(0xFFFFFFFE, 0xFFFFFFFF, 0, 1);
2317 vector unsigned int UIcons2 = (vector unsigned int)(1, 1, 1, 1);
2318 vector unsigned int UIcons3 = (vector unsigned int)(1, 2, 1, 2);
2320 #if defined TEST_FLOATS
2321 vector float Fcons1 = (vector float)(-1.5, 1.0, 0.5, -3.999);
2322 vector float Fcons2 = (vector float)(1.0, 1.0, 1.0, 1.0);
2323 vector float Fcons3 = (vector float)(100000000000.0, 1.0, -1.0, -1234567890.0);
2324 #endif
2326 #endif
2329 /* Function vec_lvsl */
2330 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2331 err = 0;
2332 b = 3;
2333 UCaux1.v = vec_lvsl( b, &b);
2334 bAux = b + (size_t)(&b);
2335 b = bAux & 0xF;
2336 # if defined(GCC_COMPILER)
2337 UCaux2.v =(vector unsigned char){0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF};
2338 # elif defined(MAC_COMPILER) || defined (XLC_COMPILER)
2339 UCaux2.v =(vector unsigned char)(0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF);
2340 # endif
2341 for( i=0; i< 16; i++ )
2343 UCaux = UCaux2.e[i]+b;
2344 if (UCaux1.e[i] != UCaux)
2345 err++;
2347 if (err)
2348 printf("Function vec_lvsl [type unsigned char] ===> Error\n");
2349 else
2350 printf("Function vec_lvsl [type unsigned char] ===> OK\n");
2352 /* Function vec_lvsr */
2353 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2354 err = 0;
2355 b = 3;
2356 UCaux1.v = vec_lvsr( b, &b);
2357 bAux = b + (size_t)(&b);
2358 b = bAux & 0xF;
2359 # if defined (GCC_COMPILER)
2360 UCaux2.v =(vector unsigned char){0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F};
2361 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
2362 UCaux2.v =(vector unsigned char)(0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F);
2363 # endif
2364 for( i=0; i< 16; i++ )
2366 UCaux = UCaux2.e[i]-b;
2367 if (UCaux1.e[i] != UCaux)
2368 err++;
2370 if (err)
2371 printf("Function vec_lvsr [type unsigned char] ===> Error\n");
2372 else
2373 printf("Function vec_lvsr [type unsigned char] ===> OK\n");
2375 #if defined TEST_FLOATS
2376 /* Function vec_madd */
2377 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2378 err = 0;
2379 Faux1.v = vec_madd( Fcons1, Fcons2, Fcons3 );
2380 Faux2.v = Fcons1;
2381 Faux3.v = Fcons2;
2382 Faux4.v = Fcons3;
2383 for( i=0; i< 4; i++ )
2384 if (Faux1.e[i] != (Faux2.e[i]*Faux3.e[i]+Faux4.e[i]))
2385 err++;
2386 if (err)
2387 printf("Function vec_madd [type float] ===> Error\n");
2388 else
2389 printf("Function vec_madd [type float] ===> OK\n");
2390 #endif
2392 /* Function vec_madds */
2393 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2394 err = 0;
2395 Saux1.v = vec_madds( Scons1, Scons3, Scons2 );
2396 Saux2.v = Scons1;
2397 Saux3.v = Scons3;
2398 Saux4.v = Scons2;
2399 for( i=0; i< 8; i++ )
2401 INTunion1.si = Saux2.e[i]*Saux3.e[i];
2402 INTunion1.si = INTunion1.si >> 15;
2403 INTunion1.si = INTunion1.si + Saux4.e[i];
2404 if (INTunion1.si>32767)
2405 Saux=0x7FFF;
2406 else if (INTunion1.si<(-32768))
2407 Saux=0x8000;
2408 else
2409 Saux= INTunion1.ss[1];
2410 if (Saux1.e[i] != Saux)
2411 err++;
2413 if (err)
2414 printf("Function vec_madds [type short] ===> Error\n");
2415 else
2416 printf("Function vec_madds [type short] ===> OK\n");
2418 /* Function vec_max */
2419 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2420 err = 0;
2421 Caux1.v = vec_max( Ccons1, Ccons2 );
2422 Caux2.v = Ccons1;
2423 Caux3.v = Ccons2;
2424 for( i=0; i< 16; i++ )
2426 if (Caux2.e[i]>Caux3.e[i])
2427 Caux = Caux2.e[i];
2428 else
2429 Caux = Caux3.e[i];
2430 if (Caux1.e[i] != Caux)
2431 err++;
2433 if (err)
2434 printf("Function vec_max [type char] ===> Error\n");
2435 else
2436 printf("Function vec_max [type char] ===> OK\n");
2438 err = 0;
2439 UCaux1.v = vec_max( UCcons1, UCcons2 );
2440 UCaux2.v = UCcons1;
2441 UCaux3.v = UCcons2;
2442 for( i=0; i< 16; i++ )
2444 if (UCaux2.e[i]>UCaux3.e[i])
2445 UCaux = UCaux2.e[i];
2446 else
2447 UCaux = UCaux3.e[i];
2448 if (UCaux1.e[i] != UCaux)
2449 err++;
2451 if (err)
2452 printf("Function vec_max [type unsigned char] ===> Error\n");
2453 else
2454 printf("Function vec_max [type unsigned char] ===> OK\n");
2456 err = 0;
2457 Saux1.v = vec_max( Scons1, Scons3 );
2458 Saux2.v = Scons1;
2459 Saux3.v = Scons3;
2460 for( i=0; i< 8; i++ )
2462 if (Saux2.e[i]>Saux3.e[i])
2463 Saux = Saux2.e[i];
2464 else
2465 Saux = Saux3.e[i];
2466 if (Saux1.e[i] != Saux)
2467 err++;
2469 if (err)
2470 printf("Function vec_max [type short] ===> Error\n");
2471 else
2472 printf("Function vec_max [type short] ===> OK\n");
2474 err = 0;
2475 USaux1.v = vec_max( UScons1, UScons2 );
2476 USaux2.v = UScons1;
2477 USaux3.v = UScons2;
2478 for( i=0; i< 8; i++ )
2480 if (USaux2.e[i]>USaux3.e[i])
2481 USaux = USaux2.e[i];
2482 else
2483 USaux = USaux3.e[i];
2484 if (USaux1.e[i] != USaux)
2485 err++;
2487 if (err)
2488 printf("Function vec_max [type unsigned short] ===> Error\n");
2489 else
2490 printf("Function vec_max [type unsigned short] ===> OK\n");
2492 err = 0;
2493 Iaux1.v = vec_max( Icons1, Icons2 );
2494 Iaux2.v = Icons1;
2495 Iaux3.v = Icons2;
2496 for( i=0; i< 4; i++ )
2498 if (Iaux2.e[i]>Iaux3.e[i])
2499 Iaux = Iaux2.e[i];
2500 else
2501 Iaux = Iaux3.e[i];
2502 if (Iaux1.e[i] != Iaux)
2503 err++;
2505 if (err)
2506 printf("Function vec_max [type integer] ===> Error\n");
2507 else
2508 printf("Function vec_max [type integer] ===> OK\n");
2510 err = 0;
2511 UIaux1.v = vec_max( UIcons1, UIcons2 );
2512 UIaux2.v = UIcons1;
2513 UIaux3.v = UIcons2;
2514 for( i=0; i< 4; i++ )
2516 if (UIaux2.e[i]>UIaux3.e[i])
2517 UIaux = UIaux2.e[i];
2518 else
2519 UIaux = UIaux3.e[i];
2520 if (UIaux1.e[i] != UIaux)
2521 err++;
2523 if (err)
2524 printf("Function vec_max [type unsigned int] ===> Error\n");
2525 else
2526 printf("Function vec_max [type unsigned int] ===> OK\n");
2528 #if defined TEST_FLOATS
2529 err = 0;
2530 Faux1.v = vec_max( Fcons1, Fcons2 );
2531 Faux2.v = Fcons1;
2532 Faux3.v = Fcons2;
2533 for( i=0; i< 4; i++ )
2535 if (Faux2.e[i]>Faux3.e[i])
2536 Faux = Faux2.e[i];
2537 else
2538 Faux = Faux3.e[i];
2539 if (Faux1.e[i] != Faux)
2540 err++;
2542 if (err)
2543 printf("Function vec_max [type float] ===> Error\n");
2544 else
2545 printf("Function vec_max [type float] ===> OK\n");
2546 #endif
2548 /* Function vec_mergeh */
2549 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2550 err = 0;
2551 Caux1.v = vec_mergeh( Ccons1, Ccons2 );
2552 Caux2.v = Ccons1;
2553 Caux3.v = Ccons2;
2554 for( i=0; i< 8; i++ )
2555 if ((Caux1.e[2*i] != Caux2.e[i])||(Caux1.e[2*i+1]!=Caux3.e[i]))
2556 err++;
2557 if (err)
2558 printf("Function vec_mergeh [type char] ===> Error\n");
2559 else
2560 printf("Function vec_mergeh [type char] ===> OK\n");
2562 err = 0;
2563 UCaux1.v = vec_mergeh( UCcons1, UCcons2 );
2564 UCaux2.v = UCcons1;
2565 UCaux3.v = UCcons2;
2566 for( i=0; i< 8; i++ )
2567 if ((UCaux1.e[2*i] != UCaux2.e[i])||(UCaux1.e[2*i+1]!=UCaux3.e[i]))
2568 err++;
2569 if (err)
2570 printf("Function vec_mergeh [type unsigned char] ===> Error\n");
2571 else
2572 printf("Function vec_mergeh [type unsigned char] ===> OK\n");
2574 err = 0;
2575 Saux1.v = vec_mergeh( Scons1, Scons2 );
2576 Saux2.v = Scons1;
2577 Saux3.v = Scons2;
2578 for( i=0; i< 4; i++ )
2579 if ((Saux1.e[2*i] != Saux2.e[i])||(Saux1.e[2*i+1]!=Saux3.e[i]))
2580 err++;
2581 if (err)
2582 printf("Function vec_mergeh [type short] ===> Error\n");
2583 else
2584 printf("Function vec_mergeh [type short] ===> OK\n");
2586 err = 0;
2587 USaux1.v = vec_mergeh( UScons1, UScons2 );
2588 USaux2.v = UScons1;
2589 USaux3.v = UScons2;
2590 for( i=0; i< 4; i++ )
2591 if ((USaux1.e[2*i] != USaux2.e[i])||(USaux1.e[2*i+1]!=USaux3.e[i]))
2592 err++;
2593 if (err)
2594 printf("Function vec_mergeh [type unsigned short] ===> Error\n");
2595 else
2596 printf("Function vec_mergeh [type unsigned short] ===> OK\n");
2598 err = 0;
2599 Iaux1.v = vec_mergeh( Icons1, Icons2 );
2600 Iaux2.v = Icons1;
2601 Iaux3.v = Icons2;
2602 for( i=0; i< 2; i++ )
2603 if ((Iaux1.e[2*i] != Iaux2.e[i])||(Iaux1.e[2*i+1]!=Iaux3.e[i]))
2604 err++;
2605 if (err)
2606 printf("Function vec_mergeh [type integer] ===> Error\n");
2607 else
2608 printf("Function vec_mergeh [type integer] ===> OK\n");
2610 err = 0;
2611 UIaux1.v = vec_mergeh( UIcons1, UIcons2 );
2612 UIaux2.v = UIcons1;
2613 UIaux3.v = UIcons2;
2614 for( i=0; i< 2; i++ )
2615 if ((UIaux1.e[2*i] != UIaux2.e[i])||(UIaux1.e[2*i+1]!=UIaux3.e[i]))
2616 err++;
2617 if (err)
2618 printf("Function vec_mergeh [type unsigned int] ===> Error\n");
2619 else
2620 printf("Function vec_mergeh [type unsigned int] ===> OK\n");
2622 #if defined TEST_FLOATS
2623 err = 0;
2624 Faux1.v = vec_mergeh( Fcons1, Fcons2 );
2625 Faux2.v = Fcons1;
2626 Faux3.v = Fcons2;
2627 for( i=0; i< 2; i++ )
2628 if ((Faux1.e[2*i] != Faux2.e[i])||(Faux1.e[2*i+1]!=Faux3.e[i]))
2629 err++;
2630 if (err)
2631 printf("Function vec_mergeh [type float] ===> Error\n");
2632 else
2633 printf("Function vec_mergeh [type float] ===> OK\n");
2634 #endif
2636 /* Function vec_mergel */
2637 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2638 err = 0;
2639 Caux1.v = vec_mergel( Ccons1, Ccons2 );
2640 Caux2.v = Ccons1;
2641 Caux3.v = Ccons2;
2642 for( i=0; i< 8; i++ )
2643 if ((Caux1.e[2*i] != Caux2.e[i+8])||(Caux1.e[2*i+1]!=Caux3.e[i+8]))
2644 err++;
2645 if (err)
2646 printf("Function vec_mergel [type char] ===> Error\n");
2647 else
2648 printf("Function vec_mergel [type char] ===> OK\n");
2650 err = 0;
2651 UCaux1.v = vec_mergel( UCcons1, UCcons2 );
2652 UCaux2.v = UCcons1;
2653 UCaux3.v = UCcons2;
2654 for( i=0; i< 8; i++ )
2655 if ((UCaux1.e[2*i] != UCaux2.e[i+8])||(UCaux1.e[2*i+1]!=UCaux3.e[i+8]))
2656 err++;
2657 if (err)
2658 printf("Function vec_mergel [type unsigned char] ===> Error\n");
2659 else
2660 printf("Function vec_mergel [type unsigned char] ===> OK\n");
2662 err = 0;
2663 Saux1.v = vec_mergel( Scons1, Scons2 );
2664 Saux2.v = Scons1;
2665 Saux3.v = Scons2;
2666 for( i=0; i< 4; i++ )
2667 if ((Saux1.e[2*i] != Saux2.e[i+4])||(Saux1.e[2*i+1]!=Saux3.e[i+4]))
2668 err++;
2669 if (err)
2670 printf("Function vec_mergel [type short] ===> Error\n");
2671 else
2672 printf("Function vec_mergel [type short] ===> OK\n");
2674 err = 0;
2675 USaux1.v = vec_mergel( UScons1, UScons2 );
2676 USaux2.v = UScons1;
2677 USaux3.v = UScons2;
2678 for( i=0; i< 4; i++ )
2679 if ((USaux1.e[2*i] != USaux2.e[i+4])||(USaux1.e[2*i+1]!=USaux3.e[i+4]))
2680 err++;
2681 if (err)
2682 printf("Function vec_mergel [type unsigned short] ===> Error\n");
2683 else
2684 printf("Function vec_mergel [type unsigned short] ===> OK\n");
2686 err = 0;
2687 Iaux1.v = vec_mergel( Icons1, Icons2 );
2688 Iaux2.v = Icons1;
2689 Iaux3.v = Icons2;
2690 for( i=0; i< 2; i++ )
2691 if ((Iaux1.e[2*i] != Iaux2.e[i+2])||(Iaux1.e[2*i+1]!=Iaux3.e[i+2]))
2692 err++;
2693 if (err)
2694 printf("Function vec_mergel [type integer] ===> Error\n");
2695 else
2696 printf("Function vec_mergel [type integer] ===> OK\n");
2698 err = 0;
2699 UIaux1.v = vec_mergel( UIcons1, UIcons2 );
2700 UIaux2.v = UIcons1;
2701 UIaux3.v = UIcons2;
2702 for( i=0; i< 2; i++ )
2703 if ((UIaux1.e[2*i] != UIaux2.e[i+2])||(UIaux1.e[2*i+1]!=UIaux3.e[i+2]))
2704 err++;
2705 if (err)
2706 printf("Function vec_mergel [type unsigned int] ===> Error\n");
2707 else
2708 printf("Function vec_mergel [type unsigned int] ===> OK\n");
2710 #if defined TEST_FLOATS
2711 err = 0;
2712 Faux1.v = vec_mergel( Fcons1, Fcons2 );
2713 Faux2.v = Fcons1;
2714 Faux3.v = Fcons2;
2715 for( i=0; i< 2; i++ )
2716 if ((Faux1.e[2*i] != Faux2.e[i+2])||(Faux1.e[2*i+1]!=Faux3.e[i+2]))
2717 err++;
2718 if (err)
2719 printf("Function vec_mergel [type float] ===> Error\n");
2720 else
2721 printf("Function vec_mergel [type float] ===> OK\n");
2722 #endif
2724 /* Function vec_mfvscr */
2725 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2726 printf("Function vec_mfvscr [Vector Move from Vector Status and Control Register] not checked\n");
2728 /* Function vec_min */
2729 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2730 #ifndef XLC_COMPILER
2731 err = 0;
2732 Caux1.v = vec_min( Ccons1, Ccons2 );
2733 Caux2.v = Ccons1;
2734 Caux3.v = Ccons2;
2735 for( i=0; i< 8; i++ )
2737 if (Caux2.e[i]<Caux3.e[i])
2738 Caux = Caux2.e[i];
2739 else
2740 Caux = Caux3.e[i];
2741 if (Caux1.e[i] != Caux)
2742 err++;
2744 if (err)
2745 printf("Function vec_min [type char] ===> Error\n");
2746 else
2747 printf("Function vec_min [type char] ===> OK\n");
2748 #endif
2750 err = 0;
2751 UCaux1.v = vec_min( UCcons1, UCcons2 );
2752 UCaux2.v = UCcons1;
2753 UCaux3.v = UCcons2;
2754 for( i=0; i< 8; i++ )
2756 if (UCaux2.e[i]<UCaux3.e[i])
2757 UCaux = UCaux2.e[i];
2758 else
2759 UCaux = UCaux3.e[i];
2760 if (UCaux1.e[i] != UCaux)
2761 err++;
2763 if (err)
2764 printf("Function vec_min [type unsigned char] ===> Error\n");
2765 else
2766 printf("Function vec_min [type unsigned char] ===> OK\n");
2768 #ifndef XLC_COMPILER
2769 err = 0;
2770 Saux1.v = vec_min( Scons1, Scons2 );
2771 Saux2.v = Scons1;
2772 Saux3.v = Scons2;
2773 for( i=0; i< 8; i++ )
2775 if (Saux2.e[i]<Saux3.e[i])
2776 Saux = Saux2.e[i];
2777 else
2778 Saux = Saux3.e[i];
2779 if (Saux1.e[i] != Saux)
2780 err++;
2782 if (err)
2783 printf("Function vec_min [type short] ===> Error\n");
2784 else
2785 printf("Function vec_min [type short] ===> OK\n");
2787 err = 0;
2788 USaux1.v = vec_min( UScons1, UScons2 );
2789 USaux2.v = UScons1;
2790 USaux3.v = UScons2;
2791 for( i=0; i< 8; i++ )
2793 if (USaux2.e[i]<USaux3.e[i])
2794 USaux = USaux2.e[i];
2795 else
2796 USaux = USaux3.e[i];
2797 if (USaux1.e[i] != USaux)
2798 err++;
2800 if (err)
2801 printf("Function vec_min [type unsigned short] ===> Error\n");
2802 else
2803 printf("Function vec_min [type unsigned short] ===> OK\n");
2805 err = 0;
2806 Iaux1.v = vec_min( Icons1, Icons2 );
2807 Iaux2.v = Icons1;
2808 Iaux3.v = Icons2;
2809 for( i=0; i< 4; i++ )
2811 if (Iaux2.e[i]<Iaux3.e[i])
2812 Iaux = Iaux2.e[i];
2813 else
2814 Iaux = Iaux3.e[i];
2815 if (Iaux1.e[i] != Iaux)
2816 err++;
2818 if (err)
2819 printf("Function vec_min [type integer] ===> Error\n");
2820 else
2821 printf("Function vec_min [type integer] ===> OK\n");
2823 err = 0;
2824 UIaux1.v = vec_min( UIcons1, UIcons2 );
2825 UIaux2.v = UIcons1;
2826 UIaux3.v = UIcons2;
2827 for( i=0; i< 4; i++ )
2829 if (UIaux2.e[i]<UIaux3.e[i])
2830 UIaux = UIaux2.e[i];
2831 else
2832 UIaux = UIaux3.e[i];
2833 if (UIaux1.e[i] != UIaux)
2834 err++;
2836 if (err)
2837 printf("Function vec_min [type unsigned int] ===> Error\n");
2838 else
2839 printf("Function vec_min [type unsigned int] ===> OK\n");
2841 #if defined TEST_FLOATS
2842 err = 0;
2843 Faux1.v = vec_min( Fcons1, Fcons2 );
2844 Faux2.v = Fcons1;
2845 Faux3.v = Fcons2;
2846 for( i=0; i< 4; i++ )
2848 if (Faux2.e[i]<Faux3.e[i])
2849 Faux = Faux2.e[i];
2850 else
2851 Faux = Faux3.e[i];
2852 if (Faux1.e[i] != Faux)
2853 err++;
2855 if (err)
2856 printf("Function vec_min [type float] ===> Error\n");
2857 else
2858 printf("Function vec_min [type float] ===> OK\n");
2859 #endif
2861 #endif
2863 /* Function vec_mladd */
2864 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2865 #ifndef XLC_COMPILER
2866 err = 0;
2867 Saux1.v = vec_mladd( Scons1, Scons2, Scons3 );
2868 Saux2.v = Scons1;
2869 Saux3.v = Scons2;
2870 Saux4.v = Scons3;
2871 for( i=0; i< 8; i++ )
2873 INTunion1.si = Saux2.e[i]*Saux3.e[i];
2874 INTunion1.si = INTunion1.si + Saux4.e[i];
2875 if (Saux1.e[i] != INTunion1.ss[1])
2876 err++;
2878 if (err)
2879 printf("Function vec_mladd [type short] ===> Error\n");
2880 else
2881 printf("Function vec_mladd [type short] ===> OK\n");
2882 #endif
2884 err = 0;
2885 USaux1.v = vec_mladd( UScons1, UScons2, UScons3 );
2886 USaux2.v = UScons1;
2887 USaux3.v = UScons2;
2888 USaux4.v = UScons3;
2889 for( i=0; i< 8; i++ )
2891 INTunion1.ui = USaux2.e[i]*USaux3.e[i];
2892 INTunion1.ui = INTunion1.ui + USaux4.e[i];
2893 if (USaux1.e[i] != INTunion1.us[1])
2894 err++;
2896 if (err)
2897 printf("Function vec_mladd [type unsigned short] ===> Error\n");
2898 else
2899 printf("Function vec_mladd [type unsigned short] ===> OK\n");
2901 /* Function vec_mradds */
2902 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2903 err = 0;
2904 Saux1.v = vec_mradds( Scons1, Scons2, Scons3 );
2905 Saux2.v = Scons1;
2906 Saux3.v = Scons2;
2907 Saux4.v = Scons3;
2908 for( i=0; i< 8; i++ )
2910 INTunion1.si = Saux2.e[i]*Saux3.e[i]+0x4000;
2911 INTunion1.si = INTunion1.si >> 15;
2912 INTunion1.si = INTunion1.si + Saux4.e[i];
2913 if (INTunion1.si>32767)
2914 Saux = 0x7FFF;
2915 else if (INTunion1.si<(-32768))
2916 Saux = 0x8000;
2917 else
2918 Saux = INTunion1.ss[1];
2919 if (Saux1.e[i] != Saux)
2920 err++;
2922 printf("vector: %d \n", Saux1.e[i]);
2923 printf("scalar: %d \n", Saux);
2926 if (err)
2927 printf("Function vec_mradds [type short] ===> Error\n");
2928 else
2929 printf("Function vec_mradds [type short] ===> OK\n");
2931 /* Function vec_msum */
2932 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
2933 #ifndef XLC_COMPILER
2934 err = 0;
2935 Iaux1.v = vec_msum( Ccons1, UCcons2, Icons1 );
2936 Caux1.v = Ccons1;
2937 UCaux1.v = UCcons2;
2938 Iaux2.v = Icons1;
2939 for( i=0; i< 4; i++ )
2941 Iaux = Iaux2.e[i];
2942 for (j=0; j< 4; j++)
2943 Iaux = Iaux + Caux1.e[4*i+j]*UCaux1.e[4*i+j];
2944 if (Iaux1.e[i] != Iaux)
2945 err++;
2947 if (err)
2948 printf("Function vec_msum [type char] ===> Error\n");
2949 else
2950 printf("Function vec_msum [type char] ===> OK\n");
2951 #endif
2953 err = 0;
2954 UIaux1.v = vec_msum( UCcons1, UCcons2, UIcons1 );
2955 UCaux1.v = UCcons1;
2956 UCaux2.v = UCcons2;
2957 UIaux2.v = UIcons1;
2958 for( i=0; i< 4; i++ )
2960 UIaux = UIaux2.e[i];
2961 for (j=0; j< 4; j++)
2962 UIaux = UIaux + UCaux1.e[4*i+j]*UCaux2.e[4*i+j];
2963 if (UIaux1.e[i] != UIaux)
2964 err++;
2966 if (err)
2967 printf("Function vec_msum [type unsigned char] ===> Error\n");
2968 else
2969 printf("Function vec_msum [type unsigned char] ===> OK\n");
2971 #ifndef XLC_COMPILER
2972 err = 0;
2973 Iaux1.v = vec_msum( Scons1, Scons2, Icons1 );
2974 Saux1.v = Scons1;
2975 Saux2.v = Scons2;
2976 Iaux2.v = Icons1;
2977 for( i=0; i< 4; i++ )
2979 Iaux = Iaux2.e[i];
2980 for (j=0; j< 2; j++)
2981 Iaux = Iaux + Saux1.e[2*i+j]*Saux2.e[2*i+j];
2982 if (Iaux1.e[i] != Iaux)
2983 err++;
2985 if (err)
2986 printf("Function vec_msum [type short] ===> Error\n");
2987 else
2988 printf("Function vec_msum [type short] ===> OK\n");
2990 err = 0;
2991 UIaux1.v = vec_msum( UScons1, UScons2, UIcons1 );
2992 USaux1.v = UScons1;
2993 USaux2.v = UScons2;
2994 UIaux2.v = UIcons1;
2995 for( i=0; i< 4; i++ )
2997 UIaux = UIaux2.e[i];
2998 for (j=0; j< 2; j++)
2999 UIaux = UIaux + USaux1.e[2*i+j]*USaux2.e[2*i+j];
3000 if (UIaux1.e[i] != UIaux)
3001 err++;
3003 if (err)
3004 printf("Function vec_msum [type unsigned short] ===> Error\n");
3005 else
3006 printf("Function vec_msum [type unsigned short] ===> OK\n");
3007 #endif
3009 /* Function vec_msums */
3010 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3011 err = 0;
3012 Iaux1.v = vec_msums( Scons2, Scons3, Icons3 );
3013 Saux1.v = Scons2;
3014 Saux2.v = Scons3;
3015 Iaux2.v = Icons3;
3016 for( i=0; i< 4; i++ )
3018 I1 = Saux1.e[2*i]*Saux2.e[2*i];
3019 I2 = Saux1.e[2*i+1]*Saux2.e[2*i+1];
3020 Iaux = I1 + I2;
3021 if ((I1>0)&&(I2>0)&&(Iaux<0))
3022 Iaux=0x7FFFFFFF;
3023 else if ((I1<0)&&(I2<0)&&(Iaux>0))
3024 Iaux=0x80000000;
3025 I1 = Iaux2.e[i];
3026 I2 = Iaux;
3027 Iaux = I1 + I2;
3028 if ((I1>0)&&(I2>0)&&(Iaux<0))
3029 Iaux=0x7FFFFFFF;
3030 else if ((I1<0)&&(I2<0)&&(Iaux>0))
3031 Iaux=0x80000000;
3032 if (Iaux1.e[i] != Iaux)
3033 err++;
3035 if (err)
3036 printf("Function vec_msums [type short] ===> Error\n");
3037 else
3038 printf("Function vec_msums [type short] ===> OK\n");
3040 err = 0;
3041 UIaux1.v = vec_msums( UScons2, UScons3, UIcons3 );
3042 USaux1.v = UScons2;
3043 USaux2.v = UScons3;
3044 UIaux2.v = UIcons3;
3045 for( i=0; i< 4; i++ )
3047 UI1 = USaux1.e[2*i]*USaux2.e[2*i];
3048 UI2 = USaux1.e[2*i+1]*USaux2.e[2*i+1];
3049 UIaux = UI1 + UI2;
3050 if ((UIaux<UI1)||(UIaux<UI2))
3051 UIaux=0xFFFFFFFF;
3052 UI1 = UIaux2.e[i];
3053 UI2 = UIaux;
3054 UIaux = UI1 + UI2;
3055 if ((UIaux<UI1)||(UIaux<UI2))
3056 UIaux=0xFFFFFFFF;
3057 if (UIaux1.e[i] != UIaux)
3058 err++;
3060 if (err)
3061 printf("Function vec_msums [type unsigned short] ===> Error\n");
3062 else
3063 printf("Function vec_msums [type unsigned short] ===> OK\n");
3065 /* Function vec_mtvscr */
3066 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3067 printf("Function vec_mtvscr [Vector Move to Vector Status and Control Register] not checked\n");
3069 /* Function vec_mule */
3070 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3071 err = 0;
3072 Saux1.v = vec_mule( Ccons1, Ccons2 );
3073 Caux1.v = Ccons1;
3074 Caux2.v = Ccons2;
3075 for( i=0; i< 4; i++ )
3076 if (Saux1.e[i] != (Caux1.e[2*i]*Caux2.e[2*i]))
3077 err++;
3078 if (err)
3079 printf("Function vec_mule [type char] ===> Error\n");
3080 else
3081 printf("Function vec_mule [type char] ===> OK\n");
3083 err = 0;
3084 USaux1.v = vec_mule( UCcons1, UCcons2 );
3085 UCaux1.v = UCcons1;
3086 UCaux2.v = UCcons2;
3087 for( i=0; i< 4; i++ )
3088 if (USaux1.e[i] != (UCaux1.e[2*i]*UCaux2.e[2*i]))
3089 err++;
3090 if (err)
3091 printf("Function vec_mule [type unsigned char] ===> Error\n");
3092 else
3093 printf("Function vec_mule [type unsigned char] ===> OK\n");
3095 err = 0;
3096 Iaux1.v = vec_mule( Scons1, Scons2 );
3097 Saux1.v = Scons1;
3098 Saux2.v = Scons2;
3099 for( i=0; i< 4; i++ )
3100 if (Iaux1.e[i] != (Saux1.e[2*i]*Saux2.e[2*i]))
3101 err++;
3102 if (err)
3103 printf("Function vec_mule [type short] ===> Error\n");
3104 else
3105 printf("Function vec_mule [type short] ===> OK\n");
3107 err = 0;
3108 UIaux1.v = vec_mule( UScons1, UScons2 );
3109 USaux1.v = UScons1;
3110 USaux2.v = UScons2;
3111 for( i=0; i< 4; i++ )
3112 if (UIaux1.e[i] != (USaux1.e[2*i] * USaux2.e[2*i]))
3113 err++;
3114 if (err)
3115 printf("Function vec_mule [type unsigned short] ===> Error\n");
3116 else
3117 printf("Function vec_mule [type unsigned short] ===> OK\n");
3119 /* Function vec_mulo */
3120 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3121 err = 0;
3122 Saux1.v = vec_mulo( Ccons1, Ccons2 );
3123 Caux1.v = Ccons1;
3124 Caux2.v = Ccons2;
3125 for( i=0; i< 4; i++ )
3126 if (Saux1.e[i] != (Caux1.e[2*i+1]*Caux2.e[2*i+1]))
3127 err++;
3128 if (err)
3129 printf("Function vec_mulo [type char] ===> Error\n");
3130 else
3131 printf("Function vec_mulo [type char] ===> OK\n");
3133 err = 0;
3134 USaux1.v = vec_mulo( UCcons1, UCcons2 );
3135 UCaux1.v = UCcons1;
3136 UCaux2.v = UCcons2;
3137 for( i=0; i< 4; i++ )
3138 if (USaux1.e[i] != (UCaux1.e[2*i+1]*UCaux2.e[2*i+1]))
3139 err++;
3140 if (err)
3141 printf("Function vec_mulo [type unsigned char] ===> Error\n");
3142 else
3143 printf("Function vec_mulo [type unsigned char] ===> OK\n");
3145 err = 0;
3146 Iaux1.v = vec_mulo( Scons1, Scons2 );
3147 Saux1.v = Scons1;
3148 Saux2.v = Scons2;
3149 for( i=0; i< 4; i++ )
3150 if (Iaux1.e[i] != (Saux1.e[2*i+1]*Saux2.e[2*i+1]))
3151 err++;
3152 if (err)
3153 printf("Function vec_mulo [type short] ===> Error\n");
3154 else
3155 printf("Function vec_mulo [type short] ===> OK\n");
3157 err = 0;
3158 UIaux1.v = vec_mulo( UScons1, UScons2 );
3159 USaux1.v = UScons1;
3160 USaux2.v = UScons2;
3161 for( i=0; i< 4; i++ )
3162 if (UIaux1.e[i] != (USaux1.e[2*i+1]*USaux2.e[2*i+1]))
3163 err++;
3164 if (err)
3165 printf("Function vec_mulo [type unsigned short] ===> Error\n");
3166 else
3167 printf("Function vec_mulo [type unsigned short] ===> OK\n");
3169 #if defined TEST_FLOATS
3170 /* Function vec_nmsub */
3171 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3172 err = 0;
3173 Faux1.v = vec_nmsub( Fcons1, Fcons2, Fcons3 );
3174 Faux2.v = Fcons1;
3175 Faux3.v = Fcons2;
3176 Faux4.v = Fcons3;
3177 for( i=0; i< 4; i++ )
3179 if (Faux1.e[i] != (-Faux2.e[i]*Faux3.e[i]+Faux4.e[i]))
3180 err++;
3182 if (err)
3183 printf("Function vec_nmsub [type float] ===> Error\n");
3184 else
3185 printf("Function vec_nmsub [type float] ===> OK\n");
3186 #endif
3188 /* Function vec_nor */
3189 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3190 err = 0;
3191 Caux1.v = vec_nor( Ccons1, Ccons2 );
3192 Caux2.v = Ccons1;
3193 Caux3.v = Ccons2;
3194 for( i=0; i< 16; i++ )
3195 if (Caux1.e[i] != ~(Caux2.e[i] | Caux3.e[i]))
3196 err++;
3197 if (err)
3198 printf("Function vec_nor [type char] ===> Error\n");
3199 else
3200 printf("Function vec_nor [type char] ===> OK\n");
3202 err = 0;
3203 UCaux1.v = vec_nor( UCcons1, UCcons2 );
3204 UCaux2.v = UCcons1;
3205 UCaux3.v = UCcons2;
3206 for( i=0; i< 16; i++ )
3208 UCaux = UCaux2.e[i] | UCaux3.e[i];
3209 UCaux = ~UCaux;
3210 if (UCaux1.e[i] != UCaux )
3211 err++;
3213 if (err)
3214 printf("Function vec_nor [type unsigened char] ===> Error\n");
3215 else
3216 printf("Function vec_nor [type unsigened char] ===> OK\n");
3218 err = 0;
3219 Saux1.v = vec_nor( Scons1, Scons2 );
3220 Saux2.v = Scons1;
3221 Saux3.v = Scons2;
3222 for( i=0; i< 8; i++ )
3223 if (Saux1.e[i] != ~(Saux2.e[i] | Saux3.e[i]))
3224 err++;
3225 if (err)
3226 printf("Function vec_nor [type short] ===> Error\n");
3227 else
3228 printf("Function vec_nor [type short] ===> OK\n");
3230 err = 0;
3231 USaux1.v = vec_nor( UScons1, UScons2 );
3232 USaux2.v = UScons1;
3233 USaux3.v = UScons2;
3234 for( i=0; i< 8; i++ )
3236 USaux = USaux2.e[i] | USaux3.e[i];
3237 USaux = ~USaux;
3238 if (USaux1.e[i] != USaux )
3239 err++;
3241 if (err)
3242 printf("Function vec_nor [type unsigned short] ===> Error\n");
3243 else
3244 printf("Function vec_nor [type unsigned short] ===> OK\n");
3246 err = 0;
3247 Iaux1.v = vec_nor( Icons1, Icons2 );
3248 Iaux2.v = Icons1;
3249 Iaux3.v = Icons2;
3250 for( i=0; i< 4; i++ )
3251 if (Iaux1.e[i] != ~(Iaux2.e[i] | Iaux3.e[i]))
3252 err++;
3253 if (err)
3254 printf("Function vec_nor [type integer] ===> Error\n");
3255 else
3256 printf("Function vec_nor [type integer] ===> OK\n");
3258 err = 0;
3259 UIaux1.v = vec_nor( UIcons1, UIcons2 );
3260 UIaux2.v = UIcons1;
3261 UIaux3.v = UIcons2;
3262 for( i=0; i< 4; i++ )
3263 if (UIaux1.e[i] != ~(UIaux2.e[i] | UIaux3.e[i]))
3264 err++;
3265 if (err)
3266 printf("Function vec_nor [type unsigened int] ===> Error\n");
3267 else
3268 printf("Function vec_nor [type unsigened int] ===> OK\n");
3270 #if defined TEST_FLOATS
3271 err = 0;
3272 Faux1.v = vec_nor( Fcons1, Fcons2 );
3273 Faux2.v = Fcons1;
3274 Faux3.v = Fcons2;
3275 for( i=0; i< 4; i++ )
3277 Ivec1 = Faux1.i[i];
3278 Ivec2 = Faux2.i[i];
3279 Ivec3 = Faux3.i[i];
3280 if ((Ivec1) != ~((Ivec2) | (Ivec3)))
3281 err++;
3283 if (err)
3284 printf("Function vec_nor [type float] ===> Error\n");
3285 else
3286 printf("Function vec_nor [type float] ===> OK\n");
3287 #endif
3289 /* Function vec_or */
3290 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3291 err = 0;
3292 Caux1.v = vec_or( Ccons1, Ccons2 );
3293 Caux2.v = Ccons1;
3294 Caux3.v = Ccons2;
3295 for( i=0; i< 16; i++ )
3296 if (Caux1.e[i] != (Caux2.e[i] | Caux3.e[i]))
3297 err++;
3298 if (err)
3299 printf("Function vec_or [type char] ===> Error\n");
3300 else
3301 printf("Function vec_or [type char] ===> OK\n");
3303 err = 0;
3304 UCaux1.v = vec_or( UCcons1, UCcons2 );
3305 UCaux2.v = UCcons1;
3306 UCaux3.v = UCcons2;
3307 for( i=0; i< 16; i++ )
3309 UCaux = UCaux2.e[i] | UCaux3.e[i];
3310 if (UCaux1.e[i] != UCaux )
3311 err++;
3313 if (err)
3314 printf("Function vec_or [type unsigened char] ===> Error\n");
3315 else
3316 printf("Function vec_or [type unsigened char] ===> OK\n");
3318 err = 0;
3319 Saux1.v = vec_or( Scons1, Scons2 );
3320 Saux2.v = Scons1;
3321 Saux3.v = Scons2;
3322 for( i=0; i< 8; i++ )
3323 if (Saux1.e[i] != (Saux2.e[i] | Saux3.e[i]))
3324 err++;
3325 if (err)
3326 printf("Function vec_or [type short] ===> Error\n");
3327 else
3328 printf("Function vec_or [type short] ===> OK\n");
3330 err = 0;
3331 USaux1.v = vec_or( UScons1, UScons2 );
3332 USaux2.v = UScons1;
3333 USaux3.v = UScons2;
3334 for( i=0; i< 8; i++ )
3336 USaux = USaux2.e[i] | USaux3.e[i];
3337 if (USaux1.e[i] != USaux )
3338 err++;
3340 if (err)
3341 printf("Function vec_or [type unsigned short] ===> Error\n");
3342 else
3343 printf("Function vec_or [type unsigned short] ===> OK\n");
3345 err = 0;
3346 Iaux1.v = vec_or( Icons1, Icons2 );
3347 Iaux2.v = Icons1;
3348 Iaux3.v = Icons2;
3349 for( i=0; i< 4; i++ )
3350 if (Iaux1.e[i] != (Iaux2.e[i] | Iaux3.e[i]))
3351 err++;
3352 if (err)
3353 printf("Function vec_or [type integer] ===> Error\n");
3354 else
3355 printf("Function vec_or [type integer] ===> OK\n");
3357 err = 0;
3358 UIaux1.v = vec_or( UIcons1, UIcons2 );
3359 UIaux2.v = UIcons1;
3360 UIaux3.v = UIcons2;
3361 for( i=0; i< 4; i++ )
3362 if (UIaux1.e[i] != (UIaux2.e[i] | UIaux3.e[i]))
3363 err++;
3364 if (err)
3365 printf("Function vec_or [type unsigened int] ===> Error\n");
3366 else
3367 printf("Function vec_or [type unsigened int] ===> OK\n");
3369 #if defined TEST_FLOATS
3370 err = 0;
3371 Faux1.v = vec_or( Fcons1, Fcons2 );
3372 Faux2.v = Fcons1;
3373 Faux3.v = Fcons2;
3374 for( i=0; i< 4; i++ )
3376 Ivec1 = Faux1.i[i];
3377 Ivec2 = Faux2.i[i];
3378 Ivec3 = Faux3.i[i];
3379 if ((Ivec1) != ((Ivec2) | (Ivec3)))
3380 err++;
3382 if (err)
3383 printf("Function vec_or [type float] ===> Error\n");
3384 else
3385 printf("Function vec_or [type float] ===> OK\n");
3386 #endif
3388 return 0;
3394 int part3( )
3396 TvecChar Caux1, Caux2, Caux3;//, Caux4;
3397 TvecUChar UCaux1, UCaux2, UCaux3, UCaux4;
3398 TvecShort Saux1, Saux2, Saux3;//, Saux4;
3399 TvecUShort USaux1, USaux2, USaux3, USaux4;
3400 TvecInt Iaux1, Iaux2, Iaux3;//, Iaux4;
3401 TvecUInt UIaux1, UIaux2, UIaux3, UIaux4;
3402 #if defined TEST_FLOATS
3403 TvecFloat Faux1, Faux2, Faux3;//, Faux4;
3404 #endif
3406 int i, err, /*j,*/ b;//, bAux;
3407 #if defined TEST_FLOATS
3408 signed int Ivec1, Ivec2;//, Ivec3;
3409 #endif
3410 // signed short *Svec1;
3411 unsigned int *UIvec1;
3412 unsigned short *USvec1;
3413 unsigned char *UCvec1;
3414 #if defined TEST_FLOATS
3415 // float *Fvec1;
3416 #endif
3418 /* For saturated rutines */
3419 // long long int LLaux;
3421 #if defined TEST_FLOATS
3422 float Faux;
3423 #endif
3424 signed int Iaux;//, I1, I2;
3425 unsigned int UIaux;//, UI1, UI2;
3426 signed short Saux;
3427 unsigned short USaux;
3428 signed char Caux;
3429 unsigned char UCaux;
3431 union
3433 float f;
3434 signed int si;
3435 unsigned int ui;
3436 signed short ss[2];
3437 unsigned short us[2];
3438 signed char sc[4];
3439 unsigned char uc[4];
3440 } INTunion1, INTunion2;
3442 union
3444 signed short ss;
3445 unsigned short us;
3446 signed char sc[2];
3447 unsigned char uc[2];
3448 } SHOunion1, SHOunion2;
3451 #if defined (GCC_COMPILER)
3452 vector signed char Ccons1 = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
3453 vector signed char Ccons2 = (vector signed char){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
3454 vector signed char Ccons3 = (vector signed char){-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127};
3455 vector unsigned char UCcons1 = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7};
3456 vector unsigned char UCcons2 = (vector unsigned char){2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
3457 vector unsigned char UCcons3 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
3458 vector signed short Scons1 = (vector signed short){-4, -3, -2, -1, 0, 1, 2, 3};
3459 vector signed short Scons2 = (vector signed short){-32768, 10000, 1, 1, 1, 1, -10000, -10000};
3460 vector signed short Scons3 = (vector signed short){-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767};
3461 vector unsigned short UScons1 = (vector unsigned short){65532, 65533, 65534, 65535, 0, 1, 2, 3};
3462 vector unsigned short UScons2 = (vector unsigned short){1, 1, 1, 1, 1, 1, 1, 1};
3463 vector unsigned short UScons3 = (vector unsigned short){1, 2, 3, 4, 1, 2, 3, 4};
3464 vector signed int Icons1 = (vector signed int){-4, -1, 1, 4};
3465 vector signed int Icons2 = (vector signed int){1, 1, 1, 1};
3466 vector signed int Icons3 = (vector signed int){0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF};
3467 vector unsigned int UIcons1 = (vector unsigned int){0xFFFFFFFE, 0xFFFFFFFF, 0, 1};
3468 vector unsigned int UIcons2 = (vector unsigned int){1, 1, 1, 1};
3469 vector unsigned int UIcons3 = (vector unsigned int){1, 2, 1, 2};
3471 #if defined TEST_FLOATS
3472 vector float Fcons1 = (vector float){-1.5, 1.0, 0.5, -3.999};
3473 vector float Fcons2 = (vector float){1.0, 1.0, 1.0, 1.0};
3474 vector float Fcons3 = (vector float){100000000000.0, 1.0, -1.0, -1234567890.0};
3475 #endif
3477 #elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
3478 vector signed char Ccons1 = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
3479 vector signed char Ccons2 = (vector signed char)(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
3480 vector signed char Ccons3 = (vector signed char)(-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127);
3481 vector unsigned char UCcons1 = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7);
3482 vector unsigned char UCcons2 = (vector unsigned char)(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
3483 vector unsigned char UCcons3 = (vector unsigned char)(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
3484 vector signed short Scons1 = (vector signed short)(-4, -3, -2, -1, 0, 1, 2, 3);
3485 vector signed short Scons2 = (vector signed short)(-32768, 10000, 1, 1, 1, 1, -10000, -10000);
3486 vector signed short Scons3 = (vector signed short)(-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767);
3487 vector unsigned short UScons1 = (vector unsigned short)(65532, 65533, 65534, 65535, 0, 1, 2, 3);
3488 vector unsigned short UScons2 = (vector unsigned short)(1, 1, 1, 1, 1, 1, 1, 1);
3489 vector unsigned short UScons3 = (vector unsigned short)(1, 2, 3, 4, 1, 2, 3, 4);
3490 vector signed int Icons1 = (vector signed int)(-4, -1, 1, 4);
3491 vector signed int Icons2 = (vector signed int)(1, 1, 1, 1);
3492 vector signed int Icons3 = (vector signed int)(0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF);
3493 vector unsigned int UIcons1 = (vector unsigned int)(0xFFFFFFFE, 0xFFFFFFFF, 0, 1);
3494 vector unsigned int UIcons2 = (vector unsigned int)(1, 1, 1, 1);
3495 vector unsigned int UIcons3 = (vector unsigned int)(1, 2, 1, 2);
3497 #if defined TEST_FLOATS
3498 vector float Fcons1 = (vector float)(-1.5, 1.0, 0.5, -3.999);
3499 vector float Fcons2 = (vector float)(1.0, 1.0, 1.0, 1.0);
3500 vector float Fcons3 = (vector float)(100000000000.0, 1.0, -1.0, -1234567890.0);
3501 #endif
3503 #endif
3506 /* Variables to be allocated with calloc_vec (16 bytes aligned) */
3507 unsigned char *UCmem = (unsigned char*)calloc_vec( 1, sizeof(vector unsigned char) );
3508 signed char *Cmem = (signed char*)calloc_vec( 1, sizeof(vector signed char) );
3509 unsigned short *USmem = (unsigned short*)calloc_vec( 1, sizeof(vector unsigned short) );
3510 signed short *Smem = (signed short*)calloc_vec( 1, sizeof(vector signed short) );
3511 unsigned int *UImem = (unsigned int*)calloc_vec( 1, sizeof(vector unsigned int) );
3512 signed int *Imem = (signed int*)calloc_vec( 1, sizeof(vector signed int) );
3513 #if defined TEST_FLOATS
3514 float *Fmem = (float*)calloc_vec( 1, sizeof(vector float) );
3515 #endif
3517 /* Function vec_pack */
3518 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3519 err = 0;
3520 Caux1.v = vec_pack( Scons1, Scons2 );
3521 Saux1.v = Scons1;
3522 Saux2.v = Scons2;
3523 for( i=0; i< 8; i++ )
3525 SHOunion1.ss = Saux1.e[i];
3526 if (Caux1.e[i] != SHOunion1.sc[1])
3527 err++;
3528 SHOunion1.ss = Saux2.e[i];
3529 if (Caux1.e[i+8] != SHOunion1.sc[1])
3530 err++;
3532 if (err)
3533 printf("Function vec_pack [type char] ===> Error\n");
3534 else
3535 printf("Function vec_pack [type char] ===> OK\n");
3537 err = 0;
3538 UCaux1.v = vec_pack( UScons1, UScons2 );
3539 USaux1.v = UScons1;
3540 USaux2.v = UScons2;
3541 for( i=0; i< 8; i++ )
3543 SHOunion1.ss = USaux1.e[i];
3544 if (UCaux1.e[i] != SHOunion1.uc[1])
3545 err++;
3546 SHOunion1.ss = USaux2.e[i];
3547 if (UCaux1.e[i+8] != SHOunion1.uc[1])
3548 err++;
3550 if (err)
3551 printf("Function vec_pack [type unsigned char] ===> Error\n");
3552 else
3553 printf("Function vec_pack [type unsigned char] ===> OK\n");
3555 err = 0;
3556 Saux1.v = vec_pack( Icons1, Icons2 );
3557 Iaux1.v = Icons1;
3558 Iaux2.v = Icons2;
3559 for( i=0; i< 4; i++ )
3561 INTunion1.si = Iaux1.e[i];
3562 if (Saux1.e[i] != INTunion1.ss[1])
3563 err++;
3564 INTunion1.si = Iaux2.e[i];
3565 if (Saux1.e[i+4] != INTunion1.ss[1])
3566 err++;
3568 if (err)
3569 printf("Function vec_pack [type short] ===> Error\n");
3570 else
3571 printf("Function vec_pack [type short] ===> OK\n");
3573 err = 0;
3574 USaux1.v = vec_pack( UIcons1, UIcons2 );
3575 UIaux1.v = UIcons1;
3576 UIaux2.v = UIcons2;
3577 for( i=0; i< 4; i++ )
3579 INTunion1.ui = UIaux1.e[i];
3580 if (USaux1.e[i] != INTunion1.us[1])
3581 err++;
3582 INTunion1.ui = UIaux2.e[i];
3583 if (USaux1.e[i+4] != INTunion1.us[1])
3584 err++;
3586 if (err)
3587 printf("Function vec_pack [type unsigned short] ===> Error\n");
3588 else
3589 printf("Function vec_pack [type unsigned short] ===> OK\n");
3591 /* Function vec_packpx */
3592 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3593 printf("Function vec_packpx [Vector Pack Pixel] not checked\n");
3595 /* Function vec_packs */
3596 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3597 err = 0;
3598 Caux1.v = vec_packs( Scons1, Scons2 );
3599 Saux1.v = Scons1;
3600 Saux2.v = Scons2;
3601 for( i=0; i< 8; i++ )
3603 if (Saux1.e[i]>127)
3604 Caux = 127;
3605 else if (Saux1.e[i]<(-128))
3606 Caux = -128;
3607 else
3608 Caux = (signed char)Saux1.e[i];
3609 if (Caux1.e[i] != Caux)
3610 err++;
3611 if (Saux2.e[i]>127)
3612 Caux = 127;
3613 else if (Saux2.e[i]<(-128))
3614 Caux = -128;
3615 else
3616 Caux = (signed char)Saux2.e[i];
3617 if (Caux1.e[i+8] != Caux)
3618 err++;
3620 if (err)
3621 printf("Function vec_packs [type char] ===> Error\n");
3622 else
3623 printf("Function vec_packs [type char] ===> OK\n");
3625 err = 0;
3626 UCaux1.v = vec_packs( UScons1, UScons2 );
3627 USaux1.v = UScons1;
3628 USaux2.v = UScons2;
3629 for( i=0; i< 8; i++ )
3631 if (USaux1.e[i]>255)
3632 UCaux = 255;
3633 else
3634 UCaux = (unsigned char)USaux1.e[i];
3635 if (UCaux1.e[i] != UCaux)
3636 err++;
3637 if (USaux2.e[i]>255)
3638 UCaux = 255;
3639 else
3640 UCaux = (unsigned char)USaux2.e[i];
3641 if (UCaux1.e[i+8] != UCaux)
3642 err++;
3644 if (err)
3645 printf("Function vec_packs [type unsigned char] ===> Error\n");
3646 else
3647 printf("Function vec_packs [type unsigned char] ===> OK\n");
3649 err = 0;
3650 Saux1.v = vec_packs( Icons1, Icons2 );
3651 Iaux1.v = Icons1;
3652 Iaux2.v = Icons2;
3653 for( i=0; i< 4; i++ )
3655 if (Iaux1.e[i]>32767)
3656 Saux = 32767;
3657 else if (Iaux1.e[i]<(-32768))
3658 Saux = -32768;
3659 else
3660 Saux = (signed char)Iaux1.e[i];
3661 if (Saux1.e[i] != Saux)
3662 err++;
3663 if (Iaux2.e[i]>32767)
3664 Saux = 32767;
3665 else if (Iaux2.e[i]<(-32768))
3666 Saux = -32768;
3667 else
3668 Saux = (signed char)Iaux2.e[i];
3669 if (Saux1.e[i+4] != Saux)
3670 err++;
3672 if (err)
3673 printf("Function vec_packs [type short] ===> Error\n");
3674 else
3675 printf("Function vec_packs [type short] ===> OK\n");
3677 err = 0;
3678 USaux1.v = vec_packs( UIcons1, UIcons2 );
3679 UIaux1.v = UIcons1;
3680 UIaux2.v = UIcons2;
3681 for( i=0; i< 4; i++ )
3683 if (UIaux1.e[i]>65535)
3684 USaux = 65535;
3685 else
3686 USaux = (unsigned char)UIaux1.e[i];
3687 if (USaux1.e[i] != USaux)
3688 err++;
3689 if (UIaux2.e[i]>65535)
3690 USaux = 65535;
3691 else
3692 USaux = (unsigned char)UIaux2.e[i];
3693 if (USaux1.e[i+4] != USaux)
3694 err++;
3696 if (err)
3697 printf("Function vec_packs [type unsigned short] ===> Error\n");
3698 else
3699 printf("Function vec_packs [type unsigned short] ===> OK\n");
3701 /* Function vec_packsu */
3702 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3703 err = 0;
3704 UCaux1.v = vec_packsu( Scons1, Scons2 );
3705 Saux1.v = Scons1;
3706 Saux2.v = Scons2;
3707 for( i=0; i< 8; i++ )
3709 if (Saux1.e[i]>255)
3710 UCaux = 255;
3711 else if (Saux1.e[i]<0)
3712 UCaux = 0;
3713 else
3714 UCaux = (unsigned char)Saux1.e[i];
3715 if (UCaux1.e[i] != UCaux)
3716 err++;
3717 if (Saux2.e[i]>255)
3718 UCaux = 255;
3719 else if (Saux2.e[i]<0)
3720 UCaux = 0;
3721 else
3722 UCaux = (unsigned char)Saux2.e[i];
3723 if (UCaux1.e[i+8] != UCaux)
3724 err++;
3726 if (err)
3727 printf("Function vec_packsu [type char] ===> Error\n");
3728 else
3729 printf("Function vec_packsu [type char] ===> OK\n");
3731 err = 0;
3732 UCaux1.v = vec_packsu( UScons1, UScons2 );
3733 USaux1.v = UScons1;
3734 USaux2.v = UScons2;
3735 for( i=0; i< 8; i++ )
3737 if (USaux1.e[i]>255)
3738 UCaux = 255;
3739 else
3740 UCaux = (unsigned char)USaux1.e[i];
3741 if (UCaux1.e[i] != UCaux)
3742 err++;
3743 if (USaux2.e[i]>255)
3744 UCaux = 255;
3745 else
3746 UCaux = (unsigned char)USaux2.e[i];
3747 if (UCaux1.e[i+8] != UCaux)
3748 err++;
3750 if (err)
3751 printf("Function vec_packsu [type unsigned char] ===> Error\n");
3752 else
3753 printf("Function vec_packsu [type unsigned char] ===> OK\n");
3755 err = 0;
3756 USaux1.v = vec_packsu( Icons1, Icons2 );
3757 Iaux1.v = Icons1;
3758 Iaux2.v = Icons2;
3759 for( i=0; i< 4; i++ )
3761 if (Iaux1.e[i]>65535)
3762 USaux = 65535;
3763 else if (Iaux1.e[i]<0)
3764 USaux = 0;
3765 else
3766 USaux = (unsigned short)Iaux1.e[i];
3767 if (USaux1.e[i] != USaux)
3768 err++;
3769 if (Iaux2.e[i]>65535)
3770 USaux = 65535;
3771 else if (Iaux2.e[i]<0)
3772 USaux = 0;
3773 else
3774 USaux = (unsigned short)Iaux2.e[i];
3775 if (USaux1.e[i+4] != USaux)
3776 err++;
3778 if (err)
3779 printf("Function vec_packsu [type short] ===> Error\n");
3780 else
3781 printf("Function vec_packsu [type short] ===> OK\n");
3783 err = 0;
3784 USaux1.v = vec_packsu( UIcons1, UIcons2 );
3785 UIaux1.v = UIcons1;
3786 UIaux2.v = UIcons2;
3787 for( i=0; i< 4; i++ )
3789 if (UIaux1.e[i]>65535)
3790 USaux = 65535;
3791 else
3792 USaux = (unsigned char)UIaux1.e[i];
3793 if (USaux1.e[i] != USaux)
3794 err++;
3795 if (UIaux2.e[i]>65535)
3796 USaux = 65535;
3797 else
3798 USaux = (unsigned char)UIaux2.e[i];
3799 if (USaux1.e[i+4] != USaux)
3800 err++;
3802 if (err)
3803 printf("Function vec_packsu [type unsigned short] ===> Error\n");
3804 else
3805 printf("Function vec_packsu [type unsigned short] ===> OK\n");
3807 /* Function vec_perm */
3808 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3809 printf("Function vec_perm [Vector Permute] not checked\n");
3811 #if defined TEST_FLOATS
3812 /* Function vec_re */
3813 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3814 err = 0;
3815 Faux1.v = vec_re( Fcons1 );
3816 Faux2.v = Fcons1;
3817 for( i=0; i< 4; i++ )
3819 Faux = 1/Faux2.e[i];
3820 if (Faux!=0.0)
3821 Faux = (Faux - Faux1.e[i])/Faux;
3822 else
3823 Faux = Faux - Faux1.e[i];
3824 if (Faux>(1.0/4096.0))
3825 err++;
3827 if (err)
3828 printf("Function vec_re [type float] ===> Error\n");
3829 else
3830 printf("Function vec_re [type float] ===> OK\n");
3831 #endif
3833 /* Function vec_rl */
3834 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3835 err = 0;
3836 Caux1.v = vec_rl( Ccons1, UCcons3 );
3837 Caux2.v = Ccons1;
3838 UCaux1.v = UCcons3;
3839 for( i=0; i< 16; i++ )
3841 b = UCaux1.e[i];
3842 UCvec1 = (unsigned char *)(&Caux2.e[i]);
3843 Caux = ((*UCvec1)>>(8-b)) | ((*UCvec1)<<b);
3844 if (Caux1.e[i] != Caux)
3845 err++;
3847 if (err)
3848 printf("Function vec_rl [type char] ===> Error\n");
3849 else
3850 printf("Function vec_rl [type char] ===> OK\n");
3852 err = 0;
3853 UCaux1.v = vec_rl( UCcons1, UCcons3 );
3854 UCaux2.v = UCcons1;
3855 UCaux3.v = UCcons3;
3856 for( i=0; i< 16; i++ )
3858 b = UCaux3.e[i];
3859 UCaux = (UCaux2.e[i]>>(8-b)) | (UCaux2.e[i]<<b);
3860 if (UCaux1.e[i] != UCaux)
3861 err++;
3863 if (err)
3864 printf("Function vec_rl [type unsigned char] ===> Error\n");
3865 else
3866 printf("Function vec_rl [type unsigned char] ===> OK\n");
3868 err = 0;
3869 Saux1.v = vec_rl( Scons1, UScons3 );
3870 Saux2.v = Scons1;
3871 USaux1.v = UScons3;
3872 for( i=0; i< 8; i++ )
3874 b = USaux1.e[i];
3875 USvec1 = (unsigned short *)(&Saux2.e[i]);
3876 Saux = ((*USvec1)>>(16-b)) | ((*USvec1)<<b);
3877 if (Saux1.e[i] != Saux)
3878 err++;
3880 if (err)
3881 printf("Function vec_rl [type short] ===> Error\n");
3882 else
3883 printf("Function vec_rl [type short] ===> OK\n");
3885 err = 0;
3886 USaux1.v = vec_rl( UScons1, UScons3 );
3887 USaux2.v = UScons1;
3888 USaux3.v = UScons3;
3889 for( i=0; i< 8; i++ )
3891 b = USaux3.e[i];
3892 USaux = (USaux2.e[i]>>(16-b)) | (USaux2.e[i]<<b);
3893 if (USaux1.e[i] != USaux)
3894 err++;
3896 if (err)
3897 printf("Function vec_rl [type unsigned short] ===> Error\n");
3898 else
3899 printf("Function vec_rl [type unsigned short] ===> OK\n");
3901 err = 0;
3902 Iaux1.v = vec_rl( Icons1, UIcons3 );
3903 Iaux2.v = Icons1;
3904 UIaux1.v = UIcons3;
3905 for( i=0; i< 4; i++ )
3907 b = UIaux1.e[i];
3908 UIvec1 = (unsigned int *)(&Iaux2.e[i]);
3909 Iaux = ((*UIvec1)>>(32-b)) | ((*UIvec1)<<b);
3910 if (Iaux1.e[i] != Iaux)
3911 err++;
3913 if (err)
3914 printf("Function vec_rl [type integer] ===> Error\n");
3915 else
3916 printf("Function vec_rl [type integer] ===> OK\n");
3918 err = 0;
3919 UIaux1.v = vec_rl( UIcons1, UIcons3 );
3920 UIaux2.v = UIcons1;
3921 UIaux3.v = UIcons3;
3922 for( i=0; i< 4; i++ )
3924 b = UIaux3.e[i];
3925 UIaux = (UIaux2.e[i]>>(32-b)) | (UIaux2.e[i]<<b);
3926 if (UIaux1.e[i] != UIaux)
3927 err++;
3929 if (err)
3930 printf("Function vec_rl [type unsigned int] ===> Error\n");
3931 else
3932 printf("Function vec_rl [type unsigned int] ===> OK\n");
3934 #if defined TEST_FLOATS
3935 /* Function vec_round */
3936 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3937 err = 0;
3938 Faux1.v = vec_round( Fcons1 );
3939 Faux2.v = Fcons1;
3940 for( i=0; i< 4; i++ )
3942 Faux = floor(Faux2.e[i]);
3943 if ((Faux2.e[i]-Faux)>0.5)
3944 Faux = Faux + 1.0;
3945 else if (((Faux2.e[i]-Faux)==0.5)&&(Iaux%2))
3946 Faux = Faux + 1.0;
3947 if (Faux1.e[i] != Faux)
3948 err++;
3950 if (err)
3951 printf("Function vec_round [type float] ===> Error\n");
3952 else
3953 printf("Function vec_round [type float] ===> OK\n");
3954 #endif
3956 #if defined TEST_FLOATS
3957 /* Function vec_rsqrte */
3958 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3959 err = 0;
3960 Faux1.v = vec_rsqrte( Fcons1 );
3961 Faux2.v = Fcons1;
3962 for( i=0; i< 4; i++ )
3964 Faux = sqrtf(Faux2.e[i]);
3965 if (Faux>0.0)
3966 Faux = (Faux - Faux1.e[i])/Faux;
3967 else if (Faux==0.0)
3968 Faux = Faux - Faux1.e[i];
3969 if (Faux>(1.0/4096.0))
3970 err++;
3972 if (err)
3973 printf("Function vec_rsqrte [type float] ===> Error\n");
3974 else
3975 printf("Function vec_rsqrte [type float] ===> OK\n");
3976 #endif
3978 /* Function vec_sel */
3979 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
3980 err = 0;
3981 Caux1.v = vec_sel( Ccons1, Ccons2, UCcons1 );
3982 Caux2.v = Ccons1;
3983 Caux3.v = Ccons2;
3984 UCaux1.v = UCcons1;
3985 for( i=0; i< 16; i++ )
3987 Caux = (Caux2.e[i] & (~UCaux1.e[i])) | (Caux3.e[i] & UCaux1.e[i]);
3988 if (Caux1.e[i] != Caux)
3989 err++;
3991 if (err)
3992 printf("Function vec_sel [type char] ===> Error\n");
3993 else
3994 printf("Function vec_sel [type char] ===> OK\n");
3996 err = 0;
3997 UCaux1.v = vec_sel( UCcons1, UCcons2, UCcons3 );
3998 UCaux2.v = UCcons1;
3999 UCaux3.v = UCcons2;
4000 UCaux4.v = UCcons3;
4001 for( i=0; i< 16; i++ )
4003 UCaux = (UCaux2.e[i] & (~UCaux4.e[i])) | (UCaux3.e[i] & UCaux4.e[i]);
4004 if (UCaux1.e[i] != UCaux)
4005 err++;
4007 if (err)
4008 printf("Function vec_sel [type unsigned char] ===> Error\n");
4009 else
4010 printf("Function vec_sel [type unsigned char] ===> OK\n");
4012 err = 0;
4013 Saux1.v = vec_sel( Scons1, Scons2, UScons1 );
4014 Saux2.v = Scons1;
4015 Saux3.v = Scons2;
4016 USaux1.v = UScons1;
4017 for( i=0; i< 8; i++ )
4019 Saux = (Saux2.e[i] & (~USaux1.e[i])) | (Saux3.e[i] & USaux1.e[i]);
4020 if (Saux1.e[i] != Saux)
4021 err++;
4023 if (err)
4024 printf("Function vec_sel [type short] ===> Error\n");
4025 else
4026 printf("Function vec_sel [type short] ===> OK\n");
4028 err = 0;
4029 USaux1.v = vec_sel( UScons1, UScons2, UScons3 );
4030 USaux2.v = UScons1;
4031 USaux3.v = UScons2;
4032 USaux4.v = UScons3;
4033 for( i=0; i< 8; i++ )
4035 USaux = (USaux2.e[i] & (~USaux4.e[i])) | (USaux3.e[i] & USaux4.e[i]);
4036 if (USaux1.e[i] != USaux)
4037 err++;
4039 if (err)
4040 printf("Function vec_sel [type unsigned short] ===> Error\n");
4041 else
4042 printf("Function vec_sel [type unsigned short] ===> OK\n");
4044 err = 0;
4045 Iaux1.v = vec_sel( Icons1, Icons2, UIcons1 );
4046 Iaux2.v = Icons1;
4047 Iaux3.v = Icons2;
4048 UIaux1.v = UIcons1;
4049 for( i=0; i< 4; i++ )
4051 Iaux = (Iaux2.e[i] & (~UIaux1.e[i])) | (Iaux3.e[i] & UIaux1.e[i]);
4052 if (Iaux1.e[i] != Iaux)
4053 err++;
4055 if (err)
4056 printf("Function vec_sel [type integer] ===> Error\n");
4057 else
4058 printf("Function vec_sel [type integer] ===> OK\n");
4060 err = 0;
4061 UIaux1.v = vec_sel( UIcons1, UIcons2, UIcons3 );
4062 UIaux2.v = UIcons1;
4063 UIaux3.v = UIcons2;
4064 UIaux4.v = UIcons3;
4065 for( i=0; i< 4; i++ )
4067 UIaux = (UIaux2.e[i] & (~UIaux4.e[i])) | (UIaux3.e[i] & UIaux4.e[i]);
4068 if (UIaux1.e[i] != UIaux)
4069 err++;
4071 if (err)
4072 printf("Function vec_sel [type unsigned int] ===> Error\n");
4073 else
4074 printf("Function vec_sel [type unsigned int] ===> OK\n");
4076 #if defined TEST_FLOATS
4077 err = 0;
4078 Faux1.v = vec_sel( Fcons1, Fcons2, UIcons1 );
4079 Faux2.v = Fcons1;
4080 Faux3.v = Fcons2;
4081 UIaux1.v = UIcons1;
4082 for( i=0; i< 4; i++ )
4084 Ivec1 = Faux2.i[i];
4085 Ivec2 = Faux3.i[i];
4086 Iaux = (Ivec1 & (~UIaux1.e[i])) | (Ivec2 & UIaux1.e[i]);
4087 Ivec1 = Faux1.i[i];
4088 if ((Ivec1) != Iaux)
4089 err++;
4091 if (err)
4092 printf("Function vec_sel [type float] ===> Error\n");
4093 else
4094 printf("Function vec_sel [type float] ===> OK\n");
4095 #endif
4097 /* Function vec_sl */
4098 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4099 err = 0;
4100 Caux1.v = vec_sl( Ccons1, UCcons3 );
4101 Caux2.v = Ccons1;
4102 UCaux1.v = UCcons3;
4103 for( i=0; i< 16; i++ )
4105 b = UCaux1.e[i]%(128/16);
4106 Caux = Caux2.e[i] << b;
4107 if (Caux1.e[i] != Caux)
4108 err++;
4110 if (err)
4111 printf("Function vec_sl [type char] ===> Error\n");
4112 else
4113 printf("Function vec_sl [type char] ===> OK\n");
4115 err = 0;
4116 UCaux1.v = vec_sl( UCcons1, UCcons3 );
4117 UCaux2.v = UCcons1;
4118 UCaux3.v = UCcons3;
4119 for( i=0; i< 16; i++ )
4121 b = UCaux3.e[i]%(128/16);
4122 UCaux = UCaux2.e[i] << b;
4123 if (UCaux1.e[i] != UCaux)
4124 err++;
4126 if (err)
4127 printf("Function vec_sl [type unsigned char] ===> Error\n");
4128 else
4129 printf("Function vec_sl [type unsigned char] ===> OK\n");
4131 err = 0;
4132 Saux1.v = vec_sl( Scons1, UScons3 );
4133 Saux2.v = Scons1;
4134 USaux1.v = UScons3;
4135 for( i=0; i< 8; i++ )
4137 b = USaux1.e[i]%(128/8);
4138 Saux = Saux2.e[i] << b;
4139 if (Saux1.e[i] != Saux)
4140 err++;
4142 if (err)
4143 printf("Function vec_sl [type short] ===> Error\n");
4144 else
4145 printf("Function vec_sl [type short] ===> OK\n");
4147 err = 0;
4148 USaux1.v = vec_sl( UScons1, UScons3 );
4149 USaux2.v = UScons1;
4150 USaux3.v = UScons3;
4151 for( i=0; i< 8; i++ )
4153 b = USaux3.e[i]%(128/8);
4154 USaux = USaux2.e[i] << b;
4155 if (USaux1.e[i] != USaux)
4156 err++;
4158 if (err)
4159 printf("Function vec_sl [type unsigned short] ===> Error\n");
4160 else
4161 printf("Function vec_sl [type unsigned short] ===> OK\n");
4163 err = 0;
4164 Iaux1.v = vec_sl( Icons1, UIcons3 );
4165 Iaux2.v = Icons1;
4166 UIaux1.v = UIcons3;
4167 for( i=0; i< 4; i++ )
4169 b = UIaux1.e[i]%(128/4);
4170 Iaux = Iaux2.e[i] << b;
4171 if (Iaux1.e[i] != Iaux)
4172 err++;
4174 if (err)
4175 printf("Function vec_sl [type int] ===> Error\n");
4176 else
4177 printf("Function vec_sl [type int] ===> OK\n");
4179 err = 0;
4180 UIaux1.v = vec_sl( UIcons1, UIcons3 );
4181 UIaux2.v = UIcons1;
4182 UIaux3.v = UIcons3;
4183 for( i=0; i< 4; i++ )
4185 b = UIaux3.e[i]%(128/4);
4186 UIaux = UIaux2.e[i] << b;
4187 if (UIaux1.e[i] != UIaux)
4188 err++;
4190 if (err)
4191 printf("Function vec_sl [type unsigned integer] ===> Error\n");
4192 else
4193 printf("Function vec_sl [type unsigned integer] ===> OK\n");
4195 /* Function vec_sld */
4196 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4197 err = 0;
4198 b = 3;
4199 Caux1.v = vec_sld( Ccons1, Ccons2, 3 );
4200 Caux2.v = Ccons1;
4201 Caux3.v = Ccons2;
4202 for( i=0; i< 16; i++ )
4204 if ((i+b)<16)
4206 if (Caux1.e[i] != Caux2.e[i+b])
4207 err++;
4209 else
4211 if (Caux1.e[i] != Caux3.e[i+b-16])
4212 err++;
4215 if (err)
4216 printf("Function vec_sld [type char] ===> Error\n");
4217 else
4218 printf("Function vec_sld [type char] ===> OK\n");
4220 err = 0;
4221 b = 3;
4222 UCaux1.v = vec_sld( UCcons1, UCcons2, 3 );
4223 UCaux2.v = UCcons1;
4224 UCaux3.v = UCcons2;
4225 for( i=0; i< 16; i++ )
4227 if ((i+b)<16)
4229 if (UCaux1.e[i] != UCaux2.e[i+b])
4230 err++;
4232 else
4234 if (UCaux1.e[i] != UCaux3.e[i+b-16])
4235 err++;
4238 if (err)
4239 printf("Function vec_sld [type unsigned char] ===> Error\n");
4240 else
4241 printf("Function vec_sld [type unsigned char] ===> OK\n");
4243 err = 0;
4244 b = 3;
4245 Saux1.v = vec_sld( Scons1, Scons2, 3 );
4246 Saux2.v = Scons1;
4247 Saux3.v = Scons2;
4248 for( i=0; i< 16; i++ )
4250 SHOunion1.ss = Saux1.e[i/2];
4251 if ((i+b)<16)
4252 SHOunion2.ss = Saux2.e[(i+b)/2];
4253 else
4254 SHOunion2.ss = Saux3.e[(i+b-16)/2];
4255 if (SHOunion1.sc[i%2] != SHOunion2.sc[(i+b)%2])
4256 err++;
4258 if (err)
4259 printf("Function vec_sld [type short] ===> Error\n");
4260 else
4261 printf("Function vec_sld [type short] ===> OK\n");
4263 err = 0;
4264 b = 3;
4265 USaux1.v = vec_sld( UScons1, UScons2, 3 );
4266 USaux2.v = UScons1;
4267 USaux3.v = UScons2;
4268 for( i=0; i< 16; i++ )
4270 SHOunion1.us = USaux1.e[i/2];
4271 if ((i+b)<16)
4272 SHOunion2.us = USaux2.e[(i+b)/2];
4273 else
4274 SHOunion2.us = USaux3.e[(i+b-16)/2];
4275 if (SHOunion1.uc[i%2] != SHOunion2.uc[(i+b)%2])
4276 err++;
4278 if (err)
4279 printf("Function vec_sld [type unsigned short] ===> Error\n");
4280 else
4281 printf("Function vec_sld [type unsigned short] ===> OK\n");
4283 err = 0;
4284 b = 3;
4285 Iaux1.v = vec_sld( Icons1, Icons2, 3 );
4286 Iaux2.v = Icons1;
4287 Iaux3.v = Icons2;
4288 for( i=0; i< 16; i++ )
4290 INTunion1.si = Iaux1.e[i/4];
4291 if ((i+b)<16)
4292 INTunion2.si = Iaux2.e[(i+b)/4];
4293 else
4294 INTunion2.si = Iaux3.e[(i+b-16)/4];
4295 if (INTunion1.sc[i%4] != INTunion2.sc[(i+b)%4])
4296 err++;
4298 if (err)
4299 printf("Function vec_sld [type integer] ===> Error\n");
4300 else
4301 printf("Function vec_sld [type integer] ===> OK\n");
4303 err = 0;
4304 b = 3;
4305 UIaux1.v = vec_sld( UIcons1, UIcons2, 3 );
4306 UIaux2.v = UIcons1;
4307 UIaux3.v = UIcons2;
4308 for( i=0; i< 16; i++ )
4310 INTunion1.ui = UIaux1.e[i/4];
4311 if ((i+b)<16)
4312 INTunion2.ui = UIaux2.e[(i+b)/4];
4313 else
4314 INTunion2.ui = UIaux3.e[(i+b-16)/4];
4315 if (INTunion1.uc[i%4] != INTunion2.uc[(i+b)%4])
4316 err++;
4318 if (err)
4319 printf("Function vec_sld [type unsigned int] ===> Error\n");
4320 else
4321 printf("Function vec_sld [type unsigned int] ===> OK\n");
4323 #if defined TEST_FLOATS
4324 err = 0;
4325 b = 3;
4326 Faux1.v = vec_sld( Fcons1, Fcons2, 3 );
4327 Faux2.v = Fcons1;
4328 Faux3.v = Fcons2;
4329 for( i=0; i< 16; i++ )
4331 INTunion1.f = Faux1.e[i/4];
4332 if ((i+b)<16)
4333 INTunion2.f = Faux2.e[(i+b)/4];
4334 else
4335 INTunion2.f = Faux3.e[(i+b-16)/4];
4336 if (INTunion1.sc[i%4] != INTunion2.sc[(i+b)%4])
4337 err++;
4339 if (err)
4340 printf("Function vec_sld [type float] ===> Error\n");
4341 else
4342 printf("Function vec_sld [type float] ===> OK\n");
4343 #endif
4345 /* Function vec_sll */
4346 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4347 err = 0;
4348 Caux1.v = vec_sll( Ccons1, UCcons2 );
4349 Caux2.v = Ccons1;
4350 UCaux1.v = UCcons2;
4351 b = UCaux1.e[15] & 0x7;
4352 for( i=0; i< 15; i++ )
4353 if ((UCaux1.e[i] & 0x7)!=b)
4354 err++;
4355 if (err)
4357 printf("The three low-order bits of all byte elements in b must be the same\n");
4358 printf("otherwise the value into d is undefined\n");
4360 else
4362 for( i=0; i< 16; i++ )
4364 UCvec1 = (unsigned char *)(&Caux2.e[i]);
4365 Caux = UCvec1[0]<<b;
4366 if (i != 15)
4367 Caux = Caux | (UCvec1[1]>>(8-b));
4368 if (Caux != Caux1.e[i])
4369 err++;
4371 if (err)
4372 printf("Function vec_sll [type char] ===> Error\n");
4373 else
4374 printf("Function vec_sll [type char] ===> OK\n");
4377 UCaux1.v = vec_sll( UCcons1, UCcons2 );
4378 UCaux2.v = UCcons1;
4379 UCaux3.v = UCcons2;
4380 b = UCaux3.e[15] & 0x7;
4381 for( i=0; i< 15; i++ )
4382 if ((UCaux3.e[i] & 0x7)!=b)
4383 err++;
4384 if (err)
4386 printf("The three low-order bits of all byte elements in b must be the same\n");
4387 printf("otherwise the value into d is undefined\n");
4389 else
4391 for( i=0; i< 16; i++ )
4393 UCvec1 = (unsigned char *)(&UCaux2.e[i]);
4394 UCaux = UCvec1[0]<<b;
4395 if (i != 15)
4396 UCaux = UCaux | (UCvec1[1]>>(8-b));
4397 if (UCaux != UCaux1.e[i])
4398 err++;
4400 if (err)
4401 printf("Function vec_sll [type unsigned char] ===> Error\n");
4402 else
4403 printf("Function vec_sll [type unsigned char] ===> OK\n");
4406 err = 0;
4407 Saux1.v = vec_sll( Scons1, UCcons2 );
4408 Saux2.v = Scons1;
4409 UCaux1.v = UCcons2;
4410 b = UCaux1.e[15] & 0x7;
4411 for( i=0; i< 15; i++ )
4412 if ((UCaux1.e[i] & 0x7)!=b)
4413 err++;
4414 if (err)
4416 printf("The three low-order bits of all byte elements in b must be the same\n");
4417 printf("otherwise the value into d is undefined\n");
4419 else
4421 for( i=0; i< 8; i++ )
4423 USvec1 = (unsigned short *)(&Saux2.e[i]);
4424 Saux = USvec1[0]<<b;
4425 if (i != 7)
4426 Saux = Saux | (USvec1[1]>>(16-b));
4427 if (Saux != Saux1.e[i])
4428 err++;
4430 if (err)
4431 printf("Function vec_sll [type short] ===> Error\n");
4432 else
4433 printf("Function vec_sll [type short] ===> OK\n");
4436 USaux1.v = vec_sll( UScons1, UCcons2 );
4437 USaux2.v = UScons1;
4438 UCaux1.v = UCcons2;
4439 b = UCaux1.e[15] & 0x7;
4440 for( i=0; i< 15; i++ )
4441 if ((UCaux1.e[i] & 0x7)!=b)
4442 err++;
4443 if (err)
4445 printf("The three low-order bits of all byte elements in b must be the same\n");
4446 printf("otherwise the value into d is undefined\n");
4448 else
4450 for( i=0; i< 8; i++ )
4452 USvec1 = (unsigned short *)(&USaux2.e[i]);
4453 USaux = USvec1[0]<<b;
4454 if (i != 7)
4455 USaux = USaux | (USvec1[1]>>(16-b));
4456 if (USaux != USaux1.e[i])
4457 err++;
4459 if (err)
4460 printf("Function vec_sll [type unsigned char] ===> Error\n");
4461 else
4462 printf("Function vec_sll [type unsigned char] ===> OK\n");
4465 err = 0;
4466 Iaux1.v = vec_sll( Icons1, UCcons2 );
4467 Iaux2.v = Icons1;
4468 UCaux1.v = UCcons2;
4469 b = UCaux1.e[15] & 0x7;
4470 for( i=0; i< 15; i++ )
4471 if ((UCaux1.e[i] & 0x7)!=b)
4472 err++;
4473 if (err)
4475 printf("The three low-order bits of all byte elements in b must be the same\n");
4476 printf("otherwise the value into d is undefined\n");
4478 else
4480 for( i=0; i< 4; i++ )
4482 UIvec1 = (unsigned int *)(&Iaux2.e[i]);
4483 Iaux = UIvec1[0]<<b;
4484 if (i != 3)
4485 Iaux = Iaux | (UIvec1[1]>>(32-b));
4486 if (Iaux != Iaux1.e[i])
4487 err++;
4489 if (err)
4490 printf("Function vec_sll [type integer] ===> Error\n");
4491 else
4492 printf("Function vec_sll [type integer] ===> OK\n");
4495 UIaux1.v = vec_sll( UIcons1, UCcons2 );
4496 UIaux2.v = UIcons1;
4497 UCaux1.v = UCcons2;
4498 b = UCaux1.e[15] & 0x7;
4499 for( i=0; i< 15; i++ )
4500 if ((UCaux1.e[i] & 0x7)!=b)
4501 err++;
4502 if (err)
4504 printf("The three low-order bits of all byte elements in b must be the same\n");
4505 printf("otherwise the value into d is undefined\n");
4507 else
4509 for( i=0; i< 4; i++ )
4511 UIvec1 = (unsigned int *)(&UIaux2.e[i]);
4512 UIaux = UIvec1[0]<<b;
4513 if (i != 3)
4514 UIaux = UIaux | (UIvec1[1]>>(32-b));
4515 if (UIaux != UIaux1.e[i])
4516 err++;
4518 if (err)
4519 printf("Function vec_sll [type unsigned int] ===> Error\n");
4520 else
4521 printf("Function vec_sll [type unsigned int] ===> OK\n");
4524 /* Function vec_slo */
4525 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4526 err = 0;
4527 Caux1.v = vec_slo( Ccons3, Ccons1 );
4528 Caux2.v = Ccons3;
4529 Caux3.v = Ccons1;
4530 b = (Caux3.e[15] & 0x78) >> 3;
4531 for( i=0; i< 16; i++ )
4533 if ((i+b)<16)
4535 if (Caux1.e[i] != Caux2.e[i+b])
4536 err++;
4538 else
4540 if (Caux1.e[i] != 0)
4541 err++;
4544 if (err)
4545 printf("Function vec_slo [type char] ===> Error\n");
4546 else
4547 printf("Function vec_slo [type char] ===> OK\n");
4549 err = 0;
4550 UCaux1.v = vec_slo( UCcons3, UCcons1 );
4551 UCaux2.v = UCcons3;
4552 UCaux3.v = UCcons1;
4553 b = (UCaux3.e[15] & 0x78) >> 3;
4554 for( i=0; i< 16; i++ )
4556 if ((i+b)<16)
4558 if (UCaux1.e[i] != UCaux2.e[i+b])
4559 err++;
4561 else
4563 if (UCaux1.e[i] != 0)
4564 err++;
4567 if (err)
4568 printf("Function vec_slo [type unsigned char] ===> Error\n");
4569 else
4570 printf("Function vec_slo [type unsigned char] ===> OK\n");
4572 err = 0;
4573 Saux1.v = vec_slo( Scons3, UCcons1 );
4574 Saux2.v = Scons3;
4575 UCaux3.v = UCcons1;
4576 b = (UCaux3.e[15] & 0x78) >> 3;
4577 for( i=0; i< 16; i++ )
4579 SHOunion1.ss = Saux1.e[i/2];
4580 if ((i+b)<16)
4581 SHOunion2.ss = Saux2.e[(i+b)/2];
4582 else
4583 SHOunion2.ss = 0;
4584 if (SHOunion1.sc[i%2] != SHOunion2.sc[(i+b)%2])
4585 err++;
4587 if (err)
4588 printf("Function vec_slo [type short] ===> Error\n");
4589 else
4590 printf("Function vec_slo [type short] ===> OK\n");
4592 err = 0;
4593 USaux1.v = vec_slo( UScons3, UCcons1 );
4594 USaux2.v = UScons3;
4595 UCaux3.v = UCcons1;
4596 b = (UCaux3.e[15] & 0x78) >> 3;
4597 for( i=0; i< 16; i++ )
4599 SHOunion1.us = USaux1.e[i/2];
4600 if ((i+b)<16)
4601 SHOunion2.us = USaux2.e[(i+b)/2];
4602 else
4603 SHOunion2.us = 0;
4604 if (SHOunion1.uc[i%2] != SHOunion2.uc[(i+b)%2])
4605 err++;
4607 if (err)
4608 printf("Function vec_slo [type unsigned short] ===> Error\n");
4609 else
4610 printf("Function vec_slo [type unsigned short] ===> OK\n");
4612 err = 0;
4613 Iaux1.v = vec_slo( Icons3, UCcons1 );
4614 Iaux2.v = Icons3;
4615 UCaux3.v = UCcons1;
4616 b = (UCaux3.e[15] & 0x78) >> 3;
4617 for( i=0; i< 16; i++ )
4619 INTunion1.si = Iaux1.e[i/4];
4620 if ((i+b)<16)
4621 INTunion2.si = Iaux2.e[(i+b)/4];
4622 else
4623 INTunion2.si = 0;
4624 if (INTunion1.sc[i%4] != INTunion2.sc[(i+b)%4])
4625 err++;
4627 if (err)
4628 printf("Function vec_slo [type integer] ===> Error\n");
4629 else
4630 printf("Function vec_slo [type integer] ===> OK\n");
4632 err = 0;
4633 UIaux1.v = vec_slo( UIcons3, UCcons1 );
4634 UIaux2.v = UIcons3;
4635 UCaux3.v = UCcons1;
4636 b = (UCaux3.e[15] & 0x78) >> 3;
4637 for( i=0; i< 16; i++ )
4639 INTunion1.ui = UIaux1.e[i/4];
4640 if ((i+b)<16)
4641 INTunion2.ui = UIaux2.e[(i+b)/4];
4642 else
4643 INTunion2.ui = 0;
4644 if (INTunion1.uc[i%4] != INTunion2.uc[(i+b)%4])
4645 err++;
4647 if (err)
4648 printf("Function vec_slo [type unsigned int] ===> Error\n");
4649 else
4650 printf("Function vec_slo [type unsigned int] ===> OK\n");
4652 #if defined TEST_FLOATS
4653 err = 0;
4654 Faux1.v = vec_slo( Fcons3, UCcons1 );
4655 Faux2.v = Fcons3;
4656 UCaux3.v = UCcons1;
4657 b = (UCaux3.e[15] & 0x78) >> 3;
4658 for( i=0; i< 16; i++ )
4660 INTunion1.f = Faux1.e[i/4];
4661 if ((i+b)<16)
4662 INTunion2.f = Faux2.e[(i+b)/4];
4663 else
4664 INTunion2.si = 0;
4665 if (INTunion1.sc[i%4] != INTunion2.sc[(i+b)%4])
4666 err++;
4668 if (err)
4669 printf("Function vec_slo [type float] ===> Error\n");
4670 else
4671 printf("Function vec_slo [type float] ===> OK\n");
4672 #endif
4674 /* Function vec_splat */
4675 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4676 err = 0;
4677 b = 3;
4678 Caux1.v = vec_splat( Ccons1, 3 );
4679 Caux2.v = Ccons1;
4680 for( i=0; i< 16; i++ )
4681 if (Caux1.e[i] != Caux2.e[b])
4682 err++;
4683 if (err)
4684 printf("Function vec_splat [type char] ===> Error\n");
4685 else
4686 printf("Function vec_splat [type char] ===> OK\n");
4688 err = 0;
4689 b = 3;
4690 UCaux1.v = vec_splat( UCcons1, 3 );
4691 UCaux2.v = UCcons1;
4692 for( i=0; i< 16; i++ )
4693 if (UCaux1.e[i] != UCaux2.e[b])
4694 err++;
4695 if (err)
4696 printf("Function vec_splat [type unsigned char] ===> Error\n");
4697 else
4698 printf("Function vec_splat [type unsigned char] ===> OK\n");
4700 err = 0;
4701 b = 3;
4702 Saux1.v = vec_splat( Scons1, 3 );
4703 Saux2.v = Scons1;
4704 for( i=0; i< 8; i++ )
4705 if (Saux1.e[i] != Saux2.e[b])
4706 err++;
4707 if (err)
4708 printf("Function vec_splat [type short] ===> Error\n");
4709 else
4710 printf("Function vec_splat [type short] ===> OK\n");
4712 err = 0;
4713 b = 3;
4714 USaux1.v = vec_splat( UScons1, 3 );
4715 USaux2.v = UScons1;
4716 for( i=0; i< 8; i++ )
4717 if (USaux1.e[i] != USaux2.e[b])
4718 err++;
4719 if (err)
4720 printf("Function vec_splat [type unsigned short] ===> Error\n");
4721 else
4722 printf("Function vec_splat [type unsigned short] ===> OK\n");
4724 err = 0;
4725 b = 3;
4726 Iaux1.v = vec_splat( Icons1, 3 );
4727 Iaux2.v = Icons1;
4728 for( i=0; i< 4; i++ )
4729 if (Iaux1.e[i] != Iaux2.e[b])
4730 err++;
4731 if (err)
4732 printf("Function vec_splat [type integer] ===> Error\n");
4733 else
4734 printf("Function vec_splat [type integer] ===> OK\n");
4736 err = 0;
4737 b = 3;
4738 UIaux1.v = vec_splat( UIcons1, 3 );
4739 UIaux2.v = UIcons1;
4740 for( i=0; i< 4; i++ )
4741 if (UIaux1.e[i] != UIaux2.e[b])
4742 err++;
4743 if (err)
4744 printf("Function vec_splat [type unsigned int] ===> Error\n");
4745 else
4746 printf("Function vec_splat [type unsigned int] ===> OK\n");
4748 #if defined TEST_FLOATS
4749 err = 0;
4750 b = 3;
4751 Faux1.v = vec_splat( Fcons1, 3 );
4752 Faux2.v = Fcons1;
4753 for( i=0; i< 4; i++ )
4754 if (Faux1.e[i] != Faux2.e[b])
4755 err++;
4756 if (err)
4757 printf("Function vec_splat [type float] ===> Error\n");
4758 else
4759 printf("Function vec_splat [type float] ===> OK\n");
4760 #endif
4762 /* Function vec_splat_s8 */
4763 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4764 err = 0;
4765 Caux = 15;
4766 Caux1.v = vec_splat_s8( 15 );
4767 for( i=0; i< 16; i++ )
4768 if (Caux1.e[i] != Caux)
4769 err++;
4770 if (err)
4771 printf("Function vec_splat_s8 [type char] ===> Error\n");
4772 else
4773 printf("Function vec_splat_s8 [type char] ===> OK\n");
4775 /* Function vec_splat_s16 */
4776 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4777 err = 0;
4778 Saux = 15;
4779 Saux1.v = vec_splat_s16( 15 );
4780 for( i=0; i< 8; i++ )
4781 if (Saux1.e[i] != Saux)
4782 err++;
4783 if (err)
4784 printf("Function vec_splat_s16 [type short] ===> Error\n");
4785 else
4786 printf("Function vec_splat_s16 [type short] ===> OK\n");
4788 /* Function vec_splat_s32 */
4789 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4790 err = 0;
4791 Iaux = 15;
4792 Iaux1.v = vec_splat_s32( 15 );
4793 for( i=0; i< 4; i++ )
4794 if (Iaux1.e[i] != Iaux)
4795 err++;
4796 if (err)
4797 printf("Function vec_splat_s32 [type integer] ===> Error\n");
4798 else
4799 printf("Function vec_splat_s32 [type integer] ===> OK\n");
4801 /* Function vec_splat_u8 */
4802 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4803 err = 0;
4804 UCaux = 15;
4805 UCaux1.v = vec_splat_u8( 15 );
4806 for( i=0; i< 16; i++ )
4807 if (UCaux1.e[i] != UCaux)
4808 err++;
4809 if (err)
4810 printf("Function vec_splat_u8 [type unsig. char] ===> Error\n");
4811 else
4812 printf("Function vec_splat_u8 [type unsig. char] ===> OK\n");
4814 /* Function vec_splat_u16 */
4815 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4816 err = 0;
4817 USaux = 15;
4818 USaux1.v = vec_splat_u16( 15 );
4819 for( i=0; i< 8; i++ )
4820 if (USaux1.e[i] != Saux)
4821 err++;
4822 if (err)
4823 printf("Function vec_splat_u16 [type unsg. short] ===> Error\n");
4824 else
4825 printf("Function vec_splat_u16 [type unsg. short] ===> OK\n");
4827 /* Function vec_splat_u32 */
4828 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4829 err = 0;
4830 UIaux = 15;
4831 UIaux1.v = vec_splat_u32( 15 );
4832 for( i=0; i< 4; i++ )
4833 if (UIaux1.e[i] != UIaux)
4834 err++;
4835 if (err)
4836 printf("Function vec_splat_u32 [type unsig. int] ===> Error\n");
4837 else
4838 printf("Function vec_splat_u32 [type unsig. int] ===> OK\n");
4840 /* Function vec_sr */
4841 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4842 err = 0;
4843 Caux1.v = vec_sr( Ccons3, UCcons3 );
4844 Caux2.v = Ccons3;
4845 UCaux3.v = UCcons3;
4846 for( i=0; i< 16; i++ )
4848 SHOunion1.sc[0] = Caux2.e[i];
4849 SHOunion1.uc[0] = SHOunion1.uc[0] >> (UCaux3.e[i]%8);
4850 if (Caux1.e[i] != SHOunion1.sc[0])
4851 err++;
4853 if (err)
4854 printf("Function vec_sr [type char] ===> Error\n");
4855 else
4856 printf("Function vec_sr [type char] ===> OK\n");
4858 err = 0;
4859 UCaux1.v = vec_sr( UCcons1, UCcons3 );
4860 UCaux2.v = UCcons1;
4861 UCaux3.v = UCcons3;
4862 for( i=0; i< 16; i++ )
4864 UCaux = UCaux2.e[i] >> (UCaux3.e[i]%8);
4865 if (UCaux1.e[i] != UCaux)
4866 err++;
4868 if (err)
4869 printf("Function vec_sr [type unsigned char] ===> Error\n");
4870 else
4871 printf("Function vec_sr [type unsigned char] ===> OK\n");
4873 err = 0;
4874 Saux1.v = vec_sr( Scons3, UScons3 );
4875 Saux2.v = Scons3;
4876 USaux3.v = UScons3;
4877 for( i=0; i< 8; i++ )
4879 SHOunion1.ss = Saux2.e[i];
4880 SHOunion1.us = SHOunion1.us >> (USaux3.e[i]%16);
4881 if (Saux1.e[i] != SHOunion1.ss)
4882 err++;
4884 if (err)
4885 printf("Function vec_sr [type short] ===> Error\n");
4886 else
4887 printf("Function vec_sr [type short] ===> OK\n");
4889 err = 0;
4890 USaux1.v = vec_sr( UScons1, UScons3 );
4891 USaux2.v = UScons1;
4892 USaux3.v = UScons3;
4893 for( i=0; i< 8; i++ )
4895 USaux = USaux2.e[i] >> (USaux3.e[i]%16);
4896 if (USaux1.e[i] != USaux)
4897 err++;
4899 if (err)
4900 printf("Function vec_sr [type unsigned short] ===> Error\n");
4901 else
4902 printf("Function vec_sr [type unsigned short] ===> OK\n");
4904 err = 0;
4905 Iaux1.v = vec_sr( Icons3, UIcons3 );
4906 Iaux2.v = Icons3;
4907 UIaux3.v = UIcons3;
4908 for( i=0; i< 4; i++ )
4910 INTunion1.si = Iaux2.e[i];
4911 INTunion1.ui = INTunion1.ui >> (UIaux3.e[i]%32);
4912 if (Iaux1.e[i] != INTunion1.si)
4913 err++;
4915 if (err)
4916 printf("Function vec_sr [type integer] ===> Error\n");
4917 else
4918 printf("Function vec_sr [type integer] ===> OK\n");
4920 err = 0;
4921 UIaux1.v = vec_sr( UIcons1, UIcons3 );
4922 UIaux2.v = UIcons1;
4923 UIaux3.v = UIcons3;
4924 for( i=0; i< 4; i++ )
4926 UIaux = UIaux2.e[i] >> (UIaux3.e[i]%32);
4927 if (UIaux1.e[i] != UIaux)
4928 err++;
4930 if (err)
4931 printf("Function vec_sr [type unsigned int] ===> Error\n");
4932 else
4933 printf("Function vec_sr [type unsigned int] ===> OK\n");
4935 /* Function vec_sra */
4936 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
4937 err = 0;
4938 Caux1.v = vec_sra( Ccons3, UCcons3 );
4939 Caux2.v = Ccons3;
4940 UCaux3.v = UCcons3;
4941 for( i=0; i< 16; i++ )
4943 Caux = Caux2.e[i] >> (UCaux3.e[i]%8);
4944 if (Caux1.e[i] != Caux)
4945 err++;
4947 if (err)
4948 printf("Function vec_sra [type char] ===> Error\n");
4949 else
4950 printf("Function vec_sra [type char] ===> OK\n");
4952 err = 0;
4953 UCaux1.v = vec_sra( UCcons1, UCcons3 );
4954 UCaux2.v = UCcons1;
4955 UCaux3.v = UCcons3;
4956 for( i=0; i< 16; i++ )
4958 INTunion1.uc[0] = UCaux2.e[i];
4959 INTunion1.sc[0] = INTunion1.sc[0] >> (UCaux3.e[i]%8);
4960 if (UCaux1.e[i] != INTunion1.uc[0])
4961 err++;
4963 if (err)
4964 printf("Function vec_sra [type unsigned char] ===> Error\n");
4965 else
4966 printf("Function vec_sra [type unsigned char] ===> OK\n");
4968 err = 0;
4969 Saux1.v = vec_sra( Scons3, UScons3 );
4970 Saux2.v = Scons3;
4971 USaux3.v = UScons3;
4972 for( i=0; i< 8; i++ )
4974 Saux = Saux2.e[i] >> (USaux3.e[i]%16);
4975 if (Saux1.e[i] != Saux)
4976 err++;
4978 if (err)
4979 printf("Function vec_sra [type short] ===> Error\n");
4980 else
4981 printf("Function vec_sra [type short] ===> OK\n");
4983 err = 0;
4984 USaux1.v = vec_sra( UScons1, UScons3 );
4985 USaux2.v = UScons1;
4986 USaux3.v = UScons3;
4987 for( i=0; i< 8; i++ )
4989 INTunion1.us[0] = USaux2.e[i];
4990 INTunion1.ss[0] = INTunion1.ss[0] >> (USaux3.e[i]%16);
4991 if (USaux1.e[i] != INTunion1.us[0])
4992 err++;
4994 if (err)
4995 printf("Function vec_sra [type unsigned short] ===> Error\n");
4996 else
4997 printf("Function vec_sra [type unsigned short] ===> OK\n");
4999 err = 0;
5000 Iaux1.v = vec_sra( Icons3, UIcons3 );
5001 Iaux2.v = Icons3;
5002 UIaux3.v = UIcons3;
5003 for( i=0; i< 4; i++ )
5005 Iaux = Iaux2.e[i] >> (UIaux3.e[i]%32);
5006 if (Iaux1.e[i] != Iaux)
5007 err++;
5009 if (err)
5010 printf("Function vec_sra [type integer] ===> Error\n");
5011 else
5012 printf("Function vec_sra [type integer] ===> OK\n");
5014 err = 0;
5015 UIaux1.v = vec_sra( UIcons1, UIcons3 );
5016 UIaux2.v = UIcons1;
5017 UIaux3.v = UIcons3;
5018 for( i=0; i< 4; i++ )
5020 INTunion1.ui = UIaux2.e[i];
5021 INTunion1.si = INTunion1.si >> (UIaux3.e[i]%32);
5022 if (UIaux1.e[i] != INTunion1.ui)
5023 err++;
5025 if (err)
5026 printf("Function vec_sra [type unsigned int] ===> Error\n");
5027 else
5028 printf("Function vec_sra [type unsigned int] ===> OK\n");
5030 /* Function vec_srl */
5031 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5032 err = 0;
5033 Caux1.v = vec_srl( Ccons1, UCcons2 );
5034 Caux2.v = Ccons1;
5035 UCaux3.v = UCcons2;
5036 b = UCaux3.e[15] & 0x7;
5037 for( i=0; i< 15; i++ )
5038 if ((UCaux3.e[i] & 0x7)!=b)
5039 err++;
5040 if (err)
5042 printf("The three low-order bits of all byte elements in b must be the same\n");
5043 printf("otherwise the value into d is undefined\n");
5045 else
5047 Caux = 0;
5048 for( i=0; i< 16; i++ )
5050 INTunion1.sc[0] = Caux2.e[i];
5051 Caux = Caux | (INTunion1.uc[0]>>b);
5052 if (Caux != Caux1.e[i])
5053 err++;
5054 Caux = INTunion1.uc[0]<<(8-b);
5056 if (err)
5057 printf("Function vec_srl [type char] ===> Error\n");
5058 else
5059 printf("Function vec_srl [type char] ===> OK\n");
5062 err = 0;
5063 UCaux1.v = vec_srl( UCcons1, UCcons2 );
5064 UCaux2.v = UCcons1;
5065 UCaux3.v = UCcons2;
5066 b = UCaux3.e[15] & 0x7;
5067 for( i=0; i< 15; i++ )
5068 if ((UCaux3.e[i] & 0x7)!=b)
5069 err++;
5070 if (err)
5072 printf("The three low-order bits of all byte elements in b must be the same\n");
5073 printf("otherwise the value into d is undefined\n");
5075 else
5077 UCaux = 0;
5078 for( i=0; i< 16; i++ )
5080 UCaux = UCaux | (UCaux2.e[i]>>b);
5081 if (UCaux != UCaux1.e[i])
5082 err++;
5083 UCaux = UCaux2.e[i]<<(8-b);
5085 if (err)
5086 printf("Function vec_srl [type unsigned char] ===> Error\n");
5087 else
5088 printf("Function vec_srl [type unsigned char] ===> OK\n");
5091 err = 0;
5092 Saux1.v = vec_srl( Scons1, UCcons2 );
5093 Saux2.v = Scons1;
5094 UCaux3.v = UCcons2;
5095 b = UCaux3.e[15] & 0x7;
5096 for( i=0; i< 15; i++ )
5097 if ((UCaux3.e[i] & 0x7)!=b)
5098 err++;
5099 if (err)
5101 printf("The three low-order bits of all byte elements in b must be the same\n");
5102 printf("otherwise the value into d is undefined\n");
5104 else
5106 Saux = 0;
5107 for( i=0; i< 8; i++ )
5109 INTunion1.ss[0] = Saux2.e[i];
5110 Saux = Saux | (INTunion1.us[0]>>b);
5111 if (Saux != Saux1.e[i])
5112 err++;
5113 Saux = INTunion1.us[0]<<(16-b);
5115 if (err)
5116 printf("Function vec_srl [type short] ===> Error\n");
5117 else
5118 printf("Function vec_srl [type short] ===> OK\n");
5121 err = 0;
5122 USaux1.v = vec_srl( UScons1, UCcons2 );
5123 USaux2.v = UScons1;
5124 UCaux3.v = UCcons2;
5125 b = UCaux3.e[15] & 0x7;
5126 for( i=0; i< 15; i++ )
5127 if ((UCaux3.e[i] & 0x7)!=b)
5128 err++;
5129 if (err)
5131 printf("The three low-order bits of all byte elements in b must be the same\n");
5132 printf("otherwise the value into d is undefined\n");
5134 else
5136 USaux = 0;
5137 for( i=0; i< 8; i++ )
5139 USaux = USaux | (USaux2.e[i]>>b);
5140 if (USaux != USaux1.e[i])
5141 err++;
5142 USaux = USaux2.e[i]<<(16-b);
5144 if (err)
5145 printf("Function vec_srl [type unsigned short] ===> Error\n");
5146 else
5147 printf("Function vec_srl [type unsigned short] ===> OK\n");
5150 err = 0;
5151 Iaux1.v = vec_srl( Icons1, UCcons2 );
5152 Iaux2.v = Icons1;
5153 UCaux3.v = UCcons2;
5154 b = UCaux3.e[15] & 0x7;
5155 for( i=0; i< 15; i++ )
5156 if ((UCaux3.e[i] & 0x7)!=b)
5157 err++;
5158 if (err)
5160 printf("The three low-order bits of all byte elements in b must be the same\n");
5161 printf("otherwise the value into d is undefined\n");
5163 else
5165 Iaux = 0;
5166 for( i=0; i< 4; i++ )
5168 INTunion1.si = Iaux2.e[i];
5169 Iaux = Iaux | (INTunion1.ui>>b);
5170 if (Iaux != Iaux1.e[i])
5171 err++;
5172 Iaux = INTunion1.ui<<(32-b);
5174 if (err)
5175 printf("Function vec_srl [type integer] ===> Error\n");
5176 else
5177 printf("Function vec_srl [type integer] ===> OK\n");
5180 err = 0;
5181 UIaux1.v = vec_srl( UIcons1, UCcons2 );
5182 UIaux2.v = UIcons1;
5183 UCaux3.v = UCcons2;
5184 b = UCaux3.e[15] & 0x7;
5185 for( i=0; i< 15; i++ )
5186 if ((UCaux3.e[i] & 0x7)!=b)
5187 err++;
5188 if (err)
5190 printf("The three low-order bits of all byte elements in b must be the same\n");
5191 printf("otherwise the value into d is undefined\n");
5193 else
5195 UIaux = 0;
5196 for( i=0; i< 4; i++ )
5198 UIaux = UIaux | (UIaux2.e[i]>>b);
5199 if (UIaux != UIaux1.e[i])
5200 err++;
5201 UIaux = UIaux2.e[i]<<(32-b);
5203 if (err)
5204 printf("Function vec_srl [type unsigned int] ===> Error\n");
5205 else
5206 printf("Function vec_srl [type unsigned int] ===> OK\n");
5209 /* Function vec_sro */
5210 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5211 err = 0;
5212 Caux1.v = vec_sro( Ccons3, Ccons1 );
5213 Caux2.v = Ccons3;
5214 Caux3.v = Ccons1;
5215 b = (Caux3.e[15] & 0x78) >>3;
5216 for( i=0; i< 16; i++ )
5218 if ((i-b)>=0)
5220 if (Caux1.e[i] != Caux2.e[i-b])
5221 err++;
5223 else
5225 if (Caux1.e[i] != 0)
5226 err++;
5229 if (err)
5230 printf("Function vec_sro [type char] ===> Error\n");
5231 else
5232 printf("Function vec_sro [type char] ===> OK\n");
5234 err = 0;
5235 UCaux1.v = vec_sro( UCcons3, UCcons1 );
5236 UCaux2.v = UCcons3;
5237 UCaux3.v = UCcons1;
5238 b = (UCaux3.e[15] & 0x78) >>3;
5239 for( i=0; i< 16; i++ )
5241 if ((i-b)>=0)
5243 if (UCaux1.e[i] != UCaux2.e[i-b])
5244 err++;
5246 else
5248 if (UCaux1.e[i] != 0)
5249 err++;
5252 if (err)
5253 printf("Function vec_sro [type unsigned char] ===> Error\n");
5254 else
5255 printf("Function vec_sro [type unsigned char] ===> OK\n");
5257 err = 0;
5258 Saux1.v = vec_sro( Scons3, Ccons1 );
5259 Saux2.v = Scons3;
5260 Caux3.v = Ccons1;
5261 b = (Caux3.e[15] & 0x78) >>3;
5262 for( i=0; i< 16; i++ )
5264 SHOunion1.ss = Saux1.e[i/2];
5265 if ((i-b)>=0)
5267 SHOunion2.ss = Saux2.e[(i-b)/2];
5268 if (SHOunion1.sc[i%2] != SHOunion2.sc[(i-b)%2])
5269 err++;
5271 else
5273 if (SHOunion1.sc[i%2] != 0)
5274 err++;
5277 if (err)
5278 printf("Function vec_sro [type short] ===> Error\n");
5279 else
5280 printf("Function vec_sro [type short] ===> OK\n");
5282 err = 0;
5283 USaux1.v = vec_sro( UScons3, UCcons1 );
5284 USaux2.v = UScons3;
5285 UCaux3.v = UCcons1;
5286 b = (UCaux3.e[15] & 0x78) >>3;
5287 for( i=0; i< 16; i++ )
5289 SHOunion1.us = USaux1.e[i/2];
5290 if ((i-b)>=0)
5292 SHOunion2.us = USaux2.e[(i-b)/2];
5293 if (SHOunion1.uc[i%2] != SHOunion2.uc[(i-b)%2])
5294 err++;
5296 else
5298 if (SHOunion1.uc[i%2] != 0)
5299 err++;
5302 if (err)
5303 printf("Function vec_sro [type unsigned short] ===> Error\n");
5304 else
5305 printf("Function vec_sro [type unsigned short] ===> OK\n");
5307 err = 0;
5308 Iaux1.v = vec_sro( Icons3, Ccons1 );
5309 Iaux2.v = Icons3;
5310 Caux3.v = Ccons1;
5311 b = (Caux3.e[15] & 0x78) >>3;
5312 for( i=0; i< 16; i++ )
5314 INTunion1.si = Iaux1.e[i/4];
5315 if ((i-b)>=0)
5317 INTunion2.si = Iaux2.e[(i-b)/4];
5318 if (INTunion1.sc[i%4] != INTunion2.sc[(i-b)%4])
5319 err++;
5321 else
5323 if (INTunion1.sc[i%4] != 0)
5324 err++;
5327 if (err)
5328 printf("Function vec_sro [type integer] ===> Error\n");
5329 else
5330 printf("Function vec_sro [type integer] ===> OK\n");
5332 err = 0;
5333 UIaux1.v = vec_sro( UIcons3, UCcons1 );
5334 UIaux2.v = UIcons3;
5335 UCaux3.v = UCcons1;
5336 b = (UCaux3.e[15] & 0x78) >>3;
5337 for( i=0; i< 16; i++ )
5339 INTunion1.ui = UIaux1.e[i/4];
5340 if ((i-b)>=0)
5342 INTunion2.ui = UIaux2.e[(i-b)/4];
5343 if (INTunion1.uc[i%4] != INTunion2.sc[(i-b)%4])
5344 err++;
5346 else
5348 if (INTunion1.uc[i%4] != 0)
5349 err++;
5352 if (err)
5353 printf("Function vec_sro [type unsigned int] ===> Error\n");
5354 else
5355 printf("Function vec_sro [type unsigned int] ===> OK\n");
5357 #if defined TEST_FLOATS
5358 err = 0;
5359 Faux1.v = vec_sro( Fcons3, Ccons1 );
5360 Faux2.v = Fcons3;
5361 Caux3.v = Ccons1;
5362 b = (Caux3.e[15] & 0x78) >>3;
5363 for( i=0; i< 16; i++ )
5365 INTunion1.f = Faux1.e[i/4];
5366 if ((i-b)>=0)
5368 INTunion2.f = Faux2.e[(i-b)/4];
5369 if (INTunion1.sc[i%4] != INTunion2.sc[(i-b)%4])
5370 err++;
5372 else
5374 if (INTunion1.sc[i%4] != 0)
5375 err++;
5378 if (err)
5379 printf("Function vec_sro [type float] ===> Error\n");
5380 else
5381 printf("Function vec_sro [type float] ===> OK\n");
5382 #endif
5384 /* Function vec_st */
5385 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5386 err = 0;
5387 UCaux1.v = UCcons1;
5388 vec_st( UCaux1.v, 0, UCmem );
5389 Iaux = 1;
5390 for ( i=0; i< 16; i++ )
5392 Iaux = Iaux && (UCaux1.e[i]==UCmem[i]);
5394 if (Iaux!=1) err++;
5396 if (err)
5397 printf("Function vec_st [type unsigned char] ===> Error\n");
5398 else
5399 printf("Function vec_st [type unsigned char] ===> OK\n");
5401 err = 0;
5402 Caux1.v = Ccons1;
5403 vec_st( Caux1.v, 0, Cmem );
5404 Iaux = 1;
5405 for ( i=0; i< 16; i++ )
5407 Iaux = Iaux && (Caux1.e[i]==Cmem[i]);
5409 if (Iaux!=1) err++;
5411 if (err)
5412 printf("Function vec_st [type char] ===> Error\n");
5413 else
5414 printf("Function vec_st [type char] ===> OK\n");
5416 err = 0;
5417 USaux1.v = UScons3;
5418 vec_st( USaux1.v, 0, USmem );
5419 Iaux = 1;
5420 for ( i=0; i< 8; i++ )
5422 Iaux = Iaux && (USaux1.e[i]==USmem[i]);
5424 if (Iaux!=1) err++;
5426 if (err)
5427 printf("Function vec_st [type unsigned short] ===> Error\n");
5428 else
5429 printf("Function vec_st [type unsigned short] ===> OK\n");
5431 err = 0;
5432 Saux1.v = Scons1;
5433 vec_st( Saux1.v, 0, Smem );
5434 Iaux = 1;
5435 for ( i=0; i< 8; i++ )
5437 Iaux = Iaux && (Saux1.e[i]==Smem[i]);
5439 if (Iaux!=1) err++;
5441 if (err)
5442 printf("Function vec_st [type short] ===> Error\n");
5443 else
5444 printf("Function vec_st [type short] ===> OK\n");
5446 err = 0;
5447 UIaux1.v = UIcons1;
5448 vec_st( UIaux1.v, 0, UImem );
5449 Iaux = 1;
5450 for ( i=0; i< 4; i++ )
5452 Iaux = Iaux && (UIaux1.e[i]==UImem[i]);
5454 if (Iaux!=1) err++;
5456 if (err)
5457 printf("Function vec_st [type unsigned int] ===> Error\n");
5458 else
5459 printf("Function vec_st [type unsigned int] ===> OK\n");
5461 err = 0;
5462 Iaux1.v = Icons1;
5463 vec_st( Iaux1.v, 0, Imem );
5464 Iaux = 1;
5465 for ( i=0; i< 4; i++ )
5467 Iaux = Iaux && (Iaux1.e[i]==Imem[i]);
5469 if (Iaux!=1) err++;
5471 if (err)
5472 printf("Function vec_st [type int] ===> Error\n");
5473 else
5474 printf("Function vec_st [type int] ===> OK\n");
5476 #if defined TEST_FLOATS
5477 err = 0;
5478 Faux1.v = Fcons1;
5479 vec_st( Faux1.v, 0, Fmem );
5480 Iaux = 1;
5481 for ( i=0; i< 4; i++ )
5483 Iaux = Iaux && (Faux1.e[i]==Fmem[i]);
5485 if (Iaux!=1) err++;
5487 if (err)
5488 printf("Function vec_st [type float] ===> Error\n");
5489 else
5490 printf("Function vec_st [type float] ===> OK\n");
5491 #endif
5493 /* Function vec_ste */
5494 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5495 err = 0;
5496 b = 11;
5497 UCaux1.v = UCcons1;
5498 vec_ste( UCaux1.v, b, UCmem );
5499 i = b;
5500 if (UCaux1.e[i]!=UCmem[i]) err++;
5502 if (err)
5503 printf("Function vec_ste [type unsigned char] ===> Error\n");
5504 else
5505 printf("Function vec_ste [type unsigned char] ===> OK\n");
5507 err = 0;
5508 b = 11;
5509 Caux1.v = Ccons1;
5510 vec_ste( Caux1.v, b, Cmem );
5511 i = b;
5512 if (Caux1.e[i]!=Cmem[i]) err++;
5514 if (err)
5515 printf("Function vec_ste [type char] ===> Error\n");
5516 else
5517 printf("Function vec_ste [type char] ===> OK\n");
5519 err = 0;
5520 b = 11;
5521 USaux1.v = UScons1;
5522 vec_ste( USaux1.v, b, USmem );
5523 i = b/2;
5524 if (USaux1.e[i]!=USmem[i]) err++;
5525 if (err)
5526 printf("Function vec_ste [type unsigned short] ===> Error\n");
5527 else
5528 printf("Function vec_ste [type unsigned short] ===> OK\n");
5530 err = 0;
5531 b = 11;
5532 Saux1.v = Scons1;
5533 vec_ste( Saux1.v, b, Smem );
5534 i = b/2;
5535 if (Saux1.e[i]!=Smem[i]) err++;
5536 if (err)
5537 printf("Function vec_ste [type short] ===> Error\n");
5538 else
5539 printf("Function vec_ste [type short] ===> OK\n");
5541 err = 0;
5542 b = 11;
5543 UIaux1.v = UIcons1;
5544 vec_ste( UIaux1.v, b, UImem );
5545 i = b/4;
5546 if (UIaux1.e[i]!=UImem[i]) err++;
5547 if (err)
5548 printf("Function vec_ste [type unsigned int] ===> Error\n");
5549 else
5550 printf("Function vec_ste [type unsigned int] ===> OK\n");
5552 err = 0;
5553 b = 11;
5554 Iaux1.v = Icons1;
5555 vec_ste( Iaux1.v, b, Imem );
5556 i = b/4;
5557 if (Iaux1.e[i]!=Imem[i]) err++;
5558 if (err)
5559 printf("Function vec_ste [type int] ===> Error\n");
5560 else
5561 printf("Function vec_ste [type int] ===> OK\n");
5563 #if defined TEST_FLOATS
5564 err = 0;
5565 b = 11;
5566 Faux1.v = Fcons1;
5567 vec_ste( Faux1.v, b, Fmem );
5568 i = b/4;
5569 if (Faux1.e[i]!=Fmem[i]) err++;
5570 if (err)
5571 printf("Function vec_ste [type float] ===> Error\n");
5572 else
5573 printf("Function vec_ste [type float] ===> OK\n");
5574 #endif
5576 #if 0
5577 /* Function vec_stl */
5578 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5579 err = 0;
5580 UCaux1.v = UCcons1;
5581 vec_stl( UCaux1.v, 0, UCmem );
5582 Iaux = 1;
5583 for ( i=0; i< 16; i++ )
5585 Iaux = Iaux && (UCaux1.e[i]==UCmem[i]);
5587 if (Iaux!=1) err++;
5589 if (err)
5590 printf("Function vec_stl [type unsigned char] ===> Error\n");
5591 else
5592 printf("Function vec_stl [type unsigned char] ===> OK\n");
5594 err = 0;
5595 Caux1.v = Ccons1;
5596 vec_stl( Caux1.v, 0, Cmem );
5597 Iaux = 1;
5598 for ( i=0; i< 16; i++ )
5600 Iaux = Iaux && (Caux1.e[i]==Cmem[i]);
5602 if (Iaux!=1) err++;
5604 if (err)
5605 printf("Function vec_stl [type char] ===> Error\n");
5606 else
5607 printf("Function vec_stl [type char] ===> OK\n");
5609 err = 0;
5610 USaux1.v = UScons3;
5611 vec_stl( USaux1.v, 0, USmem );
5612 Iaux = 1;
5613 for ( i=0; i< 8; i++ )
5615 Iaux = Iaux && (USaux1.e[i]==USmem[i]);
5617 if (Iaux!=1) err++;
5619 if (err)
5620 printf("Function vec_stl [type unsigned short] ===> Error\n");
5621 else
5622 printf("Function vec_stl [type unsigned short] ===> OK\n");
5624 err = 0;
5625 Saux1.v = Scons1;
5626 vec_stl( Saux1.v, 0, Smem );
5627 Iaux = 1;
5628 for ( i=0; i< 8; i++ )
5630 Iaux = Iaux && (Saux1.e[i]==Smem[i]);
5632 if (Iaux!=1) err++;
5634 if (err)
5635 printf("Function vec_stl [type short] ===> Error\n");
5636 else
5637 printf("Function vec_stl [type short] ===> OK\n");
5639 err = 0;
5640 UIaux1.v = UIcons1;
5641 vec_stl( UIaux1.v, 0, UImem );
5642 Iaux = 1;
5643 for ( i=0; i< 4; i++ )
5645 Iaux = Iaux && (UIaux1.e[i]==UImem[i]);
5647 if (Iaux!=1) err++;
5649 if (err)
5650 printf("Function vec_stl [type unsigned int] ===> Error\n");
5651 else
5652 printf("Function vec_stl [type unsigned int] ===> OK\n");
5654 err = 0;
5655 Iaux1.v = Icons1;
5656 vec_stl( Iaux1.v, 0, Imem );
5657 Iaux = 1;
5658 for ( i=0; i< 4; i++ )
5660 Iaux = Iaux && (Iaux1.e[i]==Imem[i]);
5662 if (Iaux!=1) err++;
5664 if (err)
5665 printf("Function vec_stl [type int] ===> Error\n");
5666 else
5667 printf("Function vec_stl [type int] ===> OK\n");
5669 #if defined TEST_FLOATS
5670 err = 0;
5671 Faux1.v = Fcons1;
5672 vec_stl( Faux1.v, 0, Fmem );
5673 Iaux = 1;
5674 for ( i=0; i< 4; i++ )
5676 Iaux = Iaux && (Faux1.e[i]==Fmem[i]);
5678 if (Iaux!=1) err++;
5680 if (err)
5681 printf("Function vec_stl [type float] ===> Error\n");
5682 else
5683 printf("Function vec_stl [type float] ===> OK\n");
5684 #endif
5685 #endif // #if 0
5687 /* Free dynamic vector variables */
5688 free_vec( UCmem );
5689 free_vec( Cmem );
5690 free_vec( USmem );
5691 free_vec( Smem );
5692 free_vec( UImem );
5693 free_vec( Imem );
5694 #if defined TEST_FLOATS
5695 free_vec( Fmem );
5696 #endif
5698 return 0;
5704 int part4( )
5706 TvecChar Caux1, Caux2, Caux3;//, Caux4;
5707 TvecUChar UCaux1, UCaux2, UCaux3;//, UCaux4;
5708 TvecShort Saux1, Saux2, Saux3;//, Saux4;
5709 TvecUShort USaux1, USaux2, USaux3;//, USaux4;
5710 TvecInt Iaux1, Iaux2, Iaux3;//, Iaux4;
5711 TvecUInt UIaux1, UIaux2, UIaux3;//, UIaux4;
5712 #if defined TEST_FLOATS
5713 TvecFloat Faux1, Faux2, Faux3;//, Faux4;
5714 #endif
5716 int i, err, j;//, b, bAux;
5717 // signed int Ivec1, Ivec2, Ivec3;
5718 // signed short *Svec1;
5719 // unsigned int *UIvec1;
5720 // unsigned short *USvec1;
5721 // unsigned char *UCvec1;
5722 #if defined TEST_FLOATS
5723 // float *Fvec1;
5724 #endif
5726 /* For saturated rutines */
5727 long long int LLaux;
5729 #if defined TEST_FLOATS
5730 float Faux;
5731 #endif
5732 signed int Iaux;//, I1, I2;
5733 unsigned int UIaux;//, UI1, UI2;
5734 signed short Saux;
5735 unsigned short USaux;
5736 signed char Caux;
5737 unsigned char UCaux;
5740 union
5742 float f;
5743 signed int si;
5744 unsigned int ui;
5745 signed short ss[2];
5746 unsigned short us[2];
5747 signed char sc[4];
5748 unsigned char uc[4];
5749 } INTunion1, INTunion2;
5751 union
5753 signed short ss;
5754 unsigned short us;
5755 signed char sc[2];
5756 unsigned char uc[2];
5757 } SHOunion1, SHOunion2;
5760 #if defined (GCC_COMPILER)
5761 vector signed char Ccons1 = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
5762 vector signed char Ccons2 = (vector signed char){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
5763 vector signed char Ccons3 = (vector signed char){-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127};
5764 vector unsigned char UCcons1 = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7};
5765 vector unsigned char UCcons2 = (vector unsigned char){2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
5766 vector unsigned char UCcons3 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
5767 vector signed short Scons1 = (vector signed short){-4, -3, -2, -1, 0, 1, 2, 3};
5768 vector signed short Scons2 = (vector signed short){-32768, 10000, 1, 1, 1, 1, -10000, -10000};
5769 vector signed short Scons3 = (vector signed short){-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767};
5770 vector unsigned short UScons1 = (vector unsigned short){65532, 65533, 65534, 65535, 0, 1, 2, 3};
5771 vector unsigned short UScons2 = (vector unsigned short){1, 1, 1, 1, 1, 1, 1, 1};
5772 vector unsigned short UScons3 = (vector unsigned short){1, 2, 3, 4, 1, 2, 3, 4};
5773 vector signed int Icons1 = (vector signed int){-4, -1, 1, 4};
5774 vector signed int Icons2 = (vector signed int){1, 1, 1, 1};
5775 vector signed int Icons3 = (vector signed int){0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF};
5776 vector unsigned int UIcons1 = (vector unsigned int){0xFFFFFFFE, 0xFFFFFFFF, 0, 1};
5777 vector unsigned int UIcons2 = (vector unsigned int){1, 1, 1, 1};
5778 vector unsigned int UIcons3 = (vector unsigned int){1, 2, 1, 2};
5780 #if defined TEST_FLOATS
5781 vector float Fcons1 = (vector float){-1.5, 1.0, 0.5, -3.999};
5782 vector float Fcons2 = (vector float){1.0, 1.0, 1.0, 1.0};
5783 vector float Fcons3 = (vector float){100000000000.0, 1.0, -1.0, -1234567890.0};
5784 #endif
5786 #elif defined (MAC_COMPILER) || defined(XLC_COMPILER)
5787 vector signed char Ccons1 = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
5788 vector signed char Ccons2 = (vector signed char)(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
5789 vector signed char Ccons3 = (vector signed char)(-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127);
5790 vector unsigned char UCcons1 = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7);
5791 vector unsigned char UCcons2 = (vector unsigned char)(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
5792 vector unsigned char UCcons3 = (vector unsigned char)(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
5793 vector signed short Scons1 = (vector signed short)(-4, -3, -2, -1, 0, 1, 2, 3);
5794 vector signed short Scons2 = (vector signed short)(-32768, 10000, 1, 1, 1, 1, -10000, -10000);
5795 vector signed short Scons3 = (vector signed short)(-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767);
5796 vector unsigned short UScons1 = (vector unsigned short)(65532, 65533, 65534, 65535, 0, 1, 2, 3);
5797 vector unsigned short UScons2 = (vector unsigned short)(1, 1, 1, 1, 1, 1, 1, 1);
5798 vector unsigned short UScons3 = (vector unsigned short)(1, 2, 3, 4, 1, 2, 3, 4);
5799 vector signed int Icons1 = (vector signed int)(-4, -1, 1, 4);
5800 vector signed int Icons2 = (vector signed int)(1, 1, 1, 1);
5801 vector signed int Icons3 = (vector signed int)(0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF);
5802 vector unsigned int UIcons1 = (vector unsigned int)(0xFFFFFFFE, 0xFFFFFFFF, 0, 1);
5803 vector unsigned int UIcons2 = (vector unsigned int)(1, 1, 1, 1);
5804 vector unsigned int UIcons3 = (vector unsigned int)(1, 2, 1, 2);
5806 #if defined TEST_FLOATS
5807 vector float Fcons1 = (vector float)(-1.5, 1.0, 0.5, -3.999);
5808 vector float Fcons2 = (vector float)(1.0, 1.0, 1.0, 1.0);
5809 vector float Fcons3 = (vector float)(100000000000.0, 1.0, -1.0, -1234567890.0);
5810 #endif
5812 #endif
5815 /* Function vec_sub */
5816 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5817 err = 0;
5818 Caux1.v = vec_sub( Ccons1, Ccons2 );
5819 Caux2.v = Ccons1;
5820 Caux3.v = Ccons2;
5821 for( i=0; i< 16; i++ )
5823 Caux = Caux2.e[i] - Caux3.e[i];
5824 if (Caux1.e[i] != Caux)
5825 err++;
5827 if (err)
5828 printf("Function vec_sub [type char] ===> Error\n");
5829 else
5830 printf("Function vec_sub [type char] ===> OK\n");
5832 err = 0;
5833 UCaux1.v = vec_sub( UCcons1, UCcons2 );
5834 UCaux2.v = UCcons1;
5835 UCaux3.v = UCcons2;
5836 for( i=0; i< 16; i++ )
5838 UCaux = UCaux2.e[i] - UCaux3.e[i];
5839 if (UCaux1.e[i] != UCaux)
5840 err++;
5842 if (err)
5843 printf("Function vec_sub [type unsigned char] ===> Error\n");
5844 else
5845 printf("Function vec_sub [type unsigned char] ===> OK\n");
5847 err = 0;
5848 Saux1.v = vec_sub( Scons1, Scons2 );
5849 Saux2.v = Scons1;
5850 Saux3.v = Scons2;
5851 for( i=0; i< 8; i++ )
5853 Saux = Saux2.e[i] - Saux3.e[i];
5854 if (Saux1.e[i] != Saux)
5855 err++;
5857 if (err)
5858 printf("Function vec_sub [type short] ===> Error\n");
5859 else
5860 printf("Function vec_sub [type short] ===> OK\n");
5862 err = 0;
5863 USaux1.v = vec_sub( UScons1, UScons2 );
5864 USaux2.v = UScons1;
5865 USaux3.v = UScons2;
5866 for( i=0; i< 8; i++ )
5868 USaux = USaux2.e[i] - USaux3.e[i];
5869 if (USaux1.e[i] != USaux)
5870 err++;
5872 if (err)
5873 printf("Function vec_sub [type unsigned short] ===> Error\n");
5874 else
5875 printf("Function vec_sub [type unsigned short] ===> OK\n");
5877 err = 0;
5878 Iaux1.v = vec_sub( Icons1, Icons2 );
5879 Iaux2.v = Icons1;
5880 Iaux3.v = Icons2;
5881 for( i=0; i< 4; i++ )
5883 Iaux = Iaux2.e[i] - Iaux3.e[i];
5884 if (Iaux1.e[i] != Iaux)
5885 err++;
5887 if (err)
5888 printf("Function vec_sub [type integer] ===> Error\n");
5889 else
5890 printf("Function vec_sub [type integer] ===> OK\n");
5892 err = 0;
5893 UIaux1.v = vec_sub( UIcons1, UIcons2 );
5894 UIaux2.v = UIcons1;
5895 UIaux3.v = UIcons2;
5896 for( i=0; i< 4; i++ )
5898 UIaux = UIaux2.e[i] - UIaux3.e[i];
5899 if (UIaux1.e[i] != UIaux)
5900 err++;
5902 if (err)
5903 printf("Function vec_sub [type unsigned int] ===> Error\n");
5904 else
5905 printf("Function vec_sub [type unsigned int] ===> OK\n");
5907 #if defined TEST_FLOATS
5908 err = 0;
5909 Faux1.v = vec_sub( Fcons1, Fcons2 );
5910 Faux2.v = Fcons1;
5911 Faux3.v = Fcons2;
5912 for( i=0; i< 4; i++ )
5914 Faux = Faux2.e[i] - Faux3.e[i];
5915 if (Faux1.e[i] != Faux)
5916 err++;
5918 if (err)
5919 printf("Function vec_sub [type float] ===> Error\n");
5920 else
5921 printf("Function vec_sub [type float] ===> OK\n");
5922 #endif
5924 /* Function vec_subc */
5925 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5926 err = 0;
5927 UIaux1.v = vec_subc( UIcons2, UIcons3 );
5928 UIaux2.v = UIcons2;
5929 UIaux3.v = UIcons3;
5930 for( i=0; i< 4; i++ )
5932 if (UIaux3.e[i]>UIaux2.e[i])
5934 if (UIaux1.e[i] != 0)
5935 err++;
5937 else
5939 if (UIaux1.e[i] != 1)
5940 err++;
5943 if (err)
5944 printf("Function vec_subc [type unsigned int] ===> Error\n");
5945 else
5946 printf("Function vec_subc [type unsigned int] ===> OK\n");
5948 /* Function vec_subs */
5949 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
5950 err = 0;
5951 Caux1.v = vec_subs( Ccons1, Ccons3 );
5952 Caux2.v = Ccons1;
5953 Caux3.v = Ccons3;
5954 for( i=0; i< 16; i++ )
5956 Caux = (signed char)Caux2.e[i]-Caux3.e[i];
5957 if ((Caux2.e[i]>=0)&&(Caux3.e[i]<0))
5959 if (Caux< Caux2.e[i])
5960 Caux=0x7F;
5962 else if ((Caux2.e[i]<0)&&(Caux3.e[i]>0))
5964 if (Caux> Caux2.e[i])
5965 Caux=0x80;
5967 if (Caux1.e[i] != Caux)
5968 err++;
5970 if (err)
5971 printf("Function vec_subs [type char] ===> Error\n");
5972 else
5973 printf("Function vec_subs [type char] ===> OK\n");
5975 err = 0;
5976 UCaux1.v = vec_subs( UCcons1, UCcons3 );
5977 UCaux2.v = UCcons1;
5978 UCaux3.v = UCcons3;
5979 for( i=0; i< 16; i++ )
5981 UCaux = (unsigned char)(UCaux2.e[i]-UCaux3.e[i]);
5982 if (UCaux> UCaux2.e[i])
5983 UCaux=0;
5984 if (UCaux1.e[i] != UCaux)
5985 err++;
5987 if (err)
5988 printf("Function vec_subs [type unsigned char] ===> Error\n");
5989 else
5990 printf("Function vec_subs [type unsigned char] ===> OK\n");
5992 err = 0;
5993 Saux1.v = vec_subs( Scons1, Scons3 );
5994 Saux2.v = Scons1;
5995 Saux3.v = Scons3;
5996 for( i=0; i< 8; i++ )
5998 Saux = (signed short)(Saux2.e[i] - Saux3.e[i]);
5999 if ((Saux2.e[i]>=0)&&(Saux3.e[i]<0))
6001 if (Saux< Saux2.e[i])
6002 Saux=0x7FFF;
6004 else if ((Saux2.e[i]<0)&&(Saux3.e[i]>0))
6006 if (Saux> Saux2.e[i])
6007 Saux=0x8000;
6009 if (Saux1.e[i] != Saux)
6010 err++;
6012 if (err)
6013 printf("Function vec_subs [type short] ===> Error\n");
6014 else
6015 printf("Function vec_subs [type short] ===> OK\n");
6017 err = 0;
6018 USaux1.v = vec_subs( UScons1, UScons3 );
6019 USaux2.v = UScons1;
6020 USaux3.v = UScons3;
6021 for( i=0; i< 8; i++ )
6023 USaux = (unsigned short)(USaux2.e[i] - USaux3.e[i]);
6024 if (USaux> USaux2.e[i])
6025 USaux=0x0;
6026 if (USaux1.e[i] != USaux)
6027 err++;
6029 if (err)
6030 printf("Function vec_subs [type unsigned short] ===> Error\n");
6031 else
6032 printf("Function vec_subs [type unsigned short] ===> OK\n");
6035 err = 0;
6036 Iaux1.v = vec_subs( Icons1, Icons3 );
6037 Iaux2.v = Icons1;
6038 Iaux3.v = Icons3;
6039 for( i=0; i< 4; i++ )
6041 Iaux = (signed int)(Iaux2.e[i] - Iaux3.e[i]);
6042 if ((Iaux2.e[i]>=0)&&(Iaux3.e[i]<0))
6044 if (Iaux< Iaux2.e[i])
6045 Iaux=0x7FFFFFFF;
6047 else if ((Iaux2.e[i]<0)&&(Iaux3.e[i]>0))
6049 if (Iaux> Iaux2.e[i])
6051 printf("%d > %d\n", Iaux, Iaux2.e[i]);
6052 Iaux=0x80000000;
6055 if (Iaux1.e[i] != Iaux)
6056 err++;
6058 if (err)
6059 printf("Function vec_subs [type integer] ===> Error\n");
6060 else
6061 printf("Function vec_subs [type integer] ===> OK\n");
6063 err = 0;
6064 UIaux1.v = vec_subs( UIcons1, UIcons3 );
6065 UIaux2.v = UIcons1;
6066 UIaux3.v = UIcons3;
6067 for( i=0; i< 4; i++ )
6069 UIaux = (unsigned int)(UIaux2.e[i] - UIaux3.e[i]);
6070 if (UIaux> UIaux2.e[i])
6071 UIaux=0x0;
6072 if (UIaux1.e[i] != UIaux)
6073 err++;
6075 if (err)
6076 printf("Function vec_subs [type unsigned int] ===> Error\n");
6077 else
6078 printf("Function vec_subs [type unsigned int] ===> OK\n");
6080 /* Function vec_sum4s */
6081 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6082 err = 0;
6083 Iaux1.v = vec_sum4s( Ccons2, Icons2 );
6084 Caux1.v = Ccons2;
6085 Iaux2.v = Icons2;
6086 for( i=0; i< 4; i++ )
6088 Iaux = Iaux2.e[i];
6089 for( j=0; j< 4; j++ )
6090 Iaux = Iaux + Caux1.e[4*i+j];
6091 if (Iaux1.e[i] != Iaux)
6092 err++;
6094 if (err)
6095 printf("Function vec_sum4s [type char] ===> Error\n");
6096 else
6097 printf("Function vec_sum4s [type char] ===> OK\n");
6099 err = 0;
6100 UIaux1.v = vec_sum4s( UCcons2, UIcons2 );
6101 UCaux1.v = UCcons2;
6102 UIaux2.v = UIcons2;
6103 for( i=0; i< 4; i++ )
6105 UIaux = UIaux2.e[i];
6106 for( j=0; j< 4; j++ )
6107 UIaux = UIaux + UCaux1.e[4*i+j];
6108 if (UIaux1.e[i] != UIaux)
6109 err++;
6111 if (err)
6112 printf("Function vec_sum4s [type unsigned char] ===> Error\n");
6113 else
6114 printf("Function vec_sum4s [type unsigned char] ===> OK\n");
6116 err = 0;
6117 Iaux1.v = vec_sum4s( Scons2, Icons2 );
6118 Saux1.v = Scons2;
6119 Iaux2.v = Icons2;
6120 for( i=0; i< 4; i++ )
6122 Iaux = Iaux2.e[i];
6123 for( j=0; j< 2; j++ )
6124 Iaux = Iaux + Saux1.e[2*i+j];
6125 if (Iaux1.e[i] != Iaux)
6126 err++;
6128 if (err)
6129 printf("Function vec_sum4s [type short] ===> Error\n");
6130 else
6131 printf("Function vec_sum4s [type short] ===> OK\n");
6133 /* Function vec_sum2s */
6134 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6135 err = 0;
6136 Iaux1.v = Icons1;
6137 Iaux2.v = Icons3;
6138 Iaux3.v = vec_sum2s( Iaux1.v, Iaux2.v );
6139 for( i=0; i< 2; i++ )
6141 LLaux = (long long int) Iaux1.e[2*i] + Iaux1.e[(2*i)+1] + Iaux2.e[(2*i)+1];
6142 if (LLaux > INT_MAX)
6144 Iaux=0x7FFFFFFF; /* INT_MAX */
6146 else if (LLaux < INT_MIN)
6148 Iaux=0x80000000; /* INT_MIN */
6150 else Iaux = (signed int) LLaux;
6152 if ((Iaux3.e[2*i] != 0) || (Iaux3.e[(2*i)+1] != Iaux))
6153 err++;
6155 if (err)
6156 printf("Function vec_sum2s [type integer] ===> Error\n");
6157 else
6158 printf("Function vec_sum2s [type integer] ===> OK\n");
6160 /* Function vec_sums */
6161 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6162 err = 0;
6164 /* Not saturated test */
6165 Iaux1.v = Icons1;
6166 Iaux2.v = Icons3;
6167 Iaux3.v = vec_sums( Iaux1.v, Iaux2.v );
6169 LLaux = (long long int) Iaux1.e[0] + Iaux1.e[1] + Iaux1.e[2] + Iaux1.e[3] + Iaux2.e[3];
6170 if (LLaux > INT_MAX)
6172 Iaux=0x7FFFFFFF; /* INT_MAX */
6174 else if (LLaux < INT_MIN)
6176 Iaux=0x80000000; /* INT_MIN */
6178 else Iaux = (signed int) LLaux;
6180 if ((Iaux3.e[0] != 0) || (Iaux3.e[1] != 0) || (Iaux3.e[2] != 0) ||
6181 (Iaux3.e[3] != Iaux))
6182 err++;
6184 /* Saturated test */
6185 Iaux1.v = Icons2;
6186 Iaux2.v = Icons3;
6187 Iaux3.v = vec_sums( Iaux1.v, Iaux2.v );
6189 LLaux = (long long int) Iaux1.e[0] + Iaux1.e[1] + Iaux1.e[2] + Iaux1.e[3] + Iaux2.e[3];
6190 if (LLaux > INT_MAX)
6192 Iaux=0x7FFFFFFF; /* INT_MAX */
6194 else if (LLaux < INT_MIN)
6196 Iaux=0x80000000; /* INT_MIN */
6198 else Iaux = (signed int) LLaux;
6200 if ((Iaux3.e[0] != 0) || (Iaux3.e[1] != 0) || (Iaux3.e[2] != 0) ||
6201 (Iaux3.e[3] != Iaux))
6202 err++;
6204 if (err)
6205 printf("Function vec_sums [type integer] ===> Error\n");
6206 else
6207 printf("Function vec_sums [type integer] ===> OK\n");
6209 #if defined TEST_FLOATS
6210 /* Function vec_trunc */
6211 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6212 err = 0;
6213 Faux1.v = Fcons1;
6214 Faux2.v = vec_trunc( Faux1.v );
6215 for( i=0; i< 4; i++ )
6217 Faux = truncf(Faux1.e[i]);
6218 if (Faux2.e[i] != Faux)
6219 err++;
6221 if (err)
6222 printf("Function vec_trunc [type float] ===> Error\n");
6223 else
6224 printf("Function vec_trunc [type float] ===> OK\n");
6225 #endif
6227 /* Function vec_unpackh */
6228 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6229 err = 0;
6230 Caux1.v = Ccons1;
6231 Saux1.v = vec_unpackh( Caux1.v );
6232 for ( i=0; i< 8; i++ )
6234 Saux = (signed short)Caux1.e[i];
6235 if (Saux1.e[i] != Saux)
6236 err++;
6239 if (err)
6240 printf("Function vec_unpackh [type short-char] ===> Error\n");
6241 else
6242 printf("Function vec_unpackh [type short-char] ===> OK\n");
6244 err = 0;
6245 Saux1.v = Scons3;
6246 Iaux1.v = vec_unpackh( Saux1.v );
6247 for ( i=0; i< 4; i++ )
6249 Iaux = (signed int)Saux1.e[i];
6250 if (Iaux1.e[i] != Iaux)
6251 err++;
6254 if (err)
6255 printf("Function vec_unpackh [type int-short] ===> Error\n");
6256 else
6257 printf("Function vec_unpackh [type int-short] ===> OK\n");
6259 /* Function vec_unpackl */
6260 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6261 err = 0;
6262 Caux1.v = Ccons3;
6263 Saux1.v = vec_unpackl( Caux1.v );
6264 for ( i=0; i< 8; i++ )
6266 Saux = (signed short)Caux1.e[i+8];
6267 if (Saux1.e[i] != Saux)
6268 err++;
6271 if (err)
6272 printf("Function vec_unpackl [type short-char] ===> Error\n");
6273 else
6274 printf("Function vec_unpackl [type short-char] ===> OK\n");
6276 err = 0;
6277 Saux1.v = Scons1;
6278 Iaux1.v = vec_unpackl( Saux1.v );
6279 for ( i=0; i< 4; i++ )
6281 Iaux = (signed int)Saux1.e[i+4];
6282 if (Iaux1.e[i] != Iaux)
6283 err++;
6286 if (err)
6287 printf("Function vec_unpackl [type int-short] ===> Error\n");
6288 else
6289 printf("Function vec_unpackl [type int-short] ===> OK\n");
6291 /* Function vec_xor */
6292 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6293 err = 0;
6294 UCaux1.v = UCcons1;
6295 UCaux2.v = UCcons3;
6296 UCaux3.v = vec_xor( UCaux1.v, UCaux2.v );
6297 for( i=0; i< 16; i++ )
6299 UCaux = UCaux1.e[i] ^ UCaux2.e[i];
6300 if (UCaux3.e[i] != UCaux)
6301 err++;
6303 if (err)
6304 printf("Function vec_xor [type unsigned char] ===> Error\n");
6305 else
6306 printf("Function vec_xor [type unsigned char] ===> OK\n");
6308 err = 0;
6309 Caux1.v = Ccons1;
6310 Caux2.v = Ccons3;
6311 Caux3.v = vec_xor( Caux1.v, Caux2.v );
6312 for( i=0; i< 16; i++ )
6314 Caux = Caux1.e[i] ^ Caux2.e[i];
6315 if (Caux3.e[i] != Caux)
6316 err++;
6318 if (err)
6319 printf("Function vec_xor [type char] ===> Error\n");
6320 else
6321 printf("Function vec_xor [type char] ===> OK\n");
6323 err = 0;
6324 USaux1.v = UScons1;
6325 USaux2.v = UScons3;
6326 USaux3.v = vec_xor( USaux1.v, USaux2.v );
6327 for( i=0; i< 8; i++ )
6329 USaux = USaux1.e[i] ^ USaux2.e[i];
6330 if (USaux3.e[i] != USaux)
6331 err++;
6333 if (err)
6334 printf("Function vec_xor [type unsigned short] ===> Error\n");
6335 else
6336 printf("Function vec_xor [type unsigned short] ===> OK\n");
6338 err = 0;
6339 Saux1.v = Scons1;
6340 Saux2.v = Scons3;
6341 Saux3.v = vec_xor( Saux1.v, Saux2.v );
6342 for( i=0; i< 8; i++ )
6344 Saux = Saux1.e[i] ^ Saux2.e[i];
6345 if (Saux3.e[i] != Saux)
6346 err++;
6348 if (err)
6349 printf("Function vec_xor [type short] ===> Error\n");
6350 else
6351 printf("Function vec_xor [type short] ===> OK\n");
6353 err = 0;
6354 UIaux1.v = UIcons1;
6355 UIaux2.v = UIcons3;
6356 UIaux3.v = vec_xor( UIaux1.v, UIaux2.v );
6357 for( i=0; i< 4; i++ )
6359 UIaux = UIaux1.e[i] ^ UIaux2.e[i];
6360 if (UIaux3.e[i] != UIaux)
6361 err++;
6363 if (err)
6364 printf("Function vec_xor [type unsigned int] ===> Error\n");
6365 else
6366 printf("Function vec_xor [type unsigned int] ===> OK\n");
6368 err = 0;
6369 Iaux1.v = Icons1;
6370 Iaux2.v = Icons3;
6371 Iaux3.v = vec_xor( Iaux1.v, Iaux2.v );
6372 for( i=0; i< 4; i++ )
6374 Iaux = Iaux1.e[i] ^ Iaux2.e[i];
6375 if (Iaux3.e[i] != Iaux)
6376 err++;
6378 if (err)
6379 printf("Function vec_xor [type int] ===> Error\n");
6380 else
6381 printf("Function vec_xor [type int] ===> OK\n");
6383 #if defined TEST_FLOATS
6384 err = 0;
6385 Faux1.v = Fcons1;
6386 Faux2.v = Fcons3;
6387 Faux3.v = vec_xor( Faux1.v, Faux2.v );
6388 for( i=0; i< 4; i++ )
6390 Iaux = Faux1.i[i] ^ Faux2.i[i];
6392 if (Faux3.i[i] != Iaux)
6393 err++;
6395 if (err)
6396 printf("Function vec_xor [type float] ===> Error\n");
6397 else
6398 printf("Function vec_xor [type float] ===> OK\n");
6399 #endif
6401 return 0;
6407 int part5()
6409 TvecChar Caux1, Caux2;//, Caux3, Caux4;
6410 TvecUChar UCaux1, UCaux2;//, UCaux3, UCaux4;
6411 TvecShort Saux1, Saux2;//, Saux3, Saux4;
6412 TvecUShort USaux1, USaux2;//, USaux3, USaux4;
6413 TvecInt Iaux1, Iaux2;//, Iaux3, Iaux4;
6414 TvecUInt UIaux1, UIaux2;//, UIaux3, UIaux4;
6415 #if defined TEST_FLOATS
6416 TvecFloat Faux1, Faux2;//, Faux3, Faux4;
6417 #endif
6419 int i, err, /*j,*/ b, bAux;
6420 // signed int Ivec1, Ivec2, Ivec3;
6421 // signed short *Svec1;
6422 // unsigned int *UIvec1;
6423 // unsigned short *USvec1;
6424 // unsigned char *UCvec1;
6425 #if defined TEST_FLOATS
6426 // float *Fvec1;
6427 #endif
6429 /* For saturated rutines */
6430 // long long int LLaux;
6432 #if defined TEST_FLOATS
6433 // float Faux;
6434 #endif
6435 signed int Iaux, I1;//, I2;
6436 // unsigned int UIaux, UI1, UI2;
6437 // signed short Saux;
6438 // unsigned short USaux;
6439 // signed char Caux;
6440 // unsigned char UCaux;
6443 union
6445 float f;
6446 signed int si;
6447 unsigned int ui;
6448 signed short ss[2];
6449 unsigned short us[2];
6450 signed char sc[4];
6451 unsigned char uc[4];
6452 } INTunion1, INTunion2;
6454 union
6456 signed short ss;
6457 unsigned short us;
6458 signed char sc[2];
6459 unsigned char uc[2];
6460 } SHOunion1, SHOunion2;
6464 #if defined (GCC_COMPILER)
6465 vector signed char Ccons1 = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
6466 vector signed char Ccons2 = (vector signed char){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
6467 vector signed char Ccons3 = (vector signed char){-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127};
6468 vector unsigned char UCcons1 = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7};
6469 vector unsigned char UCcons2 = (vector unsigned char){2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
6470 vector unsigned char UCcons3 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8};
6471 vector signed short Scons1 = (vector signed short){-4, -3, -2, -1, 0, 1, 2, 3};
6472 vector signed short Scons2 = (vector signed short){-32768, 10000, 1, 1, 1, 1, -10000, -10000};
6473 vector signed short Scons3 = (vector signed short){-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767};
6474 vector unsigned short UScons1 = (vector unsigned short){65532, 65533, 65534, 65535, 0, 1, 2, 3};
6475 vector unsigned short UScons2 = (vector unsigned short){1, 1, 1, 1, 1, 1, 1, 1};
6476 vector unsigned short UScons3 = (vector unsigned short){1, 2, 3, 4, 1, 2, 3, 4};
6477 vector signed int Icons1 = (vector signed int){-4, -1, 1, 4};
6478 vector signed int Icons2 = (vector signed int){1, 1, 1, 1};
6479 vector signed int Icons3 = (vector signed int){0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF};
6480 vector unsigned int UIcons1 = (vector unsigned int){0xFFFFFFFE, 0xFFFFFFFF, 0, 1};
6481 vector unsigned int UIcons2 = (vector unsigned int){1, 1, 1, 1};
6482 vector unsigned int UIcons3 = (vector unsigned int){1, 2, 1, 2};
6484 #if defined TEST_FLOATS
6485 vector float Fcons1 = (vector float){-1.5, 1.0, 0.5, -3.999};
6486 vector float Fcons2 = (vector float){1.0, 1.0, 1.0, 1.0};
6487 vector float Fcons3 = (vector float){100000000000.0, 1.0, -1.0, -1234567890.0};
6488 #endif
6490 #elif defined (MAC_COMPILER) || defined(XLC_COMPILER)
6491 vector signed char Ccons1 = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
6492 vector signed char Ccons2 = (vector signed char)(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
6493 vector signed char Ccons3 = (vector signed char)(-128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127, -128, 127);
6494 vector unsigned char UCcons1 = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7);
6495 vector unsigned char UCcons2 = (vector unsigned char)(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
6496 vector unsigned char UCcons3 = (vector unsigned char)(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
6497 vector signed short Scons1 = (vector signed short)(-4, -3, -2, -1, 0, 1, 2, 3);
6498 vector signed short Scons2 = (vector signed short)(-32768, 10000, 1, 1, 1, 1, -10000, -10000);
6499 vector signed short Scons3 = (vector signed short)(-32768, 32767, -32768, 32767, -32768, 32767, -32768, 32767);
6500 vector unsigned short UScons1 = (vector unsigned short)(65532, 65533, 65534, 65535, 0, 1, 2, 3);
6501 vector unsigned short UScons2 = (vector unsigned short)(1, 1, 1, 1, 1, 1, 1, 1);
6502 vector unsigned short UScons3 = (vector unsigned short)(1, 2, 3, 4, 1, 2, 3, 4);
6503 vector signed int Icons1 = (vector signed int)(-4, -1, 1, 4);
6504 vector signed int Icons2 = (vector signed int)(1, 1, 1, 1);
6505 vector signed int Icons3 = (vector signed int)(0x80000000, 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF);
6506 vector unsigned int UIcons1 = (vector unsigned int)(0xFFFFFFFE, 0xFFFFFFFF, 0, 1);
6507 vector unsigned int UIcons2 = (vector unsigned int)(1, 1, 1, 1);
6508 vector unsigned int UIcons3 = (vector unsigned int)(1, 2, 1, 2);
6510 #if defined TEST_FLOATS
6511 vector float Fcons1 = (vector float)(-1.5, 1.0, 0.5, -3.999);
6512 vector float Fcons2 = (vector float)(1.0, 1.0, 1.0, 1.0);
6513 vector float Fcons3 = (vector float)(100000000000.0, 1.0, -1.0, -1234567890.0);
6514 #endif
6516 #endif
6519 /* Function vec_all_eq */
6520 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6521 err = 0;
6522 UCaux1.v = UCcons1;
6523 UCaux2.v = UCcons1;
6524 I1 = vec_all_eq( UCaux1.v, UCaux2.v );
6525 Iaux = 1;
6526 for ( i=0; i< 16; i++ )
6528 Iaux = Iaux && (UCaux1.e[i]==UCaux2.e[i]);
6530 if (I1 != Iaux) err++;
6532 UCaux1.v = UCcons2;
6533 UCaux2.v = UCcons3;
6534 I1 = vec_all_eq( UCaux1.v, UCaux2.v );
6535 Iaux = 1;
6536 for ( i=0; i< 16; i++ )
6538 Iaux = Iaux && (UCaux1.e[i]==UCaux2.e[i]);
6540 if (I1 != Iaux) err++;
6542 if (err)
6543 printf("Function vec_all_eq [type unsigned char] ===> Error\n");
6544 else
6545 printf("Function vec_all_eq [type unsigned char] ===> OK\n");
6547 err = 0;
6548 Caux1.v = Ccons1;
6549 Caux2.v = Ccons1;
6550 I1 = vec_all_eq( Caux1.v, Caux2.v );
6551 Iaux = 1;
6552 for ( i=0; i< 16; i++ )
6554 Iaux = Iaux && (Caux1.e[i]==Caux2.e[i]);
6556 if (I1 != Iaux) err++;
6558 Caux1.v = Ccons1;
6559 Caux2.v = Ccons2;
6560 I1 = vec_all_eq( Caux1.v, Caux2.v );
6561 Iaux = 1;
6562 for ( i=0; i< 16; i++ )
6564 Iaux = Iaux && (Caux1.e[i]==Caux2.e[i]);
6566 if (I1 != Iaux) err++;
6568 if (err)
6569 printf("Function vec_all_eq [type char] ===> Error\n");
6570 else
6571 printf("Function vec_all_eq [type char] ===> OK\n");
6573 err = 0;
6574 USaux1.v = UScons1;
6575 USaux2.v = UScons1;
6576 I1 = vec_all_eq( USaux1.v, USaux2.v );
6577 Iaux = 1;
6578 for ( i=0; i< 8; i++ )
6580 Iaux = Iaux && (USaux1.e[i]==USaux2.e[i]);
6582 if (I1 != Iaux) err++;
6584 USaux1.v = UScons2;
6585 USaux2.v = UScons3;
6586 I1 = vec_all_eq( USaux1.v, USaux2.v );
6587 Iaux = 1;
6588 for ( i=0; i< 8; i++ )
6590 Iaux = Iaux && (USaux1.e[i]==USaux2.e[i]);
6592 if (I1 != Iaux) err++;
6594 if (err)
6595 printf("Function vec_all_eq [type unsigned short] ===> Error\n");
6596 else
6597 printf("Function vec_all_eq [type unsigned short] ===> OK\n");
6599 err = 0;
6600 Saux1.v = Scons1;
6601 Saux2.v = Scons1;
6602 I1 = vec_all_eq( Saux1.v, Saux2.v );
6603 Iaux = 1;
6604 for ( i=0; i< 8; i++ )
6606 Iaux = Iaux && (Saux1.e[i]==Saux2.e[i]);
6608 if (I1 != Iaux) err++;
6610 Saux1.v = Scons2;
6611 Saux2.v = Scons3;
6612 I1 = vec_all_eq( Saux1.v, Saux2.v );
6613 Iaux = 1;
6614 for ( i=0; i< 8; i++ )
6616 Iaux = Iaux && (Saux1.e[i]==Saux2.e[i]);
6618 if (I1 != Iaux) err++;
6620 if (err)
6621 printf("Function vec_all_eq [type short] ===> Error\n");
6622 else
6623 printf("Function vec_all_eq [type short] ===> OK\n");
6625 err = 0;
6626 UIaux1.v = UIcons1;
6627 UIaux2.v = UIcons1;
6628 I1 = vec_all_eq( UIaux1.v, UIaux2.v );
6629 Iaux = 1;
6630 for ( i=0; i< 4; i++ )
6632 Iaux = Iaux && (UIaux1.e[i]==UIaux2.e[i]);
6634 if (I1 != Iaux) err++;
6636 UIaux1.v = UIcons2;
6637 UIaux2.v = UIcons3;
6638 I1 = vec_all_eq( UIaux1.v, UIaux2.v );
6639 Iaux = 1;
6640 for ( i=0; i< 4; i++ )
6642 Iaux = Iaux && (UIaux1.e[i]==UIaux2.e[i]);
6644 if (I1 != Iaux) err++;
6646 if (err)
6647 printf("Function vec_all_eq [type unsigned int] ===> Error\n");
6648 else
6649 printf("Function vec_all_eq [type unsigned int] ===> OK\n");
6651 err = 0;
6652 Iaux1.v = Icons1;
6653 Iaux2.v = Icons1;
6654 I1 = vec_all_eq( Iaux1.v, Iaux2.v );
6655 Iaux = 1;
6656 for ( i=0; i< 4; i++ )
6658 Iaux = Iaux && (Iaux1.e[i]==Iaux2.e[i]);
6660 if (I1 != Iaux) err++;
6662 Iaux1.v = Icons1;
6663 Iaux2.v = Icons2;
6664 I1 = vec_all_eq( Iaux1.v, Iaux2.v );
6665 Iaux = 1;
6666 for ( i=0; i< 4; i++ )
6668 Iaux = Iaux && (Iaux1.e[i]==Iaux2.e[i]);
6670 if (I1 != Iaux) err++;
6672 if (err)
6673 printf("Function vec_all_eq [type int] ===> Error\n");
6674 else
6675 printf("Function vec_all_eq [type int] ===> OK\n");
6677 #if defined TEST_FLOATS
6678 err = 0;
6679 Faux1.v = Fcons1;
6680 Faux2.v = Fcons1;
6681 I1 = vec_all_eq( Faux1.v, Faux2.v );
6682 Iaux = 1;
6683 for ( i=0; i< 4; i++ )
6685 Iaux = Iaux && (Faux1.e[i]==Faux2.e[i]);
6687 if (I1 != Iaux) err++;
6689 Faux1.v = Fcons1;
6690 Faux2.v = Fcons2;
6691 I1 = vec_all_eq( Faux1.v, Faux2.v );
6692 Iaux = 1;
6693 for ( i=0; i< 4; i++ )
6695 Iaux = Iaux && (Faux1.e[i]==Faux2.e[i]);
6697 if (I1 != Iaux) err++;
6699 if (err)
6700 printf("Function vec_all_eq [type float] ===> Error\n");
6701 else
6702 printf("Function vec_all_eq [type float] ===> OK\n");
6703 #endif
6705 /* Function vec_all_ge */
6706 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6707 err = 0;
6708 UCaux1.v = UCcons2;
6709 UCaux2.v = UCcons2;
6710 I1 = vec_all_ge( UCaux1.v, UCaux2.v );
6711 Iaux = 1;
6712 for ( i=0; i< 16; i++ )
6714 Iaux = Iaux && (UCaux1.e[i]>=UCaux2.e[i]);
6716 if (I1 != Iaux) err++;
6718 UCaux1.v = UCcons2;
6719 UCaux2.v = UCcons3;
6720 I1 = vec_all_ge( UCaux1.v, UCaux2.v );
6721 Iaux = 1;
6722 for ( i=0; i< 16; i++ )
6724 Iaux = Iaux && (UCaux1.e[i]>=UCaux2.e[i]);
6726 if (I1 != Iaux) err++;
6728 if (err)
6729 printf("Function vec_all_ge [type unsigned char] ===> Error\n");
6730 else
6731 printf("Function vec_all_ge [type unsigned char] ===> OK\n");
6733 err = 0;
6734 Caux1.v = Ccons2;
6735 Caux2.v = Ccons2;
6736 I1 = vec_all_ge( Caux1.v, Caux2.v );
6737 Iaux = 1;
6738 for ( i=0; i< 16; i++ )
6740 Iaux = Iaux && (Caux1.e[i]>=Caux2.e[i]);
6742 if (I1 != Iaux) err++;
6744 Caux1.v = Ccons2;
6745 Caux2.v = Ccons3;
6746 I1 = vec_all_ge( Caux1.v, Caux2.v );
6747 Iaux = 1;
6748 for ( i=0; i< 16; i++ )
6750 Iaux = Iaux && (Caux1.e[i]>=Caux2.e[i]);
6752 if (I1 != Iaux) err++;
6754 if (err)
6755 printf("Function vec_all_ge [type char] ===> Error\n");
6756 else
6757 printf("Function vec_all_ge [type char] ===> OK\n");
6759 err = 0;
6760 USaux1.v = UScons3;
6761 USaux2.v = UScons2;
6762 I1 = vec_all_ge( USaux1.v, USaux2.v );
6763 Iaux = 1;
6764 for ( i=0; i< 8; i++ )
6766 Iaux = Iaux && (USaux1.e[i]>=USaux2.e[i]);
6768 if (I1 != Iaux) err++;
6770 USaux1.v = UScons1;
6771 USaux2.v = UScons2;
6772 I1 = vec_all_ge( USaux1.v, USaux2.v );
6773 Iaux = 1;
6774 for ( i=0; i< 8; i++ )
6776 Iaux = Iaux && (USaux1.e[i]>=USaux2.e[i]);
6778 if (I1 != Iaux) err++;
6780 if (err)
6781 printf("Function vec_all_ge [type unsigned short] ===> Error\n");
6782 else
6783 printf("Function vec_all_ge [type unsigned short] ===> OK\n");
6785 err = 0;
6786 Saux1.v = Scons1;
6787 Saux2.v = Scons1;
6788 I1 = vec_all_ge( Saux1.v, Saux2.v );
6789 Iaux = 1;
6790 for ( i=0; i< 8; i++ )
6792 Iaux = Iaux && (Saux1.e[i]>=Saux2.e[i]);
6794 if (I1 != Iaux) err++;
6796 Saux1.v = Scons2;
6797 Saux2.v = Scons3;
6798 I1 = vec_all_ge( Saux1.v, Saux2.v );
6799 Iaux = 1;
6800 for ( i=0; i< 8; i++ )
6802 Iaux = Iaux && (Saux1.e[i]>=Saux2.e[i]);
6804 if (I1 != Iaux) err++;
6806 if (err)
6807 printf("Function vec_all_ge [type short] ===> Error\n");
6808 else
6809 printf("Function vec_all_ge [type short] ===> OK\n");
6811 err = 0;
6812 UIaux1.v = UIcons3;
6813 UIaux2.v = UIcons2;
6814 I1 = vec_all_ge( UIaux1.v, UIaux2.v );
6815 Iaux = 1;
6816 for ( i=0; i< 4; i++ )
6818 Iaux = Iaux && (UIaux1.e[i]>=UIaux2.e[i]);
6820 if (I1 != Iaux) err++;
6822 UIaux1.v = UIcons1;
6823 UIaux2.v = UIcons2;
6824 I1 = vec_all_ge( UIaux1.v, UIaux2.v );
6825 Iaux = 1;
6826 for ( i=0; i< 4; i++ )
6828 Iaux = Iaux && (UIaux1.e[i]>=UIaux2.e[i]);
6830 if (I1 != Iaux) err++;
6832 if (err)
6833 printf("Function vec_all_ge [type unsigned int] ===> Error\n");
6834 else
6835 printf("Function vec_all_ge [type unsigned int] ===> OK\n");
6837 err = 0;
6838 Iaux1.v = Icons2;
6839 Iaux2.v = Icons2;
6840 I1 = vec_all_ge( Iaux1.v, Iaux2.v );
6841 Iaux = 1;
6842 for ( i=0; i< 4; i++ )
6844 Iaux = Iaux && (Iaux1.e[i]>=Iaux2.e[i]);
6846 if (I1 != Iaux) err++;
6848 Iaux1.v = Icons2;
6849 Iaux2.v = Icons1;
6850 I1 = vec_all_ge( Iaux1.v, Iaux2.v );
6851 Iaux = 1;
6852 for ( i=0; i< 4; i++ )
6854 Iaux = Iaux && (Iaux1.e[i]>=Iaux2.e[i]);
6856 if (I1 != Iaux) err++;
6858 if (err)
6859 printf("Function vec_all_ge [type int] ===> Error\n");
6860 else
6861 printf("Function vec_all_ge [type int] ===> OK\n");
6863 #if defined TEST_FLOATS
6864 err = 0;
6865 Faux1.v = Fcons2;
6866 Faux2.v = Fcons1;
6867 I1 = vec_all_ge( Faux1.v, Faux2.v );
6868 Iaux = 1;
6869 for ( i=0; i< 4; i++ )
6871 Iaux = Iaux && (Faux1.e[i]>=Faux2.e[i]);
6873 if (I1 != Iaux) err++;
6875 Faux1.v = Fcons2;
6876 Faux2.v = Fcons3;
6877 I1 = vec_all_ge( Faux1.v, Faux2.v );
6878 Iaux = 1;
6879 for ( i=0; i< 4; i++ )
6881 Iaux = Iaux && (Faux1.e[i]>=Faux2.e[i]);
6883 if (I1 != Iaux) err++;
6885 if (err)
6886 printf("Function vec_all_ge [type float] ===> Error\n");
6887 else
6888 printf("Function vec_all_ge [type float] ===> OK\n");
6889 #endif
6891 /* Function vec_all_gt */
6892 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
6893 err = 0;
6894 # if defined (GCC_COMPILER)
6895 UCaux1.v = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 2, 3, 4, 5, 6, 7, 8, 9};
6896 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
6897 UCaux1.v = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 2, 3, 4, 5, 6, 7, 8, 9);
6898 # endif
6899 UCaux2.v = UCcons2;
6900 I1 = vec_all_gt( UCaux1.v, UCaux2.v );
6901 Iaux = 1;
6902 for ( i=0; i< 16; i++ )
6904 Iaux = Iaux && (UCaux1.e[i]>UCaux2.e[i]);
6906 if (I1 != Iaux) err++;
6908 UCaux1.v = UCcons2;
6909 UCaux2.v = UCcons3;
6910 I1 = vec_all_gt( UCaux1.v, UCaux2.v );
6911 Iaux = 1;
6912 for ( i=0; i< 16; i++ )
6914 Iaux = Iaux && (UCaux1.e[i]>UCaux2.e[i]);
6916 if (I1 != Iaux) err++;
6918 if (err)
6919 printf("Function vec_all_gt [type unsigned char] ===> Error\n");
6920 else
6921 printf("Function vec_all_gt [type unsigned char] ===> OK\n");
6923 err = 0;
6924 # if defined (GCC_COMPILER)
6925 Caux1.v = (vector signed char){9, 8, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10};
6926 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
6927 Caux1.v = (vector signed char)(9, 8, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10);
6928 # endif
6929 Caux2.v = Ccons2;
6930 I1 = vec_all_gt( Caux1.v, Caux2.v );
6931 Iaux = 1;
6932 for ( i=0; i< 16; i++ )
6934 Iaux = Iaux && (Caux1.e[i]>Caux2.e[i]);
6936 if (I1 != Iaux) err++;
6938 Caux1.v = Ccons2;
6939 Caux2.v = Ccons3;
6940 I1 = vec_all_gt( Caux1.v, Caux2.v );
6941 Iaux = 1;
6942 for ( i=0; i< 16; i++ )
6944 Iaux = Iaux && (Caux1.e[i]>Caux2.e[i]);
6946 if (I1 != Iaux) err++;
6948 if (err)
6949 printf("Function vec_all_gt [type char] ===> Error\n");
6950 else
6951 printf("Function vec_all_gt [type char] ===> OK\n");
6953 err = 0;
6954 # if defined (GCC_COMPILER)
6955 USaux1.v = (vector unsigned short){65532, 65533, 65534, 65535, 2, 3, 4, 5};
6956 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
6957 USaux1.v = (vector unsigned short)(65532, 65533, 65534, 65535, 2, 3, 4, 5);
6958 # endif
6959 USaux2.v = UScons2;
6960 I1 = vec_all_gt( USaux1.v, USaux2.v );
6961 Iaux = 1;
6962 for ( i=0; i< 8; i++ )
6964 Iaux = Iaux && (USaux1.e[i]>USaux2.e[i]);
6966 if (I1 != Iaux) err++;
6968 USaux1.v = UScons1;
6969 USaux2.v = UScons2;
6970 I1 = vec_all_gt( USaux1.v, USaux2.v );
6971 Iaux = 1;
6972 for ( i=0; i< 8; i++ )
6974 Iaux = Iaux && (USaux1.e[i]>USaux2.e[i]);
6976 if (I1 != Iaux) err++;
6978 if (err)
6979 printf("Function vec_all_gt [type unsigned short] ===> Error\n");
6980 else
6981 printf("Function vec_all_gt [type unsigned short] ===> OK\n");
6983 err = 0;
6984 # if defined (GCC_COMPILER)
6985 Saux1.v = (vector signed short){4, 3, 2, 1, 2, 3, 4, 5};
6986 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
6987 Saux1.v = (vector signed short)(4, 3, 2, 1, 2, 3, 4, 5);
6988 # endif
6989 Saux2.v = Scons1;
6990 I1 = vec_all_gt( Saux1.v, Saux2.v );
6991 Iaux = 1;
6992 for ( i=0; i< 8; i++ )
6994 Iaux = Iaux && (Saux1.e[i]>Saux2.e[i]);
6996 if (I1 != Iaux) err++;
6998 Saux1.v = Scons2;
6999 Saux2.v = Scons3;
7000 I1 = vec_all_gt( Saux1.v, Saux2.v );
7001 Iaux = 1;
7002 for ( i=0; i< 8; i++ )
7004 Iaux = Iaux && (Saux1.e[i]>Saux2.e[i]);
7006 if (I1 != Iaux) err++;
7008 if (err)
7009 printf("Function vec_all_gt [type short] ===> Error\n");
7010 else
7011 printf("Function vec_all_gt [type short] ===> OK\n");
7013 err = 0;
7014 # if defined (GCC_COMPILER)
7015 UIaux1.v = (vector unsigned int){3, 2, 3, 2};
7016 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7017 UIaux1.v = (vector unsigned int)(3, 2, 3, 2);
7018 # endif
7019 UIaux2.v = UIcons2;
7020 I1 = vec_all_gt( UIaux1.v, UIaux2.v );
7021 Iaux = 1;
7022 for ( i=0; i< 4; i++ )
7024 Iaux = Iaux && (UIaux1.e[i]>UIaux2.e[i]);
7026 if (I1 != Iaux) err++;
7028 UIaux1.v = UIcons1;
7029 UIaux2.v = UIcons2;
7030 I1 = vec_all_gt( UIaux1.v, UIaux2.v );
7031 Iaux = 1;
7032 for ( i=0; i< 4; i++ )
7034 Iaux = Iaux && (UIaux1.e[i]>UIaux2.e[i]);
7036 if (I1 != Iaux) err++;
7038 if (err)
7039 printf("Function vec_all_gt [type unsigned int] ===> Error\n");
7040 else
7041 printf("Function vec_all_gt [type unsigned int] ===> OK\n");
7043 err = 0;
7044 # if defined (GCC_COMPILER)
7045 Iaux1.v = (vector signed int){4, 10, 10, 4};
7046 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7047 Iaux1.v = (vector signed int)(4, 10, 10, 4);
7048 # endif
7049 Iaux2.v = Icons2;
7050 I1 = vec_all_gt( Iaux1.v, Iaux2.v );
7051 Iaux = 1;
7052 for ( i=0; i< 4; i++ )
7054 Iaux = Iaux && (Iaux1.e[i]>Iaux2.e[i]);
7056 if (I1 != Iaux) err++;
7058 Iaux1.v = Icons2;
7059 Iaux2.v = Icons1;
7060 I1 = vec_all_gt( Iaux1.v, Iaux2.v );
7061 Iaux = 1;
7062 for ( i=0; i< 4; i++ )
7064 Iaux = Iaux && (Iaux1.e[i]>Iaux2.e[i]);
7066 if (I1 != Iaux) err++;
7068 if (err)
7069 printf("Function vec_all_gt [type int] ===> Error\n");
7070 else
7071 printf("Function vec_all_gt [type int] ===> OK\n");
7073 #if defined TEST_FLOATS
7074 err = 0;
7075 # if defined (GCC_COMPILER)
7076 Faux1.v = (vector float){100000000000.0, 12.0, 12.0, 1234567890.0};
7077 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7078 Faux1.v = (vector float)(100000000000.0, 12.0, 12.0, 1234567890.0);
7079 # endif
7080 Faux2.v = Fcons1;
7081 I1 = vec_all_gt( Faux1.v, Faux2.v );
7082 Iaux = 1;
7083 for ( i=0; i< 4; i++ )
7085 Iaux = Iaux && (Faux1.e[i]>Faux2.e[i]);
7087 if (I1 != Iaux) err++;
7089 Faux1.v = Fcons2;
7090 Faux2.v = Fcons3;
7091 I1 = vec_all_gt( Faux1.v, Faux2.v );
7092 Iaux = 1;
7093 for ( i=0; i< 4; i++ )
7095 Iaux = Iaux && (Faux1.e[i]>Faux2.e[i]);
7097 if (I1 != Iaux) err++;
7099 if (err)
7100 printf("Function vec_all_gt [type float] ===> Error\n");
7101 else
7102 printf("Function vec_all_gt [type float] ===> OK\n");
7103 #endif
7105 #if defined TEST_FLOATS
7106 /* Function vec_all_in */
7107 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7108 err = 0;
7109 Faux1.v = Fcons1;
7110 Faux2.v = Fcons2;
7111 I1 = vec_all_in( Faux1.v, Faux2.v );
7112 Iaux = 1;
7113 for ( i=0; i< 4; i++ )
7115 Iaux = Iaux && ((Faux1.e[i]<=Faux2.e[i]) && (Faux1.e[i]>=-Faux2.e[i]));
7117 if (I1 != Iaux) err++;
7119 Faux1.v = Fcons2;
7120 # if defined (GCC_COMPILER)
7121 Faux2.v = (vector float){100000000000.0, 1.0, 1.0, 1234567890.0};
7122 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7123 Faux2.v = (vector float)(100000000000.0, 1.0, 1.0, 1234567890.0);
7124 # endif
7125 I1 = vec_all_in( Faux1.v, Faux2.v );
7126 Iaux = 1;
7127 for ( i=0; i< 4; i++ )
7129 Iaux = Iaux && ((Faux1.e[i]<=Faux2.e[i]) && (Faux1.e[i]>=-Faux2.e[i]));
7131 if (I1 != Iaux) err++;
7133 if (err)
7134 printf("Function vec_all_in [type float] ===> Error\n");
7135 else
7136 printf("Function vec_all_in [type float] ===> OK\n");
7137 #endif
7139 /* Function vec_all_le */
7140 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7141 err = 0;
7142 UCaux1.v = UCcons2;
7143 UCaux2.v = UCcons3;
7144 I1 = vec_all_le( UCaux1.v, UCaux2.v );
7145 Iaux = 1;
7146 for ( i=0; i< 16; i++ )
7148 Iaux = Iaux && (UCaux1.e[i]<=UCaux2.e[i]);
7150 if (I1 != Iaux) err++;
7152 UCaux1.v = UCcons1;
7153 UCaux2.v = UCcons2;
7154 I1 = vec_all_le( UCaux1.v, UCaux2.v );
7155 Iaux = 1;
7156 for ( i=0; i< 16; i++ )
7158 Iaux = Iaux && (UCaux1.e[i]<=UCaux2.e[i]);
7160 if (I1 != Iaux) err++;
7162 if (err)
7163 printf("Function vec_all_le [type unsigned char] ===> Error\n");
7164 else
7165 printf("Function vec_all_le [type unsigned char] ===> OK\n");
7167 err = 0;
7168 Caux1.v = Ccons2;
7169 Caux2.v = Ccons2;
7170 I1 = vec_all_le( Caux1.v, Caux2.v );
7171 Iaux = 1;
7172 for ( i=0; i< 16; i++ )
7174 Iaux = Iaux && (Caux1.e[i]<=Caux2.e[i]);
7176 if (I1 != Iaux) err++;
7178 Caux1.v = Ccons2;
7179 Caux2.v = Ccons3;
7180 I1 = vec_all_le( Caux1.v, Caux2.v );
7181 Iaux = 1;
7182 for ( i=0; i< 16; i++ )
7184 Iaux = Iaux && (Caux1.e[i]<=Caux2.e[i]);
7186 if (I1 != Iaux) err++;
7188 if (err)
7189 printf("Function vec_all_le [type char] ===> Error\n");
7190 else
7191 printf("Function vec_all_le [type char] ===> OK\n");
7193 err = 0;
7194 USaux1.v = UScons2;
7195 USaux2.v = UScons3;
7196 I1 = vec_all_le( USaux1.v, USaux2.v );
7197 Iaux = 1;
7198 for ( i=0; i< 8; i++ )
7200 Iaux = Iaux && (USaux1.e[i]<=USaux2.e[i]);
7202 if (I1 != Iaux) err++;
7204 USaux1.v = UScons1;
7205 USaux2.v = UScons2;
7206 I1 = vec_all_le( USaux1.v, USaux2.v );
7207 Iaux = 1;
7208 for ( i=0; i< 8; i++ )
7210 Iaux = Iaux && (USaux1.e[i]<=USaux2.e[i]);
7212 if (I1 != Iaux) err++;
7214 if (err)
7215 printf("Function vec_all_le [type unsigned short] ===> Error\n");
7216 else
7217 printf("Function vec_all_le [type unsigned short] ===> OK\n");
7219 err = 0;
7220 Saux1.v = Scons1;
7221 Saux2.v = Scons1;
7222 I1 = vec_all_le( Saux1.v, Saux2.v );
7223 Iaux = 1;
7224 for ( i=0; i< 8; i++ )
7226 Iaux = Iaux && (Saux1.e[i]<=Saux2.e[i]);
7228 if (I1 != Iaux) err++;
7230 Saux1.v = Scons2;
7231 Saux2.v = Scons3;
7232 I1 = vec_all_le( Saux1.v, Saux2.v );
7233 Iaux = 1;
7234 for ( i=0; i< 8; i++ )
7236 Iaux = Iaux && (Saux1.e[i]<=Saux2.e[i]);
7238 if (I1 != Iaux) err++;
7240 if (err)
7241 printf("Function vec_all_le [type short] ===> Error\n");
7242 else
7243 printf("Function vec_all_le [type short] ===> OK\n");
7245 err = 0;
7246 UIaux1.v = UIcons2;
7247 UIaux2.v = UIcons3;
7248 I1 = vec_all_le( UIaux1.v, UIaux2.v );
7249 Iaux = 1;
7250 for ( i=0; i< 4; i++ )
7252 Iaux = Iaux && (UIaux1.e[i]<=UIaux2.e[i]);
7254 if (I1 != Iaux) err++;
7256 UIaux1.v = UIcons1;
7257 UIaux2.v = UIcons2;
7258 I1 = vec_all_le( UIaux1.v, UIaux2.v );
7259 Iaux = 1;
7260 for ( i=0; i< 4; i++ )
7262 Iaux = Iaux && (UIaux1.e[i]<=UIaux2.e[i]);
7264 if (I1 != Iaux) err++;
7266 if (err)
7267 printf("Function vec_all_le [type unsigned int] ===> Error\n");
7268 else
7269 printf("Function vec_all_le [type unsigned int] ===> OK\n");
7271 err = 0;
7272 Iaux1.v = Icons2;
7273 Iaux2.v = Icons2;
7274 I1 = vec_all_le( Iaux1.v, Iaux2.v );
7275 Iaux = 1;
7276 for ( i=0; i< 4; i++ )
7278 Iaux = Iaux && (Iaux1.e[i]<=Iaux2.e[i]);
7280 if (I1 != Iaux) err++;
7282 Iaux1.v = Icons1;
7283 Iaux2.v = Icons2;
7284 I1 = vec_all_le( Iaux1.v, Iaux2.v );
7285 Iaux = 1;
7286 for ( i=0; i< 4; i++ )
7288 Iaux = Iaux && (Iaux1.e[i]<=Iaux2.e[i]);
7290 if (I1 != Iaux) err++;
7292 if (err)
7293 printf("Function vec_all_le [type int] ===> Error\n");
7294 else
7295 printf("Function vec_all_le [type int] ===> OK\n");
7297 #if defined TEST_FLOATS
7298 err = 0;
7299 Faux1.v = Fcons1;
7300 Faux2.v = Fcons2;
7301 I1 = vec_all_le( Faux1.v, Faux2.v );
7302 Iaux = 1;
7303 for ( i=0; i< 4; i++ )
7305 Iaux = Iaux && (Faux1.e[i]<=Faux2.e[i]);
7307 if (I1 != Iaux) err++;
7309 Faux1.v = Fcons2;
7310 Faux2.v = Fcons3;
7311 I1 = vec_all_le( Faux1.v, Faux2.v );
7312 Iaux = 1;
7313 for ( i=0; i< 4; i++ )
7315 Iaux = Iaux && (Faux1.e[i]<=Faux2.e[i]);
7317 if (I1 != Iaux) err++;
7319 if (err)
7320 printf("Function vec_all_le [type float] ===> Error\n");
7321 else
7322 printf("Function vec_all_le [type float] ===> OK\n");
7323 #endif
7325 /* Function vec_all_lt */
7326 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7327 err = 0;
7328 UCaux1.v = UCcons2;
7329 # if defined (GCC_COMPILER)
7330 UCaux2.v = (vector unsigned char){248, 249, 250, 251, 252, 253, 254, 255, 2, 3, 4, 5, 6, 7, 8, 9};
7331 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7332 UCaux2.v = (vector unsigned char)(248, 249, 250, 251, 252, 253, 254, 255, 2, 3, 4, 5, 6, 7, 8, 9);
7333 # endif
7334 I1 = vec_all_lt( UCaux1.v, UCaux2.v );
7335 Iaux = 1;
7336 for ( i=0; i< 16; i++ )
7338 Iaux = Iaux && (UCaux1.e[i]<UCaux2.e[i]);
7340 if (I1 != Iaux) err++;
7342 UCaux1.v = UCcons3;
7343 UCaux2.v = UCcons2;
7344 I1 = vec_all_lt( UCaux1.v, UCaux2.v );
7345 Iaux = 1;
7346 for ( i=0; i< 16; i++ )
7348 Iaux = Iaux && (UCaux1.e[i]<UCaux2.e[i]);
7350 if (I1 != Iaux) err++;
7352 if (err)
7353 printf("Function vec_all_lt [type unsigned char] ===> Error\n");
7354 else
7355 printf("Function vec_all_lt [type unsigned char] ===> OK\n");
7357 err = 0;
7358 Caux1.v = Ccons2;
7359 # if defined (GCC_COMPILER)
7360 Caux2.v = (vector signed char){9, 8, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10};
7361 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7362 Caux2.v = (vector signed char)(9, 8, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10);
7363 # endif
7364 I1 = vec_all_lt( Caux1.v, Caux2.v );
7365 Iaux = 1;
7366 for ( i=0; i< 16; i++ )
7368 Iaux = Iaux && (Caux1.e[i]<Caux2.e[i]);
7370 if (I1 != Iaux) err++;
7372 Caux1.v = Ccons3;
7373 Caux2.v = Ccons2;
7374 I1 = vec_all_lt( Caux1.v, Caux2.v );
7375 Iaux = 1;
7376 for ( i=0; i< 16; i++ )
7378 Iaux = Iaux && (Caux1.e[i]<Caux2.e[i]);
7380 if (I1 != Iaux) err++;
7382 if (err)
7383 printf("Function vec_all_lt [type char] ===> Error\n");
7384 else
7385 printf("Function vec_all_lt [type char] ===> OK\n");
7387 err = 0;
7388 USaux1.v = UScons2;
7389 # if defined (GCC_COMPILER)
7390 USaux2.v = (vector unsigned short){65532, 65533, 65534, 65535, 2, 3, 4, 5};
7391 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7392 USaux2.v = (vector unsigned short)(65532, 65533, 65534, 65535, 2, 3, 4, 5);
7393 # endif
7394 I1 = vec_all_lt( USaux1.v, USaux2.v );
7395 Iaux = 1;
7396 for ( i=0; i< 8; i++ )
7398 Iaux = Iaux && (USaux1.e[i]<USaux2.e[i]);
7400 if (I1 != Iaux) err++;
7402 USaux1.v = UScons2;
7403 USaux2.v = UScons1;
7404 I1 = vec_all_lt( USaux1.v, USaux2.v );
7405 Iaux = 1;
7406 for ( i=0; i< 8; i++ )
7408 Iaux = Iaux && (USaux1.e[i]<USaux2.e[i]);
7410 if (I1 != Iaux) err++;
7412 if (err)
7413 printf("Function vec_all_lt [type unsigned short] ===> Error\n");
7414 else
7415 printf("Function vec_all_lt [type unsigned short] ===> OK\n");
7417 err = 0;
7418 Saux1.v = Scons1;
7419 # if defined (GCC_COMPILER)
7420 Saux2.v = (vector signed short){4, 3, 2, 1, 2, 3, 4, 5};
7421 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7422 Saux2.v = (vector signed short)(4, 3, 2, 1, 2, 3, 4, 5);
7423 # endif
7424 I1 = vec_all_lt( Saux1.v, Saux2.v );
7425 Iaux = 1;
7426 for ( i=0; i< 8; i++ )
7428 Iaux = Iaux && (Saux1.e[i]<Saux2.e[i]);
7430 if (I1 != Iaux) err++;
7432 Saux1.v = Scons3;
7433 Saux2.v = Scons2;
7434 I1 = vec_all_lt( Saux1.v, Saux2.v );
7435 Iaux = 1;
7436 for ( i=0; i< 8; i++ )
7438 Iaux = Iaux && (Saux1.e[i]<Saux2.e[i]);
7440 if (I1 != Iaux) err++;
7442 if (err)
7443 printf("Function vec_all_lt [type short] ===> Error\n");
7444 else
7445 printf("Function vec_all_lt [type short] ===> OK\n");
7447 err = 0;
7448 UIaux1.v = UIcons2;
7449 # if defined (GCC_COMPILER)
7450 UIaux2.v = (vector unsigned int){3, 2, 3, 2};
7451 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7452 UIaux2.v = (vector unsigned int)(3, 2, 3, 2);
7453 # endif
7454 I1 = vec_all_lt( UIaux1.v, UIaux2.v );
7455 Iaux = 1;
7456 for ( i=0; i< 4; i++ )
7458 Iaux = Iaux && (UIaux1.e[i]<UIaux2.e[i]);
7460 if (I1 != Iaux) err++;
7462 UIaux1.v = UIcons2;
7463 UIaux2.v = UIcons1;
7464 I1 = vec_all_lt( UIaux1.v, UIaux2.v );
7465 Iaux = 1;
7466 for ( i=0; i< 4; i++ )
7468 Iaux = Iaux && (UIaux1.e[i]<UIaux2.e[i]);
7470 if (I1 != Iaux) err++;
7472 if (err)
7473 printf("Function vec_all_lt [type unsigned int] ===> Error\n");
7474 else
7475 printf("Function vec_all_lt [type unsigned int] ===> OK\n");
7477 err = 0;
7478 Iaux1.v = Icons2;
7479 # if defined (GCC_COMPILER)
7480 Iaux2.v = (vector signed int){4, 10, 10, 4};
7481 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7482 Iaux2.v = (vector signed int)(4, 10, 10, 4);
7483 # endif
7484 I1 = vec_all_lt( Iaux1.v, Iaux2.v );
7485 Iaux = 1;
7486 for ( i=0; i< 4; i++ )
7488 Iaux = Iaux && (Iaux1.e[i]<Iaux2.e[i]);
7490 if (I1 != Iaux) err++;
7492 Iaux1.v = Icons1;
7493 Iaux2.v = Icons2;
7494 I1 = vec_all_lt( Iaux1.v, Iaux2.v );
7495 Iaux = 1;
7496 for ( i=0; i< 4; i++ )
7498 Iaux = Iaux && (Iaux1.e[i]<Iaux2.e[i]);
7500 if (I1 != Iaux) err++;
7502 if (err)
7503 printf("Function vec_all_lt [type int] ===> Error\n");
7504 else
7505 printf("Function vec_all_lt [type int] ===> OK\n");
7507 #if defined TEST_FLOATS
7508 err = 0;
7509 Faux1.v = Fcons1;
7510 # if defined (GCC_COMPILER)
7511 Faux2.v = (vector float){100000000000.0, 12.0, 12.0, 1234567890.0};
7512 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7513 Faux2.v = (vector float)(100000000000.0, 12.0, 12.0, 1234567890.0);
7514 # endif
7515 I1 = vec_all_lt( Faux1.v, Faux2.v );
7516 Iaux = 1;
7517 for ( i=0; i< 4; i++ )
7519 Iaux = Iaux && (Faux1.e[i]<Faux2.e[i]);
7521 if (I1 != Iaux) err++;
7523 Faux1.v = Fcons3;
7524 Faux2.v = Fcons2;
7525 I1 = vec_all_lt( Faux1.v, Faux2.v );
7526 Iaux = 1;
7527 for ( i=0; i< 4; i++ )
7529 Iaux = Iaux && (Faux1.e[i]<Faux2.e[i]);
7531 if (I1 != Iaux) err++;
7533 if (err)
7534 printf("Function vec_all_lt [type float] ===> Error\n");
7535 else
7536 printf("Function vec_all_lt [type float] ===> OK\n");
7537 #endif
7539 #if defined TEST_FLOATS
7540 /* Function vec_all_nan */
7541 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7542 err = 0;
7543 # if defined (GCC_COMPILER)
7544 Faux1.v = (vector float){NAN, NAN, NAN, NAN};
7545 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7546 Faux1.v = (vector float)(NAN, NAN, NAN, NAN);
7547 # endif
7548 I1 = vec_all_nan( Faux1.v );
7549 Iaux = 1;
7550 for ( i=0; i< 4; i++ )
7552 Iaux = Iaux && (isnan(Faux1.e[i]));
7554 if (I1 != Iaux) err++;
7556 Faux1.v = Fcons1;
7557 I1 = vec_all_nan( Faux1.v );
7558 Iaux = 1;
7559 for ( i=0; i< 4; i++ )
7561 Iaux = Iaux && (isnan(Faux1.e[i]));
7563 if (I1 != Iaux) err++;
7565 if (err)
7566 printf("Function vec_all_nan [type float] ===> Error\n");
7567 else
7568 printf("Function vec_all_nan [type float] ===> OK\n");
7569 #endif
7571 /* Function vec_all_ne */
7572 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7573 err = 0;
7574 # if defined (GCC_COMPILER)
7575 Caux1.v = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
7576 Caux2.v = (vector signed char){-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, -8};
7577 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7578 Caux1.v = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
7579 Caux2.v = (vector signed char)(-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, -8);
7580 # endif
7581 b = vec_all_ne (Caux1.v, Caux2.v);
7582 bAux = 1;
7583 for (i=0; i<16; i++)
7584 bAux = bAux && (Caux1.e[i]!=Caux2.e[i]);
7585 if (bAux != b) err = 1;
7587 # if defined (GCC_COMPILER)
7588 Caux1.v = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
7589 Caux2.v = (vector signed char){-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 4, 6, 7, -8};
7590 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7591 Caux1.v = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
7592 Caux2.v = (vector signed char)(-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 4, 6, 7, -8);
7593 # endif
7594 b = vec_all_ne (Caux1.v, Caux2.v);
7595 bAux= 1;
7596 for (i=0; i<16; i++)
7597 bAux= bAux && (Caux1.e[i]!=Caux2.e[i]);
7598 if (bAux!=b) err= 1;
7600 # if defined (GCC_COMPILER)
7601 Caux1.v = (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
7602 Caux2.v = (vector signed char){-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 4, 6, 7, -8};
7603 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7604 Caux1.v = (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
7605 Caux2.v = (vector signed char)(-7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 4, 6, 7, -8);
7606 # endif
7607 b = vec_all_ne (Caux1.v, Caux2.v);
7608 bAux = 1;
7609 for (i=0; i<16; i++)
7610 bAux = bAux && (Caux1.e[i] != Caux2.e[i]);
7611 if (bAux != b) err = 1;
7613 if (err)
7614 printf("Function vec_all_ne [type char] ===> Error\n");
7615 else
7616 printf("Function vec_all_ne [type char] ===> OK\n");
7619 err = 0;
7620 # if defined (GCC_COMPILER)
7621 UCaux1.v = (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
7622 UCaux2.v = (vector unsigned char){201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17,200};
7623 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7624 UCaux1.v = (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
7625 UCaux2.v = (vector unsigned char)(201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17,200);
7626 # endif
7628 b = vec_all_ne (UCaux1.v, UCaux2.v);
7629 bAux= 1;
7630 for (i=0; i<16; i++)
7631 bAux= bAux && (UCaux1.e[i]!=UCaux2.e[i]);
7632 if (bAux!=b) err= 1;
7634 # if defined (GCC_COMPILER)
7635 UCaux1.v = (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
7636 UCaux2.v = (vector unsigned char){201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17,200};
7637 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7638 UCaux1.v = (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
7639 UCaux2.v = (vector unsigned char)(201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17,200);
7640 # endif
7641 b = vec_all_ne (UCaux1.v, UCaux2.v);
7642 bAux = 1;
7643 for (i=0; i<16; i++)
7644 bAux = bAux && (UCaux1.e[i] != UCaux2.e[i]);
7645 if (bAux != b) err = 1;
7647 # if defined (GCC_COMPILER)
7648 UCaux1.v = (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
7649 UCaux2.v = (vector unsigned char){201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17,200};
7650 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7651 UCaux1.v = (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
7652 UCaux2.v = (vector unsigned char)(201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17,200);
7653 # endif
7654 b = vec_all_ne (UCaux1.v, UCaux2.v);
7655 bAux = 1;
7656 for (i=0; i<16; i++)
7657 bAux = bAux && (UCaux1.e[i] != UCaux2.e[i]);
7658 if (bAux != b) err = 1;
7660 if (err)
7661 printf("Function vec_all_ne [type unsigned char] ===> Error\n");
7662 else
7663 printf("Function vec_all_ne [type unsigned char] ===> OK\n");
7666 err = 0;
7667 # if defined (GCC_COMPILER)
7668 Saux1.v = (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
7669 Saux2.v = (vector signed short){-3700, -3600, -3500, 0, 3300, 3200, 3100,-3800};
7670 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7671 Saux1.v = (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
7672 Saux2.v = (vector signed short)(-3700, -3600, -3500, 0, 3300, 3200, 3100,-3800);
7673 # endif
7674 b = vec_all_ne (Saux1.v, Saux2.v);
7675 bAux = 1;
7676 for (i=0; i<8; i++)
7677 bAux = bAux && (Saux1.e[i] != Saux2.e[i]);
7678 if (bAux != b) err = 1;
7680 # if defined (GCC_COMPILER)
7681 Saux1.v = (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
7682 Saux2.v = (vector signed short){-3700, -3600, -3500, 0, 3300, 3200, 3100,-3800};
7683 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7684 Saux1.v = (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
7685 Saux2.v = (vector signed short)(-3700, -3600, -3500, 0, 3300, 3200, 3100,-3800);
7686 # endif
7687 b = vec_all_ne (Saux1.v, Saux2.v);
7688 bAux = 1;
7689 for (i=0; i<8; i++)
7690 bAux = bAux && (Saux1.e[i] != Saux2.e[i]);
7691 if (bAux != b) err = 1;
7693 # if defined (GCC_COMPILER)
7694 Saux1.v = (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
7695 Saux2.v = (vector signed short){-3700, -3600, -3500, 0, 3300, 3200, 3100,-3800};
7696 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7697 Saux1.v = (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
7698 Saux2.v = (vector signed short)(-3700, -3600, -3500, 0, 3300, 3200, 3100,-3800);
7699 # endif
7700 b = vec_all_ne (Saux1.v, Saux2.v);
7701 bAux = 1;
7702 for (i=0; i<8; i++)
7703 bAux = bAux && (Saux1.e[i] != Saux2.e[i]);
7704 if (bAux != b) err = 1;
7706 if (err)
7707 printf("Function vec_all_ne [type short] ===> Error\n");
7708 else
7709 printf("Function vec_all_ne [type short] ===> OK\n");
7712 err = 0;
7713 # if defined (GCC_COMPILER)
7714 USaux1.v = (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
7715 USaux2.v = (vector unsigned short){47000, 46000, 45000, 0, 3300, 3200, 3100,48000};
7716 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7717 USaux1.v = (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
7718 USaux2.v = (vector unsigned short)(47000, 46000, 45000, 0, 3300, 3200, 3100,48000);
7719 # endif
7720 b = vec_all_ne (USaux1.v, USaux2.v);
7721 bAux = 1;
7722 for (i=0; i<8; i++)
7723 bAux = bAux && (USaux1.e[i] != USaux2.e[i]);
7724 if (bAux != b) err = 1;
7726 # if defined (GCC_COMPILER)
7727 USaux1.v = (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
7728 USaux2.v = (vector unsigned short){47000, 46000, 45000, 0, 3300, 3200, 3100,48000};
7729 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7730 USaux1.v = (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
7731 USaux2.v = (vector unsigned short)(47000, 46000, 45000, 0, 3300, 3200, 3100,48000);
7732 # endif
7733 b = vec_all_ne (USaux1.v, USaux2.v);
7734 bAux = 1;
7735 for (i=0; i<8; i++)
7736 bAux = bAux && (USaux1.e[i] != USaux2.e[i]);
7737 if (bAux != b) err = 1;
7739 # if defined (GCC_COMPILER)
7740 USaux1.v = (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
7741 USaux2.v = (vector unsigned short){47000, 46000, 45000, 0, 3300, 3200, 3100,48000};
7742 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7743 USaux1.v = (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
7744 USaux2.v = (vector unsigned short)(47000, 46000, 45000, 0, 3300, 3200, 3100,48000);
7745 # endif
7746 b = vec_all_ne (USaux1.v, USaux2.v);
7747 bAux = 1;
7748 for (i=0; i<8; i++)
7749 bAux = bAux && (USaux1.e[i] != USaux2.e[i]);
7750 if (bAux != b) err = 1;
7752 if (err)
7753 printf("Function vec_all_ne [type unsigned short] ===> Error\n");
7754 else
7755 printf("Function vec_all_ne [type unsigned short] ===> OK\n");
7758 err = 0;
7759 # if defined (GCC_COMPILER)
7760 Iaux1.v = (vector signed int){-1003800, -1003700, 0, 1003300};
7761 Iaux2.v = (vector signed int){-1003700, 0, 1003300,-1003800};
7762 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7763 Iaux1.v = (vector signed int)(-1003800, -1003700, 0, 1003300);
7764 Iaux2.v = (vector signed int)(-1003700, 0, 1003300,-1003800);
7765 # endif
7766 b = vec_all_ne (Iaux1.v, Iaux2.v);
7767 bAux = 1;
7768 for (i=0; i<4; i++)
7769 bAux = bAux && (Iaux1.e[i] != Iaux2.e[i]);
7770 if (bAux != b) err = 1;
7772 # if defined (GCC_COMPILER)
7773 Iaux1.v = (vector signed int){-1003800, -1003700, 0, 1003300};
7774 Iaux2.v = (vector signed int){-1003700, 0, 1003300,-1003800};
7775 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7776 Iaux1.v = (vector signed int)(-1003800, -1003700, 0, 1003300);
7777 Iaux2.v = (vector signed int)(-1003700, 0, 1003300,-1003800);
7778 # endif
7779 b = vec_all_ne (Iaux1.v, Iaux2.v);
7780 bAux = 1;
7781 for (i=0; i<4; i++)
7782 bAux = bAux && (Iaux1.e[i] != Iaux2.e[i]);
7783 if (bAux != b) err = 1;
7785 # if defined (GCC_COMPILER)
7786 Iaux1.v= (vector signed int){-1003800, -1003700, 0, 1003300};
7787 Iaux2.v= (vector signed int){-1003700, 0, 1003300,-1003800};
7788 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7789 Iaux1.v= (vector signed int)(-1003800, -1003700, 0, 1003300);
7790 Iaux2.v= (vector signed int)(-1003700, 0, 1003300,-1003800);
7791 # endif
7792 b = vec_all_ne (Iaux1.v, Iaux2.v);
7793 bAux = 1;
7794 for (i=0; i<4; i++)
7795 bAux = bAux && (Iaux1.e[i] != Iaux2.e[i]);
7796 if (bAux != b) err = 1;
7798 if (err)
7799 printf("Function vec_all_ne [type int] ===> Error\n");
7800 else
7801 printf("Function vec_all_ne [type int] ===> OK\n");
7804 err = 0;
7805 # if defined (GCC_COMPILER)
7806 UIaux1.v = (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
7807 UIaux2.v = (vector unsigned int){ 12345678, 0, 1,0xFFFFF000};
7808 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7809 UIaux1.v = (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
7810 UIaux2.v = (vector unsigned int)( 12345678, 0, 1,0xFFFFF000);
7811 # endif
7812 b = vec_all_ne (UIaux1.v, UIaux2.v);
7813 bAux = 1;
7814 for (i=0; i<4; i++)
7815 bAux = bAux && (UIaux1.e[i] != UIaux2.e[i]);
7816 if (bAux != b) err = 1;
7818 # if defined (GCC_COMPILER)
7819 UIaux1.v = (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
7820 UIaux2.v = (vector unsigned int){ 12345678, 0, 1,0xFFFFF000};
7821 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7822 UIaux1.v = (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
7823 UIaux2.v = (vector unsigned int)( 12345678, 0, 1,0xFFFFF000);
7824 # endif
7825 b = vec_all_ne (UIaux1.v, UIaux2.v);
7826 bAux = 1;
7827 for (i=0; i<4; i++)
7828 bAux = bAux && (UIaux1.e[i] != UIaux2.e[i]);
7829 if (bAux != b) err = 1;
7831 # if defined (GCC_COMPILER)
7832 UIaux1.v = (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
7833 UIaux2.v = (vector unsigned int){ 12345678, 0, 1,0xFFFFF000};
7834 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7835 UIaux1.v = (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
7836 UIaux2.v = (vector unsigned int)( 12345678, 0, 1,0xFFFFF000);
7837 # endif
7838 b = vec_all_ne (UIaux1.v, UIaux2.v);
7839 bAux = 1;
7840 for (i=0; i<4; i++)
7841 bAux = bAux && (UIaux1.e[i] != UIaux2.e[i]);
7842 if (bAux != b) err = 1;
7844 if (err)
7845 printf("Function vec_all_ne [type unsigned int] ===> Error\n");
7846 else
7847 printf("Function vec_all_ne [type unsigned int] ===> OK\n");
7849 #if defined TEST_FLOATS
7850 err = 0;
7851 # if defined (GCC_COMPILER)
7852 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7853 Faux2.v = (vector float) { 1.0, 0.5, -3.999, -1.5};
7854 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7855 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7856 Faux2.v = (vector float) ( 1.0, 0.5, -3.999, -1.5);
7857 # endif
7858 b = vec_all_ne (Faux1.v, Faux2.v);
7859 bAux = 1;
7860 for (i=0; i<4; i++)
7861 bAux = bAux && (Faux1.e[i] != Faux2.e[i]);
7862 if (bAux != b) err = 1;
7864 # if defined (GCC_COMPILER)
7865 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7866 Faux2.v = (vector float) { 1.0, 0.5, -3.999, -1.5};
7867 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7868 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7869 Faux2.v = (vector float) ( 1.0, 0.5, -3.999, -1.5);
7870 # endif
7871 b = vec_all_ne (Faux1.v, Faux2.v);
7872 bAux = 1;
7873 for (i=0; i<4; i++)
7874 bAux = bAux && (Faux1.e[i] != Faux2.e[i]);
7875 if (bAux != b) err = 1;
7877 # if defined (GCC_COMPILER)
7878 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7879 Faux2.v = (vector float) { 1.0, 0.5, -3.999, -1.5};
7880 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7881 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7882 Faux2.v = (vector float) ( 1.0, 0.5, -3.999, -1.5);
7883 # endif
7884 b = vec_all_ne (Faux1.v, Faux2.v);
7885 bAux = 1;
7886 for (i=0; i<4; i++)
7887 bAux = bAux && (Faux1.e[i] != Faux2.e[i]);
7888 if (bAux != b) err = 1;
7890 if (err)
7891 printf("Function vec_all_ne [type float] ===> Error\n");
7892 else
7893 printf("Function vec_all_ne [type float] ===> OK\n");
7894 #endif
7896 #if defined TEST_FLOATS
7897 /* Function vec_all_nge */
7898 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7899 err = 0;
7900 # if defined (GCC_COMPILER)
7901 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7902 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7903 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7904 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7905 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
7906 # endif
7907 b = vec_all_nge (Faux1.v, Faux2.v);
7908 bAux = 1;
7909 for (i=0; i<4; i++)
7910 bAux = bAux && (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
7911 (Faux1.e[i] < Faux2.e[i]));
7912 if (bAux != b) err = 1;
7914 # if defined (GCC_COMPILER)
7915 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7916 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7917 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7918 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7919 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
7920 # endif
7921 b = vec_all_nge (Faux1.v, Faux2.v);
7922 bAux = 1;
7923 for (i=0; i<4; i++)
7924 bAux = bAux && (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
7925 (Faux1.e[i] < Faux2.e[i]));
7926 if (bAux != b) err = 1;
7928 # if defined (GCC_COMPILER)
7929 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7930 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7931 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7932 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7933 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
7934 # endif
7935 b = vec_all_nge (Faux1.v, Faux2.v);
7936 bAux = 1;
7937 for (i=0; i<4; i++)
7938 bAux = bAux && (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
7939 (Faux1.e[i] < Faux2.e[i]));
7940 if (bAux != b) err = 1;
7942 # if defined (GCC_COMPILER)
7943 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7944 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7945 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7946 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7947 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
7948 # endif
7949 b = vec_all_nge (Faux1.v, Faux2.v);
7950 bAux = 1;
7951 for (i=0; i<4; i++)
7952 bAux = bAux && (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
7953 (Faux1.e[i] < Faux2.e[i]));
7954 if (bAux != b) err = 1;
7956 if (err)
7957 printf("Function vec_all_nge [type float] ===> Error\n");
7958 else
7959 printf("Function vec_all_nge [type float] ===> OK\n");
7960 #endif
7962 #if defined TEST_FLOATS
7963 /* Function vec_all_ngt */
7964 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
7965 err = 0;
7966 # if defined (GCC_COMPILER)
7967 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7968 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7969 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7970 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7971 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
7972 # endif
7973 b = vec_all_ngt (Faux1.v, Faux2.v);
7974 bAux = 1;
7975 for (i=0; i<4; i++)
7976 bAux = bAux &&
7977 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] > Faux2.e[i]));
7978 if (bAux != b) err = 1;
7980 # if defined (GCC_COMPILER)
7981 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7982 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7983 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7984 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7985 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
7986 # endif
7987 b = vec_all_ngt (Faux1.v, Faux2.v);
7988 bAux = 1;
7989 for (i=0; i<4; i++)
7990 bAux = bAux &&
7991 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] > Faux2.e[i]));
7992 if (bAux != b) err = 1;
7994 # if defined (GCC_COMPILER)
7995 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
7996 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
7997 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
7998 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
7999 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8000 # endif
8001 b = vec_all_ngt (Faux1.v, Faux2.v);
8002 bAux = 1;
8003 for (i=0; i<4; i++)
8004 bAux = bAux &&
8005 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] > Faux2.e[i]));
8006 if (bAux!=b) err= 1;
8008 # if defined (GCC_COMPILER)
8009 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8010 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8011 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8012 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8013 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8014 # endif
8015 b = vec_all_ngt (Faux1.v, Faux2.v);
8016 bAux = 1;
8017 for (i=0; i<4; i++)
8018 bAux = bAux &&
8019 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] > Faux2.e[i]));
8020 if (bAux != b) err = 1;
8022 if (err)
8023 printf("Function vec_all_ngt [type float] ===> Error\n");
8024 else
8025 printf("Function vec_all_ngt [type float] ===> OK\n");
8026 #endif
8028 #if defined TEST_FLOATS
8029 /* Function vec_all_nle */
8030 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
8031 err = 0;
8032 # if defined (GCC_COMPILER)
8033 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8034 Faux2.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8035 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8036 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8037 Faux2.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8038 # endif
8039 b = vec_all_nle (Faux1.v, Faux2.v);
8040 bAux = 1;
8041 for (i=0; i<4; i++)
8042 bAux = bAux &&
8043 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] <= Faux2.e[i]));
8044 if (bAux != b) err = 1;
8046 # if defined (GCC_COMPILER)
8047 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8048 Faux2.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8049 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8050 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8051 Faux2.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8052 # endif
8053 b = vec_all_nle (Faux1.v, Faux2.v);
8054 bAux = 1;
8055 for (i=0; i<4; i++)
8056 bAux = bAux &&
8057 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] <= Faux2.e[i]));
8058 if (bAux != b) err = 1;
8060 # if defined (GCC_COMPILER)
8061 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8062 Faux2.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8063 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8064 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8065 Faux2.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8066 # endif
8067 b = vec_all_nle (Faux1.v, Faux2.v);
8068 bAux = 1;
8069 for (i=0; i<4; i++)
8070 bAux = bAux &&
8071 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] <=Faux2.e[i]));
8072 if (bAux != b) err = 1;
8074 # if defined (GCC_COMPILER)
8075 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8076 Faux2.v = (vector float) {-1.5, 1.0, NAN, -3.999};
8077 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8078 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8079 Faux2.v = (vector float) (-1.5, 1.0, NAN, -3.999);
8080 # endif
8081 b = vec_all_nle (Faux1.v, Faux2.v);
8082 bAux = 1;
8083 for (i=0; i<4; i++)
8084 bAux = bAux &&
8085 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] <= Faux2.e[i]));
8086 if (bAux != b) err = 1;
8088 if (err)
8089 printf("Function vec_all_nle [type float] ===> Error\n");
8090 else
8091 printf("Function vec_all_nle [type float] ===> OK\n");
8092 #endif
8095 #if defined TEST_FLOATS
8096 /* Function vec_all_nlt */
8097 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
8098 err = 0;
8099 # if defined (GCC_COMPILER)
8100 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8101 Faux2.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8102 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8103 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8104 Faux2.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8105 # endif
8106 b = vec_all_nlt (Faux1.v, Faux2.v);
8107 bAux = 1;
8108 for (i=0; i<4; i++)
8109 bAux = bAux &&
8110 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] < Faux2.e[i]));
8111 if (bAux != b) err = 1;
8113 # if defined (GCC_COMPILER)
8114 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8115 Faux2.v = (vector float) {-1.5, 5.0, 0.5, -3.999};
8116 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8117 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8118 Faux2.v = (vector float) (-1.5, 5.0, 0.5, -3.999);
8119 # endif
8120 b = vec_all_nlt (Faux1.v, Faux2.v);
8121 bAux = 1;
8122 for (i=0; i<4; i++)
8123 bAux = bAux &&
8124 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] < Faux2.e[i]));
8125 if (bAux != b) err = 1;
8127 # if defined (GCC_COMPILER)
8128 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8129 Faux2.v = (vector float) {-1.5, 1.0, 0.55, -3.999};
8130 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8131 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8132 Faux2.v = (vector float) (-1.5, 1.0, 0.55, -3.999);
8133 # endif
8134 b = vec_all_nlt (Faux1.v, Faux2.v);
8135 bAux = 1;
8136 for (i=0; i<4; i++)
8137 bAux = bAux &&
8138 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] < Faux2.e[i]));
8139 if (bAux != b) err = 1;
8141 # if defined (GCC_COMPILER)
8142 Faux1.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8143 Faux2.v = (vector float) {-1.5, 1.0, NAN, -3.999};
8144 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8145 Faux1.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8146 Faux2.v = (vector float) (-1.5, 1.0, NAN, -3.999);
8147 # endif
8148 b = vec_all_nlt (Faux1.v, Faux2.v);
8149 bAux = 1;
8150 for (i=0; i<4; i++)
8151 bAux = bAux &&
8152 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i] < Faux2.e[i]));
8153 if (bAux != b) err = 1;
8155 if (err)
8156 printf("Function vec_all_nlt [type float] ===> Error\n");
8157 else
8158 printf("Function vec_all_nlt [type float] ===> OK\n");
8159 #endif
8162 #if defined TEST_FLOATS
8163 /* Function vec_all_numeric */
8164 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
8165 err = 0;
8166 # if defined (GCC_COMPILER)
8167 Faux1.v = (vector float) {0.0, 3.5, 0.55, -1.5};
8168 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8169 Faux1.v = (vector float) (0.0, 3.5, 0.55, -1.5);
8170 # endif
8171 b = vec_all_numeric (Faux1.v);
8172 bAux = 1;
8173 for (i=0; i<4; i++)
8174 bAux = bAux && !isnan(Faux1.e[i]);
8175 if (bAux != b) err = 1;
8177 # if defined (GCC_COMPILER)
8178 Faux1.v = (vector float) {0.0, 3.5, 0.5, -1.5};
8179 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8180 Faux1.v = (vector float) (0.0, 3.5, 0.5, -1.5);
8181 # endif
8182 b = vec_all_numeric (Faux1.v);
8183 bAux = 1;
8184 for (i=0; i<4; i++)
8185 bAux = bAux && !isnan(Faux1.e[i]);
8186 if (bAux != b) err = 1;
8188 # if defined (GCC_COMPILER)
8189 Faux1.v = (vector float) {0.0, 3.5, NAN, -1.5};
8190 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8191 Faux1.v = (vector float) (0.0, 3.5, NAN, -1.5);
8192 # endif
8193 b = vec_all_numeric (Faux1.v);
8194 bAux = 1;
8195 for (i=0; i<4; i++)
8196 bAux = bAux && !isnan(Faux1.e[i]);
8197 if (bAux != b) err = 1;
8199 # if defined (GCC_COMPILER)
8200 Faux1.v = (vector float) {NAN, NAN, NAN, NAN};
8201 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8202 Faux1.v = (vector float) (NAN, NAN, NAN, NAN);
8203 # endif
8204 b = vec_all_numeric (Faux1.v);
8205 bAux = 1;
8206 for (i=0; i<4; i++)
8207 bAux = bAux && !isnan(Faux1.e[i]);
8208 if (bAux != b) err = 1;
8210 if (err)
8211 printf("Function vec_all_numeric [type float] ===> Error\n");
8212 else
8213 printf("Function vec_all_numeric [type float] ===> OK\n");
8214 #endif
8216 /* Function vec_any_eq */
8217 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
8218 err = 0;
8219 Caux1.v= Ccons1;
8220 Caux2.v= Ccons3;
8221 b= vec_any_eq (Caux1.v, Caux2.v);
8222 bAux= 0;
8223 for (i=0; i<16; i++)
8224 bAux= bAux || (Caux1.e[i]==Caux2.e[i]);
8225 if (bAux!=b) err= 1;
8227 Caux1.v= Ccons1;
8228 Caux2.v= Ccons2;
8229 b= vec_any_eq (Caux1.v, Caux2.v);
8230 bAux= 0;
8231 for (i=0; i<16; i++)
8232 bAux= bAux || (Caux1.e[i]==Caux2.e[i]);
8233 if (bAux!=b) err= 1;
8235 if (err)
8236 printf("Function vec_any_eq [type char] ===> Error\n");
8237 else
8238 printf("Function vec_any_eq [type char] ===> OK\n");
8241 err = 0;
8242 UCaux1.v= UCcons1;
8243 UCaux2.v= UCcons3;
8244 b= vec_any_eq (UCaux1.v, UCaux2.v);
8245 bAux= 0;
8246 for (i=0; i<16; i++)
8247 bAux= bAux || (UCaux1.e[i]==UCaux2.e[i]);
8248 if (bAux!=b) err= 1;
8250 UCaux1.v= UCcons1;
8251 UCaux2.v= UCcons2;
8252 b= vec_any_eq (UCaux1.v, UCaux2.v);
8253 bAux= 0;
8254 for (i=0; i<16; i++)
8255 bAux= bAux || (UCaux1.e[i]==UCaux2.e[i]);
8256 if (bAux!=b) err= 1;
8258 if (err)
8259 printf("Function vec_any_eq [type unsigned char] ===> Error\n");
8260 else
8261 printf("Function vec_any_eq [type unsigned char] ===> OK\n");
8264 err = 0;
8265 Saux1.v= Scons1;
8266 Saux2.v= Scons3;
8267 b= vec_any_eq (Saux1.v, Saux2.v);
8268 bAux= 0;
8269 for (i=0; i<8; i++)
8270 bAux= bAux || (Saux1.e[i]==Saux2.e[i]);
8271 if (bAux!=b) err= 1;
8273 Saux1.v= Scons1;
8274 Saux2.v= Scons2;
8275 b= vec_any_eq (Saux1.v, Saux2.v);
8276 bAux= 0;
8277 for (i=0; i<8; i++)
8278 bAux= bAux || (Saux1.e[i]==Saux2.e[i]);
8279 if (bAux!=b) err= 1;
8281 if (err)
8282 printf("Function vec_any_eq [type short] ===> Error\n");
8283 else
8284 printf("Function vec_any_eq [type short] ===> OK\n");
8287 err = 0;
8288 USaux1.v= UScons1;
8289 USaux2.v= UScons3;
8290 b= vec_any_eq (USaux1.v, USaux2.v);
8291 bAux= 0;
8292 for (i=0; i<8; i++)
8293 bAux= bAux || (USaux1.e[i]==USaux2.e[i]);
8294 if (bAux!=b) err= 1;
8296 USaux1.v= UScons1;
8297 USaux2.v= UScons2;
8298 b= vec_any_eq (USaux1.v, USaux2.v);
8299 bAux= 0;
8300 for (i=0; i<8; i++)
8301 bAux= bAux || (USaux1.e[i]==USaux2.e[i]);
8302 if (bAux!=b) err= 1;
8304 if (err)
8305 printf("Function vec_any_eq [type unsigned short] ===> Error\n");
8306 else
8307 printf("Function vec_any_eq [type unsigned short] ===> OK\n");
8310 err = 0;
8311 Iaux1.v= Icons1;
8312 Iaux2.v= Icons3;
8313 b= vec_any_eq (Iaux1.v, Iaux2.v);
8314 bAux= 0;
8315 for (i=0; i<4; i++)
8316 bAux= bAux || (Iaux1.e[i]==Iaux2.e[i]);
8317 if (bAux!=b) err= 1;
8319 Iaux1.v= Icons1;
8320 Iaux2.v= Icons2;
8321 b= vec_any_eq (Iaux1.v, Iaux2.v);
8322 bAux= 0;
8323 for (i=0; i<4; i++)
8324 bAux= bAux || (Iaux1.e[i]==Iaux2.e[i]);
8325 if (bAux!=b) err= 1;
8327 if (err)
8328 printf("Function vec_any_eq [type int] ===> Error\n");
8329 else
8330 printf("Function vec_any_eq [type int] ===> OK\n");
8333 err = 0;
8334 UIaux1.v= UIcons1;
8335 UIaux2.v= UIcons3;
8336 b= vec_any_eq (UIaux1.v, UIaux2.v);
8337 bAux= 0;
8338 for (i=0; i<4; i++)
8339 bAux= bAux || (UIaux1.e[i]==UIaux2.e[i]);
8340 if (bAux!=b) err= 1;
8342 UIaux1.v= UIcons1;
8343 UIaux2.v= UIcons2;
8344 b= vec_any_eq (UIaux1.v, UIaux2.v);
8345 bAux= 0;
8346 for (i=0; i<4; i++)
8347 bAux= bAux || (UIaux1.e[i]==UIaux2.e[i]);
8348 if (bAux!=b) err= 1;
8350 if (err)
8351 printf("Function vec_any_eq [type unsigned int] ===> Error\n");
8352 else
8353 printf("Function vec_any_eq [type unsigned int] ===> OK\n");
8356 #if defined TEST_FLOATS
8357 err = 0;
8358 # if defined (GCC_COMPILER)
8359 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8360 Faux2.v = (vector float) { 0.0, 3.5, 0.55, -1.5};
8361 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8362 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8363 Faux2.v = (vector float) ( 0.0, 3.5, 0.55, -1.5);
8364 # endif
8365 b = vec_any_eq (Faux1.v, Faux2.v);
8366 bAux = 0;
8367 for (i=0; i<4; i++)
8368 bAux = bAux || (Faux1.e[i] == Faux2.e[i]);
8369 if (bAux != b) err = 1;
8371 # if defined (GCC_COMPILER)
8372 Faux1.v = (vector float) {-1.5, 1.0, 0.5, -3.999};
8373 Faux2.v = (vector float) { 0.0, 3.5, 0.5, -1.5};
8374 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8375 Faux1.v = (vector float) (-1.5, 1.0, 0.5, -3.999);
8376 Faux2.v = (vector float) ( 0.0, 3.5, 0.5, -1.5);
8377 # endif
8378 b= vec_any_eq (Faux1.v, Faux2.v);
8379 bAux= 0;
8380 for (i=0; i<4; i++)
8381 bAux= bAux || (Faux1.e[i]==Faux2.e[i]);
8382 if (bAux!=b) err= 1;
8384 if (err)
8385 printf("Function vec_any_eq [type float] ===> Error\n");
8386 else
8387 printf("Function vec_any_eq [type float] ===> OK\n");
8388 #endif
8390 /* Function vec_any_ge */
8391 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
8392 err = 0;
8393 # if defined (GCC_COMPILER)
8394 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
8395 Caux2.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
8396 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8397 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
8398 Caux2.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
8399 # endif
8400 b= vec_any_ge (Caux1.v, Caux2.v);
8401 bAux= 0;
8402 for (i=0; i<16; i++)
8403 bAux= bAux || (Caux1.e[i]>=Caux2.e[i]);
8404 if (bAux!=b) err= 1;
8406 # if defined (GCC_COMPILER)
8407 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
8408 Caux2.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
8409 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8410 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
8411 Caux2.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
8412 # endif
8413 b= vec_any_ge (Caux1.v, Caux2.v);
8414 bAux= 0;
8415 for (i=0; i<16; i++)
8416 bAux= bAux || (Caux1.e[i]>=Caux2.e[i]);
8417 if (bAux!=b) err= 1;
8419 # if defined (GCC_COMPILER)
8420 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
8421 Caux2.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
8422 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8423 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
8424 Caux2.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
8425 # endif
8426 b= vec_any_ge (Caux1.v, Caux2.v);
8427 bAux= 0;
8428 for (i=0; i<16; i++)
8429 bAux= bAux || (Caux1.e[i]>=Caux2.e[i]);
8430 if (bAux!=b) err= 1;
8432 if (err)
8433 printf("Function vec_any_ge [type char] ===> Error\n");
8434 else
8435 printf("Function vec_any_ge [type char] ===> OK\n");
8438 err = 0;
8439 # if defined (GCC_COMPILER)
8440 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
8441 UCaux2.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
8442 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8443 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
8444 UCaux2.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
8445 # endif
8446 b= vec_any_ge (UCaux1.v, UCaux2.v);
8447 bAux= 0;
8448 for (i=0; i<16; i++)
8449 bAux= bAux || (UCaux1.e[i]>=UCaux2.e[i]);
8450 if (bAux!=b) err= 1;
8452 # if defined (GCC_COMPILER)
8453 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
8454 UCaux2.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
8455 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8456 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
8457 UCaux2.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
8458 # endif
8459 b= vec_any_ge (UCaux1.v, UCaux2.v);
8460 bAux= 0;
8461 for (i=0; i<16; i++)
8462 bAux= bAux || (UCaux1.e[i]>=UCaux2.e[i]);
8463 if (bAux!=b) err= 1;
8465 # if defined (GCC_COMPILER)
8466 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
8467 UCaux2.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
8468 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8469 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
8470 UCaux2.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
8471 # endif
8472 b= vec_any_ge (UCaux1.v, UCaux2.v);
8473 bAux= 0;
8474 for (i=0; i<16; i++)
8475 bAux= bAux || (UCaux1.e[i]>=UCaux2.e[i]);
8476 if (bAux!=b) err= 1;
8478 if (err)
8479 printf("Function vec_any_ge [type unsigned char] ===> Error\n");
8480 else
8481 printf("Function vec_any_ge [type unsigned char] ===> OK\n");
8484 err = 0;
8485 # if defined (GCC_COMPILER)
8486 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
8487 Saux2.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
8488 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8489 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
8490 Saux2.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
8491 # endif
8492 b= vec_any_ge (Saux1.v, Saux2.v);
8493 bAux= 0;
8494 for (i=0; i<8; i++)
8495 bAux= bAux || (Saux1.e[i]>=Saux2.e[i]);
8496 if (bAux!=b) err= 1;
8498 # if defined (GCC_COMPILER)
8499 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
8500 Saux2.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
8501 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8502 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
8503 Saux2.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
8504 # endif
8505 b= vec_any_ge (Saux1.v, Saux2.v);
8506 bAux= 0;
8507 for (i=0; i<8; i++)
8508 bAux= bAux || (Saux1.e[i]>=Saux2.e[i]);
8509 if (bAux!=b) err= 1;
8511 # if defined (GCC_COMPILER)
8512 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
8513 Saux2.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
8514 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8515 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
8516 Saux2.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
8517 # endif
8518 b= vec_any_ge (Saux1.v, Saux2.v);
8519 bAux= 0;
8520 for (i=0; i<8; i++)
8521 bAux= bAux || (Saux1.e[i]>=Saux2.e[i]);
8522 if (bAux!=b) err= 1;
8524 if (err)
8525 printf("Function vec_any_ge [type short] ===> Error\n");
8526 else
8527 printf("Function vec_any_ge [type short] ===> OK\n");
8530 err = 0;
8531 # if defined (GCC_COMPILER)
8532 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
8533 USaux2.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
8534 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8535 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
8536 USaux2.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
8537 # endif
8538 b= vec_any_ge (USaux1.v, USaux2.v);
8539 bAux= 0;
8540 for (i=0; i<8; i++)
8541 bAux= bAux || (USaux1.e[i]>=USaux2.e[i]);
8542 if (bAux!=b) err= 1;
8544 # if defined (GCC_COMPILER)
8545 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
8546 USaux2.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
8547 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8548 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
8549 USaux2.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
8550 # endif
8551 b= vec_any_ge (USaux1.v, USaux2.v);
8552 bAux= 0;
8553 for (i=0; i<8; i++)
8554 bAux= bAux || (USaux1.e[i]>=USaux2.e[i]);
8555 if (bAux!=b) err= 1;
8557 # if defined (GCC_COMPILER)
8558 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
8559 USaux2.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
8560 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8561 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
8562 USaux2.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
8563 # endif
8564 b= vec_any_ge (USaux1.v, USaux2.v);
8565 bAux= 0;
8566 for (i=0; i<8; i++)
8567 bAux= bAux || (USaux1.e[i]>=USaux2.e[i]);
8568 if (bAux!=b) err= 1;
8570 if (err)
8571 printf("Function vec_any_ge [type unsigned short] ===> Error\n");
8572 else
8573 printf("Function vec_any_ge [type unsigned short] ===> OK\n");
8576 err = 0;
8577 # if defined (GCC_COMPILER)
8578 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
8579 Iaux2.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
8580 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8581 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
8582 Iaux2.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
8583 # endif
8584 b= vec_any_ge (Iaux1.v, Iaux2.v);
8585 bAux= 0;
8586 for (i=0; i<4; i++)
8587 bAux= bAux || (Iaux1.e[i]>=Iaux2.e[i]);
8588 if (bAux!=b) err= 1;
8590 # if defined (GCC_COMPILER)
8591 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
8592 Iaux2.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
8593 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8594 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
8595 Iaux2.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
8596 # endif
8597 b= vec_any_ge (Iaux1.v, Iaux2.v);
8598 bAux= 0;
8599 for (i=0; i<4; i++)
8600 bAux= bAux || (Iaux1.e[i]>=Iaux2.e[i]);
8601 if (bAux!=b) err= 1;
8603 # if defined (GCC_COMPILER)
8604 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
8605 Iaux2.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
8606 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8607 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
8608 Iaux2.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
8609 # endif
8610 b= vec_any_ge (Iaux1.v, Iaux2.v);
8611 bAux= 0;
8612 for (i=0; i<4; i++)
8613 bAux= bAux || (Iaux1.e[i]>=Iaux2.e[i]);
8614 if (bAux!=b) err= 1;
8616 if (err)
8617 printf("Function vec_any_ge [type int] ===> Error\n");
8618 else
8619 printf("Function vec_any_ge [type int] ===> OK\n");
8622 err = 0;
8623 # if defined (GCC_COMPILER)
8624 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
8625 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
8626 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8627 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
8628 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
8629 # endif
8630 b= vec_any_ge (UIaux1.v, UIaux2.v);
8631 bAux= 0;
8632 for (i=0; i<4; i++)
8633 bAux= bAux || (UIaux1.e[i]>=UIaux2.e[i]);
8634 if (bAux!=b) err= 1;
8636 # if defined (GCC_COMPILER)
8637 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
8638 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
8639 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8640 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
8641 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
8642 # endif
8643 b= vec_any_ge (UIaux1.v, UIaux2.v);
8644 bAux= 0;
8645 for (i=0; i<4; i++)
8646 bAux= bAux || (UIaux1.e[i]>=UIaux2.e[i]);
8647 if (bAux!=b) err= 1;
8649 # if defined (GCC_COMPILER)
8650 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
8651 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
8652 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8653 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
8654 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
8655 # endif
8656 b= vec_any_ge (UIaux1.v, UIaux2.v);
8657 bAux= 0;
8658 for (i=0; i<4; i++)
8659 bAux= bAux || (UIaux1.e[i]>=UIaux2.e[i]);
8660 if (bAux!=b) err= 1;
8662 if (err)
8663 printf("Function vec_any_ge [type unsigned int] ===> Error\n");
8664 else
8665 printf("Function vec_any_ge [type unsigned int] ===> OK\n");
8667 #if defined TEST_FLOATS
8668 err = 0;
8669 # if defined (GCC_COMPILER)
8670 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
8671 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
8672 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8673 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
8674 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
8675 # endif
8676 b= vec_any_ge (Faux1.v, Faux2.v);
8677 bAux= 0;
8678 for (i=0; i<4; i++)
8679 bAux= bAux || (Faux1.e[i]>=Faux2.e[i]);
8680 if (bAux!=b) err= 1;
8682 # if defined (GCC_COMPILER)
8683 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
8684 Faux2.v= (vector float) { 0.0, 3.5, 0.5, -1.5};
8685 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8686 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
8687 Faux2.v= (vector float) ( 0.0, 3.5, 0.5, -1.5);
8688 # endif
8689 b= vec_any_ge (Faux1.v, Faux2.v);
8690 bAux= 0;
8691 for (i=0; i<4; i++)
8692 bAux= bAux || (Faux1.e[i]>=Faux2.e[i]);
8693 if (bAux!=b) err= 1;
8695 # if defined (GCC_COMPILER)
8696 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
8697 Faux2.v= (vector float) { 0.0, 3.5,-0.5, -1.5};
8698 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8699 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
8700 Faux2.v= (vector float) ( 0.0, 3.5,-0.5, -1.5);
8701 # endif
8702 b= vec_any_ge (Faux1.v, Faux2.v);
8703 bAux= 0;
8704 for (i=0; i<4; i++)
8705 bAux= bAux || (Faux1.e[i]>=Faux2.e[i]);
8706 if (bAux!=b) err= 1;
8708 if (err)
8709 printf("Function vec_any_ge [type float] ===> Error\n");
8710 else
8711 printf("Function vec_any_ge [type float] ===> OK\n");
8712 #endif
8714 /* Function vec_any_gt */
8715 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
8716 err = 0;
8717 # if defined (GCC_COMPILER)
8718 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
8719 Caux2.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
8720 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8721 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
8722 Caux2.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
8723 # endif
8724 b= vec_any_gt (Caux1.v, Caux2.v);
8725 bAux= 0;
8726 for (i=0; i<16; i++)
8727 bAux= bAux || (Caux1.e[i]>Caux2.e[i]);
8728 if (bAux!=b) err= 1;
8730 # if defined (GCC_COMPILER)
8731 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
8732 Caux2.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
8733 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8734 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
8735 Caux2.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
8736 # endif
8737 b= vec_any_gt (Caux1.v, Caux2.v);
8738 bAux= 0;
8739 for (i=0; i<16; i++)
8740 bAux= bAux || (Caux1.e[i]>Caux2.e[i]);
8741 if (bAux!=b) err= 1;
8743 # if defined (GCC_COMPILER)
8744 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
8745 Caux2.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
8746 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8747 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
8748 Caux2.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
8749 # endif
8750 b= vec_any_gt (Caux1.v, Caux2.v);
8751 bAux= 0;
8752 for (i=0; i<16; i++)
8753 bAux= bAux || (Caux1.e[i]>Caux2.e[i]);
8754 if (bAux!=b) err= 1;
8756 if (err)
8757 printf("Function vec_any_gt [type char] ===> Error\n");
8758 else
8759 printf("Function vec_any_gt [type char] ===> OK\n");
8762 err = 0;
8763 # if defined (GCC_COMPILER)
8764 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
8765 UCaux2.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
8766 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8767 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
8768 UCaux2.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
8769 # endif
8770 b= vec_any_gt (UCaux1.v, UCaux2.v);
8771 bAux= 0;
8772 for (i=0; i<16; i++)
8773 bAux= bAux || (UCaux1.e[i]>UCaux2.e[i]);
8774 if (bAux!=b) err= 1;
8776 # if defined (GCC_COMPILER)
8777 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
8778 UCaux2.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
8779 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8780 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
8781 UCaux2.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
8782 # endif
8783 b= vec_any_gt (UCaux1.v, UCaux2.v);
8784 bAux= 0;
8785 for (i=0; i<16; i++)
8786 bAux= bAux || (UCaux1.e[i]>UCaux2.e[i]);
8787 if (bAux!=b) err= 1;
8789 # if defined (GCC_COMPILER)
8790 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
8791 UCaux2.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
8792 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8793 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
8794 UCaux2.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
8795 # endif
8796 b= vec_any_gt (UCaux1.v, UCaux2.v);
8797 bAux= 0;
8798 for (i=0; i<16; i++)
8799 bAux= bAux || (UCaux1.e[i]>UCaux2.e[i]);
8800 if (bAux!=b) err= 1;
8802 if (err)
8803 printf("Function vec_any_gt [type unsigned char] ===> Error\n");
8804 else
8805 printf("Function vec_any_gt [type unsigned char] ===> OK\n");
8808 err = 0;
8809 # if defined (GCC_COMPILER)
8810 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
8811 Saux2.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
8812 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8813 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
8814 Saux2.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
8815 # endif
8816 b= vec_any_gt (Saux1.v, Saux2.v);
8817 bAux= 0;
8818 for (i=0; i<8; i++)
8819 bAux= bAux || (Saux1.e[i]>Saux2.e[i]);
8820 if (bAux!=b) err= 1;
8822 # if defined (GCC_COMPILER)
8823 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
8824 Saux2.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
8825 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8826 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
8827 Saux2.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
8828 # endif
8829 b= vec_any_gt (Saux1.v, Saux2.v);
8830 bAux= 0;
8831 for (i=0; i<8; i++)
8832 bAux= bAux || (Saux1.e[i]>Saux2.e[i]);
8833 if (bAux!=b) err= 1;
8835 # if defined (GCC_COMPILER)
8836 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
8837 Saux2.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
8838 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8839 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
8840 Saux2.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
8841 # endif
8842 b= vec_any_gt (Saux1.v, Saux2.v);
8843 bAux= 0;
8844 for (i=0; i<8; i++)
8845 bAux= bAux || (Saux1.e[i]>Saux2.e[i]);
8846 if (bAux!=b) err= 1;
8848 if (err)
8849 printf("Function vec_any_gt [type short] ===> Error\n");
8850 else
8851 printf("Function vec_any_gt [type short] ===> OK\n");
8854 err = 0;
8855 # if defined (GCC_COMPILER)
8856 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
8857 USaux2.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
8858 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8859 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
8860 USaux2.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
8861 # endif
8862 b= vec_any_gt (USaux1.v, USaux2.v);
8863 bAux= 0;
8864 for (i=0; i<8; i++)
8865 bAux= bAux || (USaux1.e[i]>USaux2.e[i]);
8866 if (bAux!=b) err= 1;
8868 # if defined (GCC_COMPILER)
8869 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
8870 USaux2.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
8871 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8872 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
8873 USaux2.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
8874 # endif
8875 b= vec_any_gt (USaux1.v, USaux2.v);
8876 bAux= 0;
8877 for (i=0; i<8; i++)
8878 bAux= bAux || (USaux1.e[i]>USaux2.e[i]);
8879 if (bAux!=b) err= 1;
8881 # if defined (GCC_COMPILER)
8882 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
8883 USaux2.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
8884 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8885 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
8886 USaux2.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
8887 # endif
8888 b= vec_any_gt (USaux1.v, USaux2.v);
8889 bAux= 0;
8890 for (i=0; i<8; i++)
8891 bAux= bAux || (USaux1.e[i]>USaux2.e[i]);
8892 if (bAux!=b) err= 1;
8894 if (err)
8895 printf("Function vec_any_gt [type unsigned short] ===> Error\n");
8896 else
8897 printf("Function vec_any_gt [type unsigned short] ===> OK\n");
8900 err = 0;
8901 # if defined (GCC_COMPILER)
8902 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
8903 Iaux2.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
8904 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8905 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
8906 Iaux2.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
8907 # endif
8908 b= vec_any_gt (Iaux1.v, Iaux2.v);
8909 bAux= 0;
8910 for (i=0; i<4; i++)
8911 bAux= bAux || (Iaux1.e[i]>Iaux2.e[i]);
8912 if (bAux!=b) err= 1;
8914 # if defined (GCC_COMPILER)
8915 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
8916 Iaux2.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
8917 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8918 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
8919 Iaux2.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
8920 # endif
8921 b= vec_any_gt (Iaux1.v, Iaux2.v);
8922 bAux= 0;
8923 for (i=0; i<4; i++)
8924 bAux= bAux || (Iaux1.e[i]>Iaux2.e[i]);
8925 if (bAux!=b) err= 1;
8927 # if defined (GCC_COMPILER)
8928 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
8929 Iaux2.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
8930 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8931 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
8932 Iaux2.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
8933 # endif
8934 b= vec_any_gt (Iaux1.v, Iaux2.v);
8935 bAux= 0;
8936 for (i=0; i<4; i++)
8937 bAux= bAux || (Iaux1.e[i]>Iaux2.e[i]);
8938 if (bAux!=b) err= 1;
8940 if (err)
8941 printf("Function vec_any_gt [type int] ===> Error\n");
8942 else
8943 printf("Function vec_any_gt [type int] ===> OK\n");
8946 err = 0;
8947 # if defined (GCC_COMPILER)
8948 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
8949 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
8950 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8951 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
8952 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
8953 # endif
8954 b= vec_any_gt (UIaux1.v, UIaux2.v);
8955 bAux= 0;
8956 for (i=0; i<4; i++)
8957 bAux= bAux || (UIaux1.e[i]>UIaux2.e[i]);
8958 if (bAux!=b) err= 1;
8960 # if defined (GCC_COMPILER)
8961 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
8962 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
8963 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8964 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
8965 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
8966 # endif
8967 b= vec_any_gt (UIaux1.v, UIaux2.v);
8968 bAux= 0;
8969 for (i=0; i<4; i++)
8970 bAux= bAux || (UIaux1.e[i]>UIaux2.e[i]);
8971 if (bAux!=b) err= 1;
8973 # if defined (GCC_COMPILER)
8974 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
8975 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
8976 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8977 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
8978 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
8979 # endif
8980 b= vec_any_gt (UIaux1.v, UIaux2.v);
8981 bAux= 0;
8982 for (i=0; i<4; i++)
8983 bAux= bAux || (UIaux1.e[i]>UIaux2.e[i]);
8984 if (bAux!=b) err= 1;
8986 if (err)
8987 printf("Function vec_any_gt [type unsigned int] ===> Error\n");
8988 else
8989 printf("Function vec_any_gt [type unsigned int] ===> OK\n");
8991 #if defined TEST_FLOATS
8992 err = 0;
8993 # if defined (GCC_COMPILER)
8994 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
8995 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
8996 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
8997 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
8998 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
8999 # endif
9000 b= vec_any_gt (Faux1.v, Faux2.v);
9001 bAux= 0;
9002 for (i=0; i<4; i++)
9003 bAux= bAux || (Faux1.e[i]>Faux2.e[i]);
9004 if (bAux!=b) err= 1;
9006 # if defined (GCC_COMPILER)
9007 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9008 Faux2.v= (vector float) { 0.0, 3.5, 0.5, -1.5};
9009 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9010 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9011 Faux2.v= (vector float) ( 0.0, 3.5, 0.5, -1.5);
9012 # endif
9013 b= vec_any_gt (Faux1.v, Faux2.v);
9014 bAux= 0;
9015 for (i=0; i<4; i++)
9016 bAux= bAux || (Faux1.e[i]>Faux2.e[i]);
9017 if (bAux!=b) err= 1;
9019 # if defined (GCC_COMPILER)
9020 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9021 Faux2.v= (vector float) { 0.0, 3.5,-0.5, -1.5};
9022 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9023 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9024 Faux2.v= (vector float) ( 0.0, 3.5,-0.5, -1.5);
9025 # endif
9026 b= vec_any_gt (Faux1.v, Faux2.v);
9027 bAux= 0;
9028 for (i=0; i<4; i++)
9029 bAux= bAux || (Faux1.e[i]>Faux2.e[i]);
9030 if (bAux!=b) err= 1;
9032 if (err)
9033 printf("Function vec_any_gt [type float] ===> Error\n");
9034 else
9035 printf("Function vec_any_gt [type float] ===> OK\n");
9036 #endif
9039 /* Function vec_any_le */
9040 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
9041 err = 0;
9042 # if defined (GCC_COMPILER)
9043 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9044 Caux1.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
9045 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9046 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9047 Caux1.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
9048 # endif
9049 b= vec_any_le (Caux1.v, Caux2.v);
9050 bAux= 0;
9051 for (i=0; i<16; i++)
9052 bAux= bAux || (Caux1.e[i]<=Caux2.e[i]);
9053 if (bAux!=b) err= 1;
9055 # if defined (GCC_COMPILER)
9056 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9057 Caux1.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
9058 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9059 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9060 Caux1.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
9061 # endif
9062 b= vec_any_le (Caux1.v, Caux2.v);
9063 bAux= 0;
9064 for (i=0; i<16; i++)
9065 bAux= bAux || (Caux1.e[i]<=Caux2.e[i]);
9066 if (bAux!=b) err= 1;
9068 # if defined (GCC_COMPILER)
9069 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9070 Caux1.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
9071 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9072 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9073 Caux1.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
9074 # endif
9075 b= vec_any_le (Caux1.v, Caux2.v);
9076 bAux= 0;
9077 for (i=0; i<16; i++)
9078 bAux= bAux || (Caux1.e[i]<=Caux2.e[i]);
9079 if (bAux!=b) err= 1;
9081 if (err)
9082 printf("Function vec_any_le [type char] ===> Error\n");
9083 else
9084 printf("Function vec_any_le [type char] ===> OK\n");
9087 err = 0;
9088 # if defined (GCC_COMPILER)
9089 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9090 UCaux1.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
9091 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9092 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9093 UCaux1.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
9094 # endif
9095 b= vec_any_le (UCaux1.v, UCaux2.v);
9096 bAux= 0;
9097 for (i=0; i<16; i++)
9098 bAux= bAux || (UCaux1.e[i]<=UCaux2.e[i]);
9099 if (bAux!=b) err= 1;
9101 # if defined (GCC_COMPILER)
9102 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9103 UCaux1.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
9104 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9105 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9106 UCaux1.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
9107 # endif
9108 b= vec_any_le (UCaux1.v, UCaux2.v);
9109 bAux= 0;
9110 for (i=0; i<16; i++)
9111 bAux= bAux || (UCaux1.e[i]<=UCaux2.e[i]);
9112 if (bAux!=b) err= 1;
9114 # if defined (GCC_COMPILER)
9115 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9116 UCaux1.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
9117 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9118 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9119 UCaux1.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
9120 # endif
9121 b= vec_any_le (UCaux1.v, UCaux2.v);
9122 bAux= 0;
9123 for (i=0; i<16; i++)
9124 bAux= bAux || (UCaux1.e[i]<=UCaux2.e[i]);
9125 if (bAux!=b) err= 1;
9127 if (err)
9128 printf("Function vec_any_le [type unsigned char] ===> Error\n");
9129 else
9130 printf("Function vec_any_le [type unsigned char] ===> OK\n");
9133 err = 0;
9134 # if defined (GCC_COMPILER)
9135 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9136 Saux1.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
9137 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9138 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9139 Saux1.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
9140 # endif
9141 b= vec_any_le (Saux1.v, Saux2.v);
9142 bAux= 0;
9143 for (i=0; i<8; i++)
9144 bAux= bAux || (Saux1.e[i]<=Saux2.e[i]);
9145 if (bAux!=b) err= 1;
9147 # if defined (GCC_COMPILER)
9148 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9149 Saux1.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
9150 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9151 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9152 Saux1.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
9153 # endif
9154 b= vec_any_le (Saux1.v, Saux2.v);
9155 bAux= 0;
9156 for (i=0; i<8; i++)
9157 bAux= bAux || (Saux1.e[i]<=Saux2.e[i]);
9158 if (bAux!=b) err= 1;
9160 # if defined (GCC_COMPILER)
9161 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9162 Saux1.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
9163 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9164 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9165 Saux1.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
9166 # endif
9167 b= vec_any_le (Saux1.v, Saux2.v);
9168 bAux= 0;
9169 for (i=0; i<8; i++)
9170 bAux= bAux || (Saux1.e[i]<=Saux2.e[i]);
9171 if (bAux!=b) err= 1;
9173 if (err)
9174 printf("Function vec_any_le [type short] ===> Error\n");
9175 else
9176 printf("Function vec_any_le [type short] ===> OK\n");
9179 err = 0;
9180 # if defined (GCC_COMPILER)
9181 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9182 USaux1.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
9183 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9184 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9185 USaux1.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
9186 # endif
9187 b= vec_any_le (USaux1.v, USaux2.v);
9188 bAux= 0;
9189 for (i=0; i<8; i++)
9190 bAux= bAux || (USaux1.e[i]<=USaux2.e[i]);
9191 if (bAux!=b) err= 1;
9193 # if defined (GCC_COMPILER)
9194 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9195 USaux1.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
9196 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9197 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9198 USaux1.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
9199 # endif
9200 b= vec_any_le (USaux1.v, USaux2.v);
9201 bAux= 0;
9202 for (i=0; i<8; i++)
9203 bAux= bAux || (USaux1.e[i]<=USaux2.e[i]);
9204 if (bAux!=b) err= 1;
9206 # if defined (GCC_COMPILER)
9207 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9208 USaux1.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
9209 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9210 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9211 USaux1.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
9212 # endif
9213 b= vec_any_le (USaux1.v, USaux2.v);
9214 bAux= 0;
9215 for (i=0; i<8; i++)
9216 bAux= bAux || (USaux1.e[i]<=USaux2.e[i]);
9217 if (bAux!=b) err= 1;
9219 if (err)
9220 printf("Function vec_any_le [type unsigned short] ===> Error\n");
9221 else
9222 printf("Function vec_any_le [type unsigned short] ===> OK\n");
9225 err = 0;
9226 # if defined (GCC_COMPILER)
9227 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9228 Iaux1.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
9229 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9230 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9231 Iaux1.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
9232 # endif
9233 b= vec_any_le (Iaux1.v, Iaux2.v);
9234 bAux= 0;
9235 for (i=0; i<4; i++)
9236 bAux= bAux || (Iaux1.e[i]<=Iaux2.e[i]);
9237 if (bAux!=b) err= 1;
9239 # if defined (GCC_COMPILER)
9240 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9241 Iaux1.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
9242 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9243 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9244 Iaux1.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
9245 # endif
9246 b= vec_any_le (Iaux1.v, Iaux2.v);
9247 bAux= 0;
9248 for (i=0; i<4; i++)
9249 bAux= bAux || (Iaux1.e[i]<=Iaux2.e[i]);
9250 if (bAux!=b) err= 1;
9252 # if defined (GCC_COMPILER)
9253 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9254 Iaux1.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
9255 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9256 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9257 Iaux1.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
9258 # endif
9259 b= vec_any_le (Iaux1.v, Iaux2.v);
9260 bAux= 0;
9261 for (i=0; i<4; i++)
9262 bAux= bAux || (Iaux1.e[i]<=Iaux2.e[i]);
9263 if (bAux!=b) err= 1;
9265 if (err)
9266 printf("Function vec_any_le [type int] ===> Error\n");
9267 else
9268 printf("Function vec_any_le [type int] ===> OK\n");
9271 err = 0;
9272 # if defined (GCC_COMPILER)
9273 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9274 UIaux1.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
9275 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9276 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9277 UIaux1.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
9278 # endif
9279 b= vec_any_le (UIaux1.v, UIaux2.v);
9280 bAux= 0;
9281 for (i=0; i<4; i++)
9282 bAux= bAux || (UIaux1.e[i]<=UIaux2.e[i]);
9283 if (bAux!=b) err= 1;
9285 # if defined (GCC_COMPILER)
9286 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9287 UIaux1.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
9288 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9289 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9290 UIaux1.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
9291 # endif
9292 b= vec_any_le (UIaux1.v, UIaux2.v);
9293 bAux= 0;
9294 for (i=0; i<4; i++)
9295 bAux= bAux || (UIaux1.e[i]<=UIaux2.e[i]);
9296 if (bAux!=b) err= 1;
9298 # if defined (GCC_COMPILER)
9299 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9300 UIaux1.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
9301 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9302 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9303 UIaux1.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
9304 # endif
9305 b= vec_any_le (UIaux1.v, UIaux2.v);
9306 bAux= 0;
9307 for (i=0; i<4; i++)
9308 bAux= bAux || (UIaux1.e[i]<=UIaux2.e[i]);
9309 if (bAux!=b) err= 1;
9311 if (err)
9312 printf("Function vec_any_le [type unsigned int] ===> Error\n");
9313 else
9314 printf("Function vec_any_le [type unsigned int] ===> OK\n");
9316 #if defined TEST_FLOATS
9317 err = 0;
9318 # if defined (GCC_COMPILER)
9319 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9320 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
9321 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9322 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9323 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
9324 # endif
9325 b= vec_any_le (Faux1.v, Faux2.v);
9326 bAux= 0;
9327 for (i=0; i<4; i++)
9328 bAux= bAux || (Faux1.e[i]<=Faux2.e[i]);
9329 if (bAux!=b) err= 1;
9331 # if defined (GCC_COMPILER)
9332 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9333 Faux1.v= (vector float) { 0.0, 3.5, 0.5, -1.5};
9334 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9335 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9336 Faux1.v= (vector float) ( 0.0, 3.5, 0.5, -1.5);
9337 # endif
9338 b= vec_any_le (Faux1.v, Faux2.v);
9339 bAux= 0;
9340 for (i=0; i<4; i++)
9341 bAux= bAux || (Faux1.e[i]<=Faux2.e[i]);
9342 if (bAux!=b) err= 1;
9344 # if defined (GCC_COMPILER)
9345 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9346 Faux1.v= (vector float) { 0.0, 3.5,-0.5, -1.5};
9347 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9348 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9349 Faux1.v= (vector float) ( 0.0, 3.5,-0.5, -1.5);
9350 # endif
9351 b= vec_any_le (Faux1.v, Faux2.v);
9352 bAux= 0;
9353 for (i=0; i<4; i++)
9354 bAux= bAux || (Faux1.e[i]<=Faux2.e[i]);
9355 if (bAux!=b) err= 1;
9357 if (err)
9358 printf("Function vec_any_le [type float] ===> Error\n");
9359 else
9360 printf("Function vec_any_le [type float] ===> OK\n");
9361 #endif
9364 /* Function vec_any_lt */
9365 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
9366 err = 0;
9367 # if defined (GCC_COMPILER)
9368 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9369 Caux1.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
9370 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9371 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9372 Caux1.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
9373 # endif
9374 b= vec_any_lt (Caux1.v, Caux2.v);
9375 bAux= 0;
9376 for (i=0; i<16; i++)
9377 bAux= bAux || (Caux1.e[i]<Caux2.e[i]);
9378 if (bAux!=b) err= 1;
9380 # if defined (GCC_COMPILER)
9381 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9382 Caux1.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
9383 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9384 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9385 Caux1.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
9386 # endif
9387 b= vec_any_lt (Caux1.v, Caux2.v);
9388 bAux= 0;
9389 for (i=0; i<16; i++)
9390 bAux= bAux || (Caux1.e[i]<Caux2.e[i]);
9391 if (bAux!=b) err= 1;
9393 # if defined (GCC_COMPILER)
9394 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9395 Caux1.v= (vector signed char){ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
9396 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9397 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9398 Caux1.v= (vector signed char)( 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
9399 # endif
9400 b= vec_any_lt (Caux1.v, Caux2.v);
9401 bAux= 0;
9402 for (i=0; i<16; i++)
9403 bAux= bAux || (Caux1.e[i]<Caux2.e[i]);
9404 if (bAux!=b) err= 1;
9406 if (err)
9407 printf("Function vec_any_lt [type char] ===> Error\n");
9408 else
9409 printf("Function vec_any_lt [type char] ===> OK\n");
9412 err = 0;
9413 # if defined (GCC_COMPILER)
9414 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9415 UCaux1.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
9416 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9417 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9418 UCaux1.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
9419 # endif
9420 b= vec_any_lt (UCaux1.v, UCaux2.v);
9421 bAux= 0;
9422 for (i=0; i<16; i++)
9423 bAux= bAux || (UCaux1.e[i]<UCaux2.e[i]);
9424 if (bAux!=b) err= 1;
9426 # if defined (GCC_COMPILER)
9427 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9428 UCaux1.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
9429 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9430 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9431 UCaux1.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
9432 # endif
9433 b= vec_any_lt (UCaux1.v, UCaux2.v);
9434 bAux= 0;
9435 for (i=0; i<16; i++)
9436 bAux= bAux || (UCaux1.e[i]<UCaux2.e[i]);
9437 if (bAux!=b) err= 1;
9439 # if defined (GCC_COMPILER)
9440 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9441 UCaux1.v= (vector unsigned char){250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250};
9442 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9443 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9444 UCaux1.v= (vector unsigned char)(250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250);
9445 # endif
9446 b= vec_any_lt (UCaux1.v, UCaux2.v);
9447 bAux= 0;
9448 for (i=0; i<16; i++)
9449 bAux= bAux || (UCaux1.e[i]<UCaux2.e[i]);
9450 if (bAux!=b) err= 1;
9452 if (err)
9453 printf("Function vec_any_lt [type unsigned char] ===> Error\n");
9454 else
9455 printf("Function vec_any_lt [type unsigned char] ===> OK\n");
9458 err = 0;
9459 # if defined (GCC_COMPILER)
9460 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9461 Saux1.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
9462 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9463 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9464 Saux1.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
9465 # endif
9466 b= vec_any_lt (Saux1.v, Saux2.v);
9467 bAux= 0;
9468 for (i=0; i<8; i++)
9469 bAux= bAux || (Saux1.e[i]<Saux2.e[i]);
9470 if (bAux!=b) err= 1;
9472 # if defined (GCC_COMPILER)
9473 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9474 Saux1.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
9475 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9476 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9477 Saux1.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
9478 # endif
9479 b= vec_any_lt (Saux1.v, Saux2.v);
9480 bAux= 0;
9481 for (i=0; i<8; i++)
9482 bAux= bAux || (Saux1.e[i]<Saux2.e[i]);
9483 if (bAux!=b) err= 1;
9485 # if defined (GCC_COMPILER)
9486 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9487 Saux1.v= (vector signed short){ 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000};
9488 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9489 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9490 Saux1.v= (vector signed short)( 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000);
9491 # endif
9492 b= vec_any_lt (Saux1.v, Saux2.v);
9493 bAux= 0;
9494 for (i=0; i<8; i++)
9495 bAux= bAux || (Saux1.e[i]<Saux2.e[i]);
9496 if (bAux!=b) err= 1;
9498 if (err)
9499 printf("Function vec_any_lt [type short] ===> Error\n");
9500 else
9501 printf("Function vec_any_lt [type short] ===> OK\n");
9504 err = 0;
9505 # if defined (GCC_COMPILER)
9506 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9507 USaux1.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
9508 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9509 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9510 USaux1.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
9511 # endif
9512 b= vec_any_lt (USaux1.v, USaux2.v);
9513 bAux= 0;
9514 for (i=0; i<8; i++)
9515 bAux= bAux || (USaux1.e[i]<USaux2.e[i]);
9516 if (bAux!=b) err= 1;
9518 # if defined (GCC_COMPILER)
9519 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9520 USaux1.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
9521 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9522 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9523 USaux1.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
9524 # endif
9525 b= vec_any_lt (USaux1.v, USaux2.v);
9526 bAux= 0;
9527 for (i=0; i<8; i++)
9528 bAux= bAux || (USaux1.e[i]<USaux2.e[i]);
9529 if (bAux!=b) err= 1;
9531 # if defined (GCC_COMPILER)
9532 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9533 USaux1.v= (vector unsigned short){59000, 59000, 59000, 59000,59000, 9000, 9000, 9000};
9534 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9535 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9536 USaux1.v= (vector unsigned short)(59000, 59000, 59000, 59000,59000, 9000, 9000, 9000);
9537 # endif
9538 b= vec_any_lt (USaux1.v, USaux2.v);
9539 bAux= 0;
9540 for (i=0; i<8; i++)
9541 bAux= bAux || (USaux1.e[i]<USaux2.e[i]);
9542 if (bAux!=b) err= 1;
9544 if (err)
9545 printf("Function vec_any_lt [type unsigned short] ===> Error\n");
9546 else
9547 printf("Function vec_any_lt [type unsigned short] ===> OK\n");
9550 err = 0;
9551 # if defined (GCC_COMPILER)
9552 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9553 Iaux1.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
9554 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9555 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9556 Iaux1.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
9557 # endif
9558 b= vec_any_lt (Iaux1.v, Iaux2.v);
9559 bAux= 0;
9560 for (i=0; i<4; i++)
9561 bAux= bAux || (Iaux1.e[i]<Iaux2.e[i]);
9562 if (bAux!=b) err= 1;
9564 # if defined (GCC_COMPILER)
9565 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9566 Iaux1.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
9567 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9568 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9569 Iaux1.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
9570 # endif
9571 b= vec_any_lt (Iaux1.v, Iaux2.v);
9572 bAux= 0;
9573 for (i=0; i<4; i++)
9574 bAux= bAux || (Iaux1.e[i]<Iaux2.e[i]);
9575 if (bAux!=b) err= 1;
9577 # if defined (GCC_COMPILER)
9578 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9579 Iaux1.v= (vector signed int){ 9000000, 9000000, 9000000,9000000};
9580 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9581 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9582 Iaux1.v= (vector signed int)( 9000000, 9000000, 9000000,9000000);
9583 # endif
9584 b= vec_any_lt (Iaux1.v, Iaux2.v);
9585 bAux= 0;
9586 for (i=0; i<4; i++)
9587 bAux= bAux || (Iaux1.e[i]<Iaux2.e[i]);
9588 if (bAux!=b) err= 1;
9590 if (err)
9591 printf("Function vec_any_lt [type int] ===> Error\n");
9592 else
9593 printf("Function vec_any_lt [type int] ===> OK\n");
9596 err = 0;
9597 # if defined (GCC_COMPILER)
9598 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9599 UIaux1.v= (vector unsigned int){0xFFFFFFF0, 20000000, 9, 9};
9600 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9601 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9602 UIaux1.v= (vector unsigned int)(0xFFFFFFF0, 20000000, 9, 9);
9603 # endif
9604 b= vec_any_lt (UIaux1.v, UIaux2.v);
9605 bAux= 0;
9606 for (i=0; i<4; i++)
9607 bAux= bAux || (UIaux1.e[i]<UIaux2.e[i]);
9608 if (bAux!=b) err= 1;
9610 # if defined (GCC_COMPILER)
9611 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9612 UIaux1.v= (vector unsigned int){0xFFFFFFF0, 12345678, 9, 9};
9613 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9614 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9615 UIaux1.v= (vector unsigned int)(0xFFFFFFF0, 12345678, 9, 9);
9616 # endif
9617 b= vec_any_lt (UIaux1.v, UIaux2.v);
9618 bAux= 0;
9619 for (i=0; i<4; i++)
9620 bAux= bAux || (UIaux1.e[i]<UIaux2.e[i]);
9621 if (bAux!=b) err= 1;
9623 # if defined (GCC_COMPILER)
9624 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9625 UIaux1.v= (vector unsigned int){0xFFFFFFF0, 10000000, 9, 9};
9626 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9627 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9628 UIaux1.v= (vector unsigned int)(0xFFFFFFF0, 10000000, 9, 9);
9629 # endif
9630 b= vec_any_lt (UIaux1.v, UIaux2.v);
9631 bAux= 0;
9632 for (i=0; i<4; i++)
9633 bAux= bAux || (UIaux1.e[i]<UIaux2.e[i]);
9634 if (bAux!=b) err= 1;
9636 if (err)
9637 printf("Function vec_any_lt [type unsigned int] ===> Error\n");
9638 else
9639 printf("Function vec_any_lt [type unsigned int] ===> OK\n");
9641 #if defined TEST_FLOATS
9642 err = 0;
9643 # if defined (GCC_COMPILER)
9644 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9645 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
9646 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9647 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9648 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
9649 # endif
9650 b= vec_any_lt (Faux1.v, Faux2.v);
9651 bAux= 0;
9652 for (i=0; i<4; i++)
9653 bAux= bAux || (Faux1.e[i]<Faux2.e[i]);
9654 if (bAux!=b) err= 1;
9656 # if defined (GCC_COMPILER)
9657 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9658 Faux1.v= (vector float) { 0.0, 3.5, 0.5, -1.5};
9659 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9660 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9661 Faux1.v= (vector float) ( 0.0, 3.5, 0.5, -1.5);
9662 # endif
9663 b= vec_any_lt (Faux1.v, Faux2.v);
9664 bAux= 0;
9665 for (i=0; i<4; i++)
9666 bAux= bAux || (Faux1.e[i]<Faux2.e[i]);
9667 if (bAux!=b) err= 1;
9669 # if defined (GCC_COMPILER)
9670 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
9671 Faux1.v= (vector float) { 0.0, 3.5,-0.5, -1.5};
9672 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9673 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
9674 Faux1.v= (vector float) ( 0.0, 3.5,-0.5, -1.5);
9675 # endif
9676 b= vec_any_lt (Faux1.v, Faux2.v);
9677 bAux= 0;
9678 for (i=0; i<4; i++)
9679 bAux= bAux || (Faux1.e[i]<Faux2.e[i]);
9680 if (bAux!=b) err= 1;
9682 if (err)
9683 printf("Function vec_any_lt [type float] ===> Error\n");
9684 else
9685 printf("Function vec_any_lt [type float] ===> OK\n");
9686 #endif
9689 #if defined TEST_FLOATS
9690 /* Function vec_any_nan */
9691 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
9692 err = 0;
9693 # if defined (GCC_COMPILER)
9694 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
9695 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9696 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
9697 # endif
9698 b= vec_any_nan (Faux1.v);
9699 bAux= 0;
9700 for (i=0; i<4; i++)
9701 bAux= bAux || isnan(Faux1.e[i]);
9702 if (bAux!=b) err= 1;
9704 # if defined (GCC_COMPILER)
9705 Faux1.v= (vector float) { 0.0, 3.5, NAN, -1.5};
9706 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9707 Faux1.v= (vector float) ( 0.0, 3.5, NAN, -1.5);
9708 # endif
9709 b= vec_any_nan (Faux1.v);
9710 bAux= 0;
9711 for (i=0; i<4; i++)
9712 bAux= bAux || isnan(Faux1.e[i]);
9713 if (bAux!=b) err= 1;
9715 # if defined (GCC_COMPILER)
9716 Faux1.v= (vector float) { NAN, 3.5, NAN, -1.5};
9717 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9718 Faux1.v= (vector float) ( NAN, 3.5, NAN, -1.5);
9719 # endif
9720 b= vec_any_nan (Faux1.v);
9721 bAux= 0;
9722 for (i=0; i<4; i++)
9723 bAux= bAux || isnan(Faux1.e[i]);
9724 if (bAux!=b) err= 1;
9726 if (err)
9727 printf("Function vec_any_nan [type float] ===> Error\n");
9728 else
9729 printf("Function vec_any_nan [type float] ===> OK\n");
9730 #endif
9733 /* Function vec_any_ne */
9734 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
9735 err = 0;
9736 # if defined (GCC_COMPILER)
9737 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9738 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9739 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9740 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9741 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9742 # endif
9743 b= vec_any_ne (Caux1.v, Caux2.v);
9744 bAux= 0;
9745 for (i=0; i<16; i++)
9746 bAux= bAux || (Caux1.e[i]!=Caux2.e[i]);
9747 if (bAux!=b) err= 1;
9749 # if defined (GCC_COMPILER)
9750 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9751 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9752 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9753 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9754 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9755 # endif
9756 b= vec_any_ne (Caux1.v, Caux2.v);
9757 bAux= 0;
9758 for (i=0; i<16; i++)
9759 bAux= bAux || (Caux1.e[i]!=Caux2.e[i]);
9760 if (bAux!=b) err= 1;
9762 # if defined (GCC_COMPILER)
9763 Caux1.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9764 Caux2.v= (vector signed char){-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
9765 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9766 Caux1.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9767 Caux2.v= (vector signed char)(-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7);
9768 # endif
9769 b= vec_any_ne (Caux1.v, Caux2.v);
9770 bAux= 0;
9771 for (i=0; i<16; i++)
9772 bAux= bAux || (Caux1.e[i]!=Caux2.e[i]);
9773 if (bAux!=b) err= 1;
9775 if (err)
9776 printf("Function vec_any_ne [type char] ===> Error\n");
9777 else
9778 printf("Function vec_any_ne [type char] ===> OK\n");
9781 err = 0;
9782 # if defined (GCC_COMPILER)
9783 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9784 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9785 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9786 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9787 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9788 # endif
9789 b= vec_any_ne (UCaux1.v, UCaux2.v);
9790 bAux= 0;
9791 for (i=0; i<16; i++)
9792 bAux= bAux || (UCaux1.e[i]!=UCaux2.e[i]);
9793 if (bAux!=b) err= 1;
9795 # if defined (GCC_COMPILER)
9796 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9797 UCaux2.v= (vector unsigned char){200, 201, 206, 205, 0, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9798 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9799 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9800 UCaux2.v= (vector unsigned char)(200, 201, 206, 205, 0, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9801 # endif
9802 b= vec_any_ne (UCaux1.v, UCaux2.v);
9803 bAux= 0;
9804 for (i=0; i<16; i++)
9805 bAux= bAux || (UCaux1.e[i]!=UCaux2.e[i]);
9806 if (bAux!=b) err= 1;
9808 # if defined (GCC_COMPILER)
9809 UCaux1.v= (vector unsigned char){200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9810 UCaux2.v= (vector unsigned char){200, 201, 206, 206, 0, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17};
9811 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9812 UCaux1.v= (vector unsigned char)(200, 201, 206, 205, 204, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9813 UCaux2.v= (vector unsigned char)(200, 201, 206, 206, 0, 203, 202, 201, 200, 101, 102, 13, 14, 15, 16, 17);
9814 # endif
9815 b= vec_any_ne (UCaux1.v, UCaux2.v);
9816 bAux= 0;
9817 for (i=0; i<16; i++)
9818 bAux= bAux || (UCaux1.e[i]!=UCaux2.e[i]);
9819 if (bAux!=b) err= 1;
9821 if (err)
9822 printf("Function vec_any_ne [type unsigned char] ===> Error\n");
9823 else
9824 printf("Function vec_any_ne [type unsigned char] ===> OK\n");
9827 err = 0;
9828 # if defined (GCC_COMPILER)
9829 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9830 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9831 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9832 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9833 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9834 # endif
9835 b= vec_any_ne (Saux1.v, Saux2.v);
9836 bAux= 0;
9837 for (i=0; i<8; i++)
9838 bAux= bAux || (Saux1.e[i]!=Saux2.e[i]);
9839 if (bAux!=b) err= 1;
9841 # if defined (GCC_COMPILER)
9842 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9843 Saux2.v= (vector signed short){-3800, 3700, -3600, -3500, 0, 3300, 3200, 3100};
9844 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9845 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9846 Saux2.v= (vector signed short)(-3800, 3700, -3600, -3500, 0, 3300, 3200, 3100);
9847 # endif
9848 b= vec_any_ne (Saux1.v, Saux2.v);
9849 bAux= 0;
9850 for (i=0; i<8; i++)
9851 bAux= bAux || (Saux1.e[i]!=Saux2.e[i]);
9852 if (bAux!=b) err= 1;
9854 # if defined (GCC_COMPILER)
9855 Saux1.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100};
9856 Saux2.v= (vector signed short){-3800, -3700, -3600, -3500, 0, 3300, 3100, 3100};
9857 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9858 Saux1.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3200, 3100);
9859 Saux2.v= (vector signed short)(-3800, -3700, -3600, -3500, 0, 3300, 3100, 3100);
9860 # endif
9861 b= vec_any_ne (Saux1.v, Saux2.v);
9862 bAux= 0;
9863 for (i=0; i<8; i++)
9864 bAux= bAux || (Saux1.e[i]!=Saux2.e[i]);
9865 if (bAux!=b) err= 1;
9867 if (err)
9868 printf("Function vec_any_ne [type short] ===> Error\n");
9869 else
9870 printf("Function vec_any_ne [type short] ===> OK\n");
9873 err = 0;
9874 # if defined (GCC_COMPILER)
9875 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9876 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9877 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9878 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9879 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9880 # endif
9881 b= vec_any_ne (USaux1.v, USaux2.v);
9882 bAux= 0;
9883 for (i=0; i<8; i++)
9884 bAux= bAux || (USaux1.e[i]!=USaux2.e[i]);
9885 if (bAux!=b) err= 1;
9887 # if defined (GCC_COMPILER)
9888 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9889 USaux2.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3100, 3100};
9890 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9891 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9892 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3100, 3100);
9893 # endif
9894 b= vec_any_ne (USaux1.v, USaux2.v);
9895 bAux= 0;
9896 for (i=0; i<8; i++)
9897 bAux= bAux || (USaux1.e[i]!=USaux2.e[i]);
9898 if (bAux!=b) err= 1;
9900 # if defined (GCC_COMPILER)
9901 USaux1.v= (vector unsigned short){48000, 47000, 46000, 45000, 0, 3300, 3200, 3100};
9902 USaux2.v= (vector unsigned short){48000, 47000, 46000, 0, 0, 3300, 3100, 3100};
9903 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9904 USaux1.v= (vector unsigned short)(48000, 47000, 46000, 45000, 0, 3300, 3200, 3100);
9905 USaux2.v= (vector unsigned short)(48000, 47000, 46000, 0, 0, 3300, 3100, 3100);
9906 # endif
9907 b= vec_any_ne (USaux1.v, USaux2.v);
9908 bAux= 0;
9909 for (i=0; i<8; i++)
9910 bAux= bAux || (USaux1.e[i]!=USaux2.e[i]);
9911 if (bAux!=b) err= 1;
9913 if (err)
9914 printf("Function vec_any_ne [type unsigned short] ===> Error\n");
9915 else
9916 printf("Function vec_any_ne [type unsigned short] ===> OK\n");
9919 err = 0;
9920 # if defined (GCC_COMPILER)
9921 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
9922 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1003300};
9923 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9924 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9925 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9926 # endif
9927 b= vec_any_ne (Iaux1.v, Iaux2.v);
9928 bAux= 0;
9929 for (i=0; i<4; i++)
9930 bAux= bAux || (Iaux1.e[i]!=Iaux2.e[i]);
9931 if (bAux!=b) err= 1;
9933 # if defined (GCC_COMPILER)
9934 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
9935 Iaux2.v= (vector signed int){-1003800, -1003700, 0,1113300};
9936 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9937 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9938 Iaux2.v= (vector signed int)(-1003800, -1003700, 0,1113300);
9939 # endif
9940 b= vec_any_ne (Iaux1.v, Iaux2.v);
9941 bAux= 0;
9942 for (i=0; i<4; i++)
9943 bAux= bAux || (Iaux1.e[i]!=Iaux2.e[i]);
9944 if (bAux!=b) err= 1;
9946 # if defined (GCC_COMPILER)
9947 Iaux1.v= (vector signed int){-1003800, -1003700, 0,1003300};
9948 Iaux2.v= (vector signed int){-1003800, 10, 0,1113300};
9949 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9950 Iaux1.v= (vector signed int)(-1003800, -1003700, 0,1003300);
9951 Iaux2.v= (vector signed int)(-1003800, 10, 0,1113300);
9952 # endif
9953 b= vec_any_ne (Iaux1.v, Iaux2.v);
9954 bAux= 0;
9955 for (i=0; i<4; i++)
9956 bAux= bAux || (Iaux1.e[i]!=Iaux2.e[i]);
9957 if (bAux!=b) err= 1;
9959 if (err)
9960 printf("Function vec_any_ne [type int] ===> Error\n");
9961 else
9962 printf("Function vec_any_ne [type int] ===> OK\n");
9965 err = 0;
9966 # if defined (GCC_COMPILER)
9967 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9968 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9969 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9970 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9971 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9972 # endif
9973 b= vec_any_ne (UIaux1.v, UIaux2.v);
9974 bAux= 0;
9975 for (i=0; i<4; i++)
9976 bAux= bAux || (UIaux1.e[i]!=UIaux2.e[i]);
9977 if (bAux!=b) err= 1;
9979 # if defined (GCC_COMPILER)
9980 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9981 UIaux2.v= (vector unsigned int){0xFFFFF000, 12345678, 5, 1};
9982 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9983 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9984 UIaux2.v= (vector unsigned int)(0xFFFFF000, 12345678, 5, 1);
9985 # endif
9986 b= vec_any_ne (UIaux1.v, UIaux2.v);
9987 bAux= 0;
9988 for (i=0; i<4; i++)
9989 bAux= bAux || (UIaux1.e[i]!=UIaux2.e[i]);
9990 if (bAux!=b) err= 1;
9992 # if defined (GCC_COMPILER)
9993 UIaux1.v= (vector unsigned int){0xFFFFF000, 12345678, 0, 1};
9994 UIaux2.v= (vector unsigned int){0xFFFFFFF0, 12345678, 5, 1};
9995 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
9996 UIaux1.v= (vector unsigned int)(0xFFFFF000, 12345678, 0, 1);
9997 UIaux2.v= (vector unsigned int)(0xFFFFFFF0, 12345678, 5, 1);
9998 # endif
9999 b= vec_any_ne (UIaux1.v, UIaux2.v);
10000 bAux= 0;
10001 for (i=0; i<4; i++)
10002 bAux= bAux || (UIaux1.e[i]!=UIaux2.e[i]);
10003 if (bAux!=b) err= 1;
10005 if (err)
10006 printf("Function vec_any_ne [type unsigned int] ===> Error\n");
10007 else
10008 printf("Function vec_any_ne [type unsigned int] ===> OK\n");
10010 #if defined TEST_FLOATS
10011 err = 0;
10012 # if defined (GCC_COMPILER)
10013 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10014 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10015 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10016 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10017 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10018 # endif
10019 b= vec_any_ne (Faux1.v, Faux2.v);
10020 bAux= 0;
10021 for (i=0; i<4; i++)
10022 bAux= bAux || (Faux1.e[i]!=Faux2.e[i]);
10023 if (bAux!=b) err= 1;
10025 # if defined (GCC_COMPILER)
10026 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10027 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.998};
10028 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10029 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10030 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.998);
10031 # endif
10032 b= vec_any_ne (Faux1.v, Faux2.v);
10033 bAux= 0;
10034 for (i=0; i<4; i++)
10035 bAux= bAux || (Faux1.e[i]!=Faux2.e[i]);
10036 if (bAux!=b) err= 1;
10038 # if defined (GCC_COMPILER)
10039 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10040 Faux2.v= (vector float) {-1.5, 0.0, 0.5, -3.998};
10041 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10042 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10043 Faux2.v= (vector float) (-1.5, 0.0, 0.5, -3.998);
10044 # endif
10045 b= vec_any_ne (Faux1.v, Faux2.v);
10046 bAux= 0;
10047 for (i=0; i<4; i++)
10048 bAux= bAux || (Faux1.e[i]!=Faux2.e[i]);
10049 if (bAux!=b) err= 1;
10051 if (err)
10052 printf("Function vec_any_ne [type float] ===> Error\n");
10053 else
10054 printf("Function vec_any_ne [type float] ===> OK\n");
10055 #endif
10058 #if defined TEST_FLOATS
10059 /* Function vec_any_nge */
10060 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
10061 err = 0;
10062 # if defined (GCC_COMPILER)
10063 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10064 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10065 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10066 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10067 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10068 # endif
10069 b= vec_any_nge (Faux1.v, Faux2.v);
10070 bAux= 0;
10071 for (i=0; i<4; i++)
10072 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10073 (Faux1.e[i]<Faux2.e[i]);
10074 if (bAux!=b) err= 1;
10076 # if defined (GCC_COMPILER)
10077 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10078 Faux2.v= (vector float) {-1.5, 1.0, 0.55, -3.999};
10079 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10080 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10081 Faux2.v= (vector float) (-1.5, 1.0, 0.55, -3.999);
10082 # endif
10083 b= vec_any_nge (Faux1.v, Faux2.v);
10084 bAux= 0;
10085 for (i=0; i<4; i++)
10086 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10087 (Faux1.e[i]<Faux2.e[i]);
10088 if (bAux!=b) err= 1;
10090 # if defined (GCC_COMPILER)
10091 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10092 Faux2.v= (vector float) {-1.5, 5.0, 0.5, -3.999};
10093 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10094 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10095 Faux2.v= (vector float) (-1.5, 5.0, 0.5, -3.999);
10096 # endif
10097 b= vec_any_nge (Faux1.v, Faux2.v);
10098 bAux= 0;
10099 for (i=0; i<4; i++)
10100 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10101 (Faux1.e[i]<Faux2.e[i]);
10102 if (bAux!=b) err= 1;
10104 # if defined (GCC_COMPILER)
10105 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10106 Faux2.v= (vector float) {-1.5, 1.0, NAN, -3.999};
10107 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10108 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10109 Faux2.v= (vector float) (-1.5, 1.0, NAN, -3.999);
10110 # endif
10111 b= vec_any_nge (Faux1.v, Faux2.v);
10112 bAux= 0;
10113 for (i=0; i<4; i++)
10114 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10115 (Faux1.e[i]<Faux2.e[i]);
10116 if (bAux!=b) err= 1;
10118 if (err)
10119 printf("Function vec_any_nge [type float] ===> Error\n");
10120 else
10121 printf("Function vec_any_nge [type float] ===> OK\n");
10122 #endif
10125 #if defined TEST_FLOATS
10126 /* Function vec_any_ngt */
10127 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
10128 err = 0;
10129 # if defined (GCC_COMPILER)
10130 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10131 Faux2.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10132 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10133 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10134 Faux2.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10135 # endif
10136 b= vec_any_ngt (Faux1.v, Faux2.v);
10137 bAux= 0;
10138 for (i=0; i<4; i++)
10139 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10140 !(Faux1.e[i]>Faux2.e[i]);
10141 if (bAux!=b) err= 1;
10143 # if defined (GCC_COMPILER)
10144 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10145 Faux2.v= (vector float) {-1.5, 1.0, 0.55, -3.999};
10146 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10147 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10148 Faux2.v= (vector float) (-1.5, 1.0, 0.55, -3.999);
10149 # endif
10150 b= vec_any_ngt (Faux1.v, Faux2.v);
10151 bAux= 0;
10152 for (i=0; i<4; i++)
10153 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10154 !(Faux1.e[i]>Faux2.e[i]);
10155 if (bAux!=b) err= 1;
10157 # if defined (GCC_COMPILER)
10158 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10159 Faux2.v= (vector float) {-1.5, 5.0, 0.5, -3.999};
10160 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10161 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10162 Faux2.v= (vector float) (-1.5, 5.0, 0.5, -3.999);
10163 # endif
10164 b= vec_any_ngt (Faux1.v, Faux2.v);
10165 bAux= 0;
10166 for (i=0; i<4; i++)
10167 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10168 !(Faux1.e[i]>Faux2.e[i]);
10169 if (bAux!=b) err= 1;
10171 # if defined (GCC_COMPILER)
10172 Faux1.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10173 Faux2.v= (vector float) {-1.5, 1.0, NAN, -3.999};
10174 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10175 Faux1.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10176 Faux2.v= (vector float) (-1.5, 1.0, NAN, -3.999);
10177 # endif
10178 b= vec_any_ngt (Faux1.v, Faux2.v);
10179 bAux= 0;
10180 for (i=0; i<4; i++)
10181 bAux= bAux || isnan(Faux1.e[i]) || isnan(Faux2.e[i]) ||
10182 !(Faux1.e[i]>Faux2.e[i]);
10183 if (bAux!=b) err= 1;
10185 if (err)
10186 printf("Function vec_any_ngt [type float] ===> Error\n");
10187 else
10188 printf("Function vec_any_ngt [type float] ===> OK\n");
10189 #endif
10192 #if defined TEST_FLOATS
10193 /* Function vec_any_nle */
10194 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
10195 err = 0;
10196 # if defined (GCC_COMPILER)
10197 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10198 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10199 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10200 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10201 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10202 # endif
10203 b= vec_any_nle (Faux1.v, Faux2.v);
10204 bAux= 0;
10205 for (i=0; i<4; i++)
10206 bAux= bAux ||
10207 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<=Faux2.e[i]));
10208 if (bAux!=b) err= 1;
10210 # if defined (GCC_COMPILER)
10211 Faux1.v= (vector float) {-1.5, 1.0, 0.55, -3.999};
10212 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10213 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10214 Faux1.v= (vector float) (-1.5, 1.0, 0.55, -3.999);
10215 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10216 # endif
10217 b= vec_any_nle (Faux1.v, Faux2.v);
10218 bAux= 0;
10219 for (i=0; i<4; i++)
10220 bAux= bAux ||
10221 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<=Faux2.e[i]));
10222 if (bAux!=b) err= 1;
10224 # if defined (GCC_COMPILER)
10225 Faux1.v= (vector float) {-1.5, 5.0, 0.5, -3.999};
10226 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10227 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10228 Faux1.v= (vector float) (-1.5, 5.0, 0.5, -3.999);
10229 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10230 # endif
10231 b= vec_any_nle (Faux1.v, Faux2.v);
10232 bAux= 0;
10233 for (i=0; i<4; i++)
10234 bAux= bAux ||
10235 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<=Faux2.e[i]));
10236 if (bAux!=b) err= 1;
10238 # if defined (GCC_COMPILER)
10239 Faux1.v= (vector float) {-1.5, 1.0, NAN, -3.999};
10240 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10241 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10242 Faux1.v= (vector float) (-1.5, 1.0, NAN, -3.999);
10243 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10244 # endif
10245 b= vec_any_nle (Faux1.v, Faux2.v);
10246 bAux= 0;
10247 for (i=0; i<4; i++)
10248 bAux= bAux ||
10249 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<=Faux2.e[i]));
10250 if (bAux!=b) err= 1;
10252 if (err)
10253 printf("Function vec_any_nle [type float] ===> Error\n");
10254 else
10255 printf("Function vec_any_nle [type float] ===> OK\n");
10256 #endif
10259 #if defined TEST_FLOATS
10260 /* Function vec_any_nlt */
10261 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
10262 err = 0;
10263 # if defined (GCC_COMPILER)
10264 Faux1.v= (vector float) {-1.5, 1.0, 0.5, -3.999};
10265 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10266 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10267 Faux1.v= (vector float) (-1.5, 1.0, 0.5, -3.999);
10268 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10269 # endif
10270 b= vec_any_nlt (Faux1.v, Faux2.v);
10271 bAux= 0;
10272 for (i=0; i<4; i++)
10273 bAux= bAux ||
10274 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<Faux2.e[i]));
10275 if (bAux!=b) err= 1;
10277 # if defined (GCC_COMPILER)
10278 Faux1.v= (vector float) {-1.5, 1.0, 0.55, -3.999};
10279 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10280 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10281 Faux1.v= (vector float) (-1.5, 1.0, 0.55, -3.999);
10282 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10283 # endif
10284 b= vec_all_nlt (Faux1.v, Faux2.v);
10285 b= vec_any_nlt (Faux1.v, Faux2.v);
10286 bAux= 0;
10287 for (i=0; i<4; i++)
10288 bAux= bAux ||
10289 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<Faux2.e[i]));
10290 if (bAux!=b) err= 1;
10292 # if defined (GCC_COMPILER)
10293 Faux1.v= (vector float) {-1.5, 5.0, 0.5, -3.999};
10294 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10295 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10296 Faux1.v= (vector float) (-1.5, 5.0, 0.5, -3.999);
10297 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10298 # endif
10299 b= vec_any_nlt (Faux1.v, Faux2.v);
10300 bAux= 0;
10301 for (i=0; i<4; i++)
10302 bAux= bAux ||
10303 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<Faux2.e[i]));
10304 if (bAux!=b) err= 1;
10306 # if defined (GCC_COMPILER)
10307 Faux1.v= (vector float) {-1.5, 1.0, NAN, -3.999};
10308 Faux2.v= (vector float) { 0.0, 3.5, 0.55, -1.5};
10309 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10310 Faux1.v= (vector float) (-1.5, 1.0, NAN, -3.999);
10311 Faux2.v= (vector float) ( 0.0, 3.5, 0.55, -1.5);
10312 # endif
10313 b= vec_any_nlt (Faux1.v, Faux2.v);
10314 bAux= 0;
10315 for (i=0; i<4; i++)
10316 bAux= bAux ||
10317 (isnan(Faux1.e[i]) || isnan(Faux2.e[i]) || !(Faux1.e[i]<Faux2.e[i]));
10318 if (bAux!=b) err= 1;
10320 if (err)
10321 printf("Function vec_any_nlt [type float] ===> Error\n");
10322 else
10323 printf("Function vec_any_nlt [type float] ===> OK\n");
10324 #endif
10327 #if defined TEST_FLOATS
10328 /* Function vec_any_numeric */
10329 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
10330 err = 0;
10331 # if defined (GCC_COMPILER)
10332 Faux1.v= (vector float) { NAN, NAN, NAN, NAN};
10333 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10334 Faux1.v= (vector float) ( NAN, NAN, NAN, NAN);
10335 # endif
10336 b= vec_any_numeric (Faux1.v);
10337 bAux= 0;
10338 for (i=0; i<4; i++)
10339 bAux= bAux || !isnan(Faux1.e[i]);
10340 if (bAux!=b) err= 1;
10342 # if defined (GCC_COMPILER)
10343 Faux1.v= (vector float) { NAN, 3.5, NAN, NAN};
10344 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10345 Faux1.v= (vector float) ( NAN, 3.5, NAN, NAN);
10346 # endif
10347 b= vec_any_numeric (Faux1.v);
10348 bAux= 0;
10349 for (i=0; i<4; i++)
10350 bAux= bAux || !isnan(Faux1.e[i]);
10351 if (bAux!=b) err= 1;
10353 # if defined (GCC_COMPILER)
10354 Faux1.v= (vector float) { -1.5, 3.5, 0.55, -1.5};
10355 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10356 Faux1.v= (vector float) ( -1.5, 3.5, 0.55, -1.5);
10357 # endif
10358 b= vec_any_numeric (Faux1.v);
10359 bAux= 0;
10360 for (i=0; i<4; i++)
10361 bAux= bAux || !isnan(Faux1.e[i]);
10362 if (bAux!=b) err= 1;
10364 if (err)
10365 printf("Function vec_any_numeric [type float] ===> Error\n");
10366 else
10367 printf("Function vec_any_numeric [type float] ===> OK\n");
10368 #endif
10371 #if defined TEST_FLOATS
10372 /* Function vec_any_out */
10373 printf("\n:::::::::::::::::::::::::::::::::::::::\n");
10374 err = 0;
10375 Faux1.v = Fcons1;
10376 Faux2.v = Fcons2;
10377 I1 = vec_any_out( Faux1.v, Faux2.v );
10378 Iaux = 0;
10379 for ( i=0; i< 4; i++ )
10381 Iaux = Iaux || ((isnan(Faux1.e[i])) || (isnan(Faux2.e[i])) ||
10382 (Faux1.e[i]>Faux2.e[i]) || (Faux1.e[i]<-Faux2.e[i]));
10384 if (I1 != Iaux) err++;
10386 # if defined (GCC_COMPILER)
10387 Faux1.v = (vector float){-0.5, 1.0, 0, -0.999};
10388 # elif defined (MAC_COMPILER) || defined (XLC_COMPILER)
10389 Faux1.v = (vector float)(-0.5, 1.0, 0, -0.999);
10390 # endif
10391 Faux2.v = Fcons2;
10392 I1 = vec_any_out( Faux1.v, Faux2.v );
10393 Iaux = 0;
10394 for ( i=0; i< 4; i++ )
10396 Iaux = Iaux || ((isnan(Faux1.e[i])) || (isnan(Faux2.e[i])) ||
10397 (Faux1.e[i]>Faux2.e[i]) || (Faux1.e[i]<-Faux2.e[i]));
10399 if (I1 != Iaux) err++;
10401 if (err)
10402 printf("Function vec_any_out [type float] ===> Error\n");
10403 else
10404 printf("Function vec_any_out [type float] ===> OK\n");
10405 #endif
10407 return 0;