| 1 |
/* Verify that overloaded built-ins for vec_min with short |
| 2 |
inputs produce the right results. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-maltivec" } */ |
| 6 |
/* { dg-require-effective-target powerpc_altivec } */ |
| 7 |
|
| 8 |
#include <altivec.h> |
| 9 |
|
| 10 |
vector signed short |
| 11 |
test3_min (vector signed short x, vector signed short y) |
| 12 |
{ |
| 13 |
return vec_min (x, y); |
| 14 |
} |
| 15 |
|
| 16 |
vector unsigned short |
| 17 |
test6_min (vector unsigned short x, vector unsigned short y) |
| 18 |
{ |
| 19 |
return vec_min (x, y); |
| 20 |
} |
| 21 |
|
| 22 |
vector signed short |
| 23 |
test3_max (vector signed short x, vector signed short y) |
| 24 |
{ |
| 25 |
return vec_max (x, y); |
| 26 |
} |
| 27 |
|
| 28 |
vector unsigned short |
| 29 |
test6_max (vector unsigned short x, vector unsigned short y) |
| 30 |
{ |
| 31 |
return vec_max (x, y); |
| 32 |
} |
| 33 |
|
| 34 |
vector unsigned short |
| 35 |
test4_min (vector bool short x, vector unsigned short y) |
| 36 |
{ |
| 37 |
return vec_min (x, y); |
| 38 |
} |
| 39 |
|
| 40 |
vector unsigned short |
| 41 |
test5_min (vector unsigned short x, vector bool short y) |
| 42 |
{ |
| 43 |
return vec_min (x, y); |
| 44 |
} |
| 45 |
|
| 46 |
vector signed short |
| 47 |
test7_min (vector bool short x, vector signed short y) |
| 48 |
{ |
| 49 |
return vec_min (x, y); |
| 50 |
} |
| 51 |
|
| 52 |
vector signed short |
| 53 |
test8_min (vector signed short x, vector bool short y) |
| 54 |
{ |
| 55 |
return vec_min (x, y); |
| 56 |
} |
| 57 |
|
| 58 |
/* { dg-final { scan-assembler-times "vminsh" 3 } } */ |
| 59 |
/* { dg-final { scan-assembler-times "vmaxsh" 1 } } */ |
| 60 |
/* { dg-final { scan-assembler-times "vminuh" 3 } } */ |
| 61 |
/* { dg-final { scan-assembler-times "vmaxuh" 1 } } */ |