| 1 |
/* { dg-additional-options "-Wno-shift-overflow" } */ |
| 2 |
|
| 3 |
#include "harness.h" |
| 4 |
|
| 5 |
#define BIG 4294967295 |
| 6 |
|
| 7 |
static void test() |
| 8 |
{ |
| 9 |
/* Input vectors. */ |
| 10 |
vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7}; |
| 11 |
vector bool char vbc = {0,255,255,0,0,0,255,0,255,0,0,255,255,255,0,255}; |
| 12 |
vector pixel vp = {(0<<15) + (1<<10) + (2<<5) + 3, |
| 13 |
(1<<15) + (4<<10) + (5<<5) + 6, |
| 14 |
(0<<15) + (7<<10) + (8<<5) + 9, |
| 15 |
(1<<15) + (10<<10) + (11<<5) + 12, |
| 16 |
(1<<15) + (13<<10) + (14<<5) + 15, |
| 17 |
(0<<15) + (16<<10) + (17<<5) + 18, |
| 18 |
(1<<15) + (19<<10) + (20<<5) + 21, |
| 19 |
(0<<15) + (22<<10) + (23<<5) + 24}; |
| 20 |
vector signed short vss = {-4,-3,-2,-1,0,1,2,3}; |
| 21 |
vector bool short vbs = {0,65535,65535,0,0,0,65535,0}; |
| 22 |
|
| 23 |
/* Result vectors. */ |
| 24 |
vector signed short vsch, vscl; |
| 25 |
vector bool short vbsh, vbsl; |
| 26 |
vector unsigned int vuih, vuil; |
| 27 |
vector signed int vsih, vsil; |
| 28 |
vector bool int vbih, vbil; |
| 29 |
|
| 30 |
/* Expected result vectors. */ |
| 31 |
vector signed short vschr = {-8,-7,-6,-5,-4,-3,-2,-1}; |
| 32 |
vector signed short vsclr = {0,1,2,3,4,5,6,7}; |
| 33 |
vector bool short vbshr = {0,65535,65535,0,0,0,65535,0}; |
| 34 |
vector bool short vbslr = {65535,0,0,65535,65535,65535,0,65535}; |
| 35 |
vector unsigned int vuihr = {(0<<24) + (1<<16) + (2<<8) + 3, |
| 36 |
(65535<<24) + (4<<16) + (5<<8) + 6, |
| 37 |
(0<<24) + (7<<16) + (8<<8) + 9, |
| 38 |
(65535<<24) + (10<<16) + (11<<8) + 12}; |
| 39 |
vector unsigned int vuilr = {(65535<<24) + (13<<16) + (14<<8) + 15, |
| 40 |
(0<<24) + (16<<16) + (17<<8) + 18, |
| 41 |
(65535<<24) + (19<<16) + (20<<8) + 21, |
| 42 |
(0<<24) + (22<<16) + (23<<8) + 24}; |
| 43 |
vector signed int vsihr = {-4,-3,-2,-1}; |
| 44 |
vector signed int vsilr = {0,1,2,3}; |
| 45 |
vector bool int vbihr = {0,BIG,BIG,0}; |
| 46 |
vector bool int vbilr = {0,0,BIG,0}; |
| 47 |
|
| 48 |
vsch = vec_unpackh (vsc); |
| 49 |
vscl = vec_unpackl (vsc); |
| 50 |
vbsh = vec_unpackh (vbc); |
| 51 |
vbsl = vec_unpackl (vbc); |
| 52 |
vuih = vec_unpackh (vp); |
| 53 |
vuil = vec_unpackl (vp); |
| 54 |
vsih = vec_unpackh (vss); |
| 55 |
vsil = vec_unpackl (vss); |
| 56 |
vbih = vec_unpackh (vbs); |
| 57 |
vbil = vec_unpackl (vbs); |
| 58 |
|
| 59 |
check (vec_all_eq (vsch, vschr), "vsch"); |
| 60 |
check (vec_all_eq (vscl, vsclr), "vscl"); |
| 61 |
check (vec_all_eq (vbsh, vbshr), "vbsh"); |
| 62 |
check (vec_all_eq (vbsl, vbslr), "vbsl"); |
| 63 |
check (vec_all_eq (vuih, vuihr), "vuih"); |
| 64 |
check (vec_all_eq (vuil, vuilr), "vuil"); |
| 65 |
check (vec_all_eq (vsih, vsihr), "vsih"); |
| 66 |
check (vec_all_eq (vsil, vsilr), "vsil"); |
| 67 |
check (vec_all_eq (vbih, vbihr), "vbih"); |
| 68 |
check (vec_all_eq (vbil, vbilr), "vbil"); |
| 69 |
} |