1 |
149 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-mcpu=ultrasparc -mvis -O1 -fdump-tree-final_cleanup" } */
|
3 |
|
|
|
4 |
|
|
typedef int vec32 __attribute__((vector_size(8)));
|
5 |
|
|
typedef short vec16 __attribute__((vector_size(8)));
|
6 |
|
|
typedef unsigned char vec8 __attribute__((vector_size(8)));
|
7 |
|
|
|
8 |
|
|
typedef unsigned char pixel __attribute__((vector_size(4)));
|
9 |
|
|
typedef short pixel16 __attribute__((vector_size(4)));
|
10 |
|
|
|
11 |
|
|
vec16 foo1 () {
|
12 |
|
|
pixel a = { (unsigned char)1, (unsigned char)2, (unsigned char)3, (unsigned char)4 };
|
13 |
|
|
vec16 b = { (short)1, (short)2, (short)3, (short)4 };
|
14 |
|
|
return __builtin_vis_fmul8x16 (a, b);
|
15 |
|
|
}
|
16 |
|
|
|
17 |
|
|
vec16 foo1_1 () {
|
18 |
|
|
pixel a = { (unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1 };
|
19 |
|
|
vec16 b = { (short)256, (short)512, (short)1024, (short)2048 };
|
20 |
|
|
return __builtin_vis_fmul8x16 (a, b);
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
vec16 foo1_2 () {
|
24 |
|
|
pixel a = { (unsigned char)255, (unsigned char)255, (unsigned char)255, (unsigned char)255 };
|
25 |
|
|
vec16 b = { (short)256, (short)512, (short)1024, (short)32767 };
|
26 |
|
|
return __builtin_vis_fmul8x16 (a, b);
|
27 |
|
|
}
|
28 |
|
|
/* { dg-final { scan-assembler-not "fmul8x16\t%" } } */
|
29 |
|
|
/* { dg-final { scan-tree-dump "{ 0, 0, 0, 0 }" "final_cleanup" } } */
|
30 |
|
|
/* { dg-final { scan-tree-dump "{ 1, 2, 4, 8 }" "final_cleanup" } } */
|
31 |
|
|
/* { dg-final { scan-tree-dump "{ 255, 510, 1020, 32639 }" "final_cleanup" } } */
|
32 |
|
|
|
33 |
|
|
vec16 foo2 () {
|
34 |
|
|
pixel a = { 1, 2, 3, 4 };
|
35 |
|
|
pixel16 b = { 256, 512 };
|
36 |
|
|
return __builtin_vis_fmul8x16au (a, b);
|
37 |
|
|
}
|
38 |
|
|
/* { dg-final { scan-assembler-not "fmul8x16au\t%" } } */
|
39 |
|
|
/* { dg-final { scan-tree-dump "{ 1, 2, 3, 4 }" "final_cleanup" } } */
|
40 |
|
|
|
41 |
|
|
vec16 foo3 () {
|
42 |
|
|
pixel a = { 1, 2, 3, 4 };
|
43 |
|
|
pixel16 b = { 256, 512 };
|
44 |
|
|
return __builtin_vis_fmul8x16al (a, b);
|
45 |
|
|
}
|
46 |
|
|
/* { dg-final { scan-assembler-not "fmul8x16al\t%" } } */
|
47 |
|
|
/* { dg-final { scan-tree-dump "{ 2, 4, 6, 8 }" "final_cleanup" } } */
|
48 |
|
|
/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
|