OSDN Git Service

Merge tree-ssa-20020619-branch into mainline.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / altivec-11.c
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-options "-O2 -maltivec -mabi=altivec" } */
3 /* { dg-final { scan-assembler-not "lvx" } } */
4 #include <altivec.h>
5
6 void foo (vector int);
7 void foo_s (vector short);
8 void foo_c (vector char);
9
10 /* All constants should be loaded into vector register without
11    load from memory.  */
12 void
13 bar (void) 
14 {
15   foo ((vector int) {0, 0, 0, 0});
16   foo ((vector int) {1, 1, 1, 1});
17   foo ((vector int) {15, 15, 15, 15});
18   foo ((vector int) {-16, -16, -16, -16});
19   foo ((vector int) {0x10001, 0x10001, 0x10001, 0x10001});
20   foo ((vector int) {0xf000f, 0xf000f, 0xf000f, 0xf000f});
21   foo ((vector int) {0xfff0fff0, 0xfff0fff0, 0xfff0fff0, 0xfff0fff0});
22   foo ((vector int) {0x1010101, 0x1010101, 0x1010101, 0x1010101});  
23   foo ((vector int) {0xf0f0f0f, 0xf0f0f0f, 0xf0f0f0f, 0xf0f0f0f});  
24   foo ((vector int) {0xf0f0f0f0, 0xf0f0f0f0, 0xf0f0f0f0, 0xf0f0f0f0});
25   foo ((vector int) {0x10101010, 0x10101010, 0x10101010, 0x10101010});
26   foo ((vector int) {0x1e1e1e1e, 0x1e1e1e1e, 0x1e1e1e1e, 0x1e1e1e1e});
27   foo ((vector int) {0x100010, 0x100010, 0x100010, 0x100010});
28   foo ((vector int) {0x1e001e, 0x1e001e, 0x1e001e, 0x1e001e});
29   foo ((vector int) {0x10, 0x10, 0x10, 0x10});
30   foo ((vector int) {0x1e, 0x1e, 0x1e, 0x1e});
31
32   foo_s ((vector short int) {0, 0, 0, 0, 0, 0, 0, 0});
33   foo_s ((vector short int) {1, 1, 1, 1, 1, 1, 1, 1});
34   foo_s ((vector short int) {15, 15, 15, 15, 15, 15, 15, 15});
35   foo_s ((vector short int) {-16, -16, -16, -16, -16, -16, -16, -16});
36   foo_s ((vector short int) {0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0, 
37                                0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0});
38   foo_s ((vector short int) {0xf0f, 0xf0f, 0xf0f, 0xf0f, 
39                                0xf0f, 0xf0f, 0xf0f, 0xf0f});
40   foo_s ((vector short int) {0x1010, 0x1010, 0x1010, 0x1010, 
41                                0x1010, 0x1010, 0x1010, 0x1010});
42   foo_s ((vector short int) {0x1e1e, 0x1e1e, 0x1e1e, 0x1e1e, 
43                                0x1e1e, 0x1e1e, 0x1e1e, 0x1e1e});
44
45   foo_c ((vector char) {0, 0, 0, 0, 0, 0, 0, 0,
46                           0, 0, 0, 0, 0, 0, 0, 0});
47   foo_c ((vector char) {1, 1, 1, 1, 1, 1, 1, 1, 
48                           1, 1, 1, 1, 1, 1, 1, 1});
49   foo_c ((vector char) {15, 15, 15, 15, 15, 15, 15, 15,
50                           15, 15, 15, 15, 15, 15, 15, 15});
51   foo_c ((vector char) {-16, -16, -16, -16, -16, -16, -16, -16,
52                           -16, -16, -16, -16, -16, -16, -16, -16});
53   foo_c ((vector char) {16, 16, 16, 16, 16, 16, 16, 16,
54                           16, 16, 16, 16, 16, 16, 16, 16});
55   foo_c ((vector char) {30, 30, 30, 30, 30, 30, 30, 30,
56                           30, 30, 30, 30, 30, 30, 30, 30});
57
58 }