| 1 |
/* Verify that overloaded built-ins for vec_and and vec_andc |
| 2 |
* with char inputs produce the right results. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-mvsx -O1" } */ |
| 6 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 7 |
|
| 8 |
#include <altivec.h> |
| 9 |
|
| 10 |
vector signed char |
| 11 |
test1_and (vector bool char x, vector signed char y) |
| 12 |
{ |
| 13 |
vector signed char *foo; |
| 14 |
*foo += vec_and (x, y); |
| 15 |
return *foo; |
| 16 |
} |
| 17 |
|
| 18 |
vector signed char |
| 19 |
test1_andc (vector bool char x, vector signed char y) |
| 20 |
{ |
| 21 |
vector signed char *foo; |
| 22 |
*foo += vec_andc (x, y); |
| 23 |
return *foo; |
| 24 |
} |
| 25 |
|
| 26 |
vector signed char |
| 27 |
test2_and (vector signed char x, vector bool char y) |
| 28 |
{ |
| 29 |
vector signed char *foo; |
| 30 |
*foo += vec_and (x, y); |
| 31 |
return *foo; |
| 32 |
} |
| 33 |
|
| 34 |
vector signed char |
| 35 |
test2_andc (vector signed char x, vector bool char y) |
| 36 |
{ |
| 37 |
vector signed char *foo; |
| 38 |
*foo += vec_andc (x, y); |
| 39 |
return *foo; |
| 40 |
} |
| 41 |
|
| 42 |
vector signed char |
| 43 |
test3_and (vector signed char x, vector signed char y) |
| 44 |
{ |
| 45 |
vector signed char *foo; |
| 46 |
*foo += vec_and (x, y); |
| 47 |
return *foo; |
| 48 |
} |
| 49 |
|
| 50 |
vector signed char |
| 51 |
test3_andc (vector signed char x, vector signed char y) |
| 52 |
{ |
| 53 |
vector signed char *foo; |
| 54 |
*foo += vec_andc (x, y); |
| 55 |
return *foo; |
| 56 |
} |
| 57 |
|
| 58 |
vector unsigned char |
| 59 |
test4_and (vector bool char x, vector unsigned char y) |
| 60 |
{ |
| 61 |
vector unsigned char *foo; |
| 62 |
*foo += vec_and (x, y); |
| 63 |
return *foo; |
| 64 |
} |
| 65 |
|
| 66 |
vector unsigned char |
| 67 |
test4_andc (vector bool char x, vector unsigned char y) |
| 68 |
{ |
| 69 |
vector unsigned char *foo; |
| 70 |
*foo += vec_andc (x, y); |
| 71 |
return *foo; |
| 72 |
} |
| 73 |
|
| 74 |
vector unsigned char |
| 75 |
test5_and (vector unsigned char x, vector bool char y) |
| 76 |
{ |
| 77 |
vector unsigned char *foo; |
| 78 |
*foo += vec_and (x, y); |
| 79 |
return *foo; |
| 80 |
} |
| 81 |
|
| 82 |
vector unsigned char |
| 83 |
test5_andc (vector unsigned char x, vector bool char y) |
| 84 |
{ |
| 85 |
vector unsigned char *foo; |
| 86 |
*foo += vec_andc (x, y); |
| 87 |
return *foo; |
| 88 |
} |
| 89 |
|
| 90 |
vector unsigned char |
| 91 |
test6_and (vector unsigned char x, vector unsigned char y) |
| 92 |
{ |
| 93 |
vector unsigned char *foo; |
| 94 |
*foo += vec_and (x, y); |
| 95 |
return *foo; |
| 96 |
} |
| 97 |
|
| 98 |
vector unsigned char |
| 99 |
test6_andc (vector unsigned char x, vector unsigned char y) |
| 100 |
{ |
| 101 |
vector unsigned char *foo; |
| 102 |
*foo += vec_andc (x, y); |
| 103 |
return *foo; |
| 104 |
} |
| 105 |
|
| 106 |
/* { dg-final { scan-assembler-times {\mxxland\M} 6 } } */ |
| 107 |
/* { dg-final { scan-assembler-times {\mxxlandc\M} 6 } } */ |
| 108 |
|