2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sparc / fandnot.c
blob005486385fad5a9b6f314b7c575905173fe456ac
1 /* { dg-do compile } */
2 /* { dg-options "-O -mcpu=ultrasparc -mvis" } */
3 typedef char vec8 __attribute__((vector_size(8)));
4 typedef short vec16 __attribute__((vector_size(8)));
5 typedef int vec32 __attribute__((vector_size(8)));
7 extern vec8 foo1_8(void);
8 extern vec8 foo2_8(void);
10 vec8 fun8(void)
12 return ~foo1_8 () & foo2_8 ();
15 vec8 fun8_2(vec8 a, vec8 b)
17 return ~a & b;
20 extern vec16 foo1_16(void);
21 extern vec16 foo2_16(void);
23 vec16 fun16(void)
25 return ~foo1_16 () & foo2_16 ();
28 vec16 fun16_2(vec16 a, vec16 b)
30 return ~a & b;
33 extern vec32 foo1_32(void);
34 extern vec32 foo2_32(void);
36 vec32 fun32(void)
38 return ~foo1_32 () & foo2_32 ();
41 vec32 fun32_2(vec32 a, vec32 b)
43 return ~a & b;
47 /* This should be transformed into ~b & a. */
48 vec8 fun8b(void)
50 return foo1_8 () & ~foo2_8 ();
53 vec8 fun8_2b(vec8 a, vec8 b)
55 return a & ~b;
58 vec16 fun16b(void)
60 return foo1_16 () & ~foo2_16 ();
63 vec16 fun16_2b(vec16 a, vec16 b)
65 return a & ~b;
68 vec32 fun32b(void)
70 return foo1_32 () & ~foo2_32 ();
73 vec32 fun32_2b(vec32 a, vec32 b)
75 return a & ~b;
78 /* { dg-final { scan-assembler-times "fandnot1\t%" 12 } } */