152
|
1 /* { dg-do run } */
|
|
2 /* { dg-require-effective-target powerpc_future_hw } */
|
|
3 /* { dg-require-effective-target lp64 } */
|
|
4 /* { dg-options "-mdejagnu-cpu=future" } */
|
|
5
|
|
6 extern void abort (void);
|
|
7
|
|
8 unsigned long long int
|
|
9 do_pdepd (unsigned long long int source, unsigned long long int mask) {
|
|
10 return __builtin_pdepd (source, mask);
|
|
11 }
|
|
12
|
|
13 int main (int argc, char *argv [])
|
|
14 {
|
|
15 unsigned long long int sources [4], masks [4];
|
|
16 unsigned long long int results [4][4] = {
|
|
17 /* sources [0] with each of masks [0..3] */
|
|
18 { 0x7e3c0000ll, 0x00007e3cll, 0x070e030cll, 0x70e030c0ll },
|
|
19 /* sources [1] with each of masks [0..3] */
|
|
20 { 0xa5f00000ll, 0x0000a5f0ll, 0x0a050f00ll, 0xa050f000ll },
|
|
21 /* sources [2] with each of masks [0..3] */
|
|
22 { 0xf07e0000ll, 0x0000f07ell, 0x0f00070ell, 0xf00070e0ll },
|
|
23 /* sources [3] with each of masks [0..3] */
|
|
24 { 0xe7c30000ll, 0x0000e7c3ll, 0x0e070c03ll, 0xe070c030ll },
|
|
25 };
|
|
26
|
|
27 sources[0] = 0xa5f07e3cll;
|
|
28 sources[1] = 0x7e3ca5f0ll;
|
|
29 sources[2] = 0x3ca5f07ell;
|
|
30 sources[3] = 0x5a0fe7c3ll;
|
|
31
|
|
32 masks[0] = 0xffff0000ll;
|
|
33 masks[1] = 0x0000ffffll;
|
|
34 masks[2] = 0x0f0f0f0fll;
|
|
35 masks[3] = 0xf0f0f0f0ll;
|
|
36
|
|
37 for (int i = 0; i < 4; i++)
|
|
38 {
|
|
39 for (int j = 0; j < 4; j++)
|
|
40 {
|
|
41 if (do_pdepd (sources[i], masks[j]) != results [i][j])
|
|
42 abort ();
|
|
43 }
|
|
44 }
|
|
45
|
|
46 return 0;
|
|
47 }
|
|
48
|