2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-cmp.c
blobaee659d031494fb997f554e0ca124dbd3e98e24c
1 /* { dg-do compile { target { powerpc64*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc64*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5 /* { dg-options "-O2 -mcpu=power8" } */
6 /* { dg-final { scan-assembler-times "vcmpgtsb" 2 } } */
7 /* { dg-final { scan-assembler-times "vcmpgtub" 2 } } */
8 /* { dg-final { scan-assembler-times "vcmpgtsh" 2 } } */
9 /* { dg-final { scan-assembler-times "vcmpgtuh" 2 } } */
10 /* { dg-final { scan-assembler-times "vcmpgtsw" 2 } } */
11 /* { dg-final { scan-assembler-times "vcmpgtuw" 2 } } */
12 /* { dg-final { scan-assembler-times "vcmpgtsd" 2 } } */
13 /* { dg-final { scan-assembler-times "vcmpgtud" 2 } } */
14 /* { dg-final { scan-assembler-times "xxlnor" 16 } } */
16 #include <altivec.h>
18 vector bool char
19 cmple_sc (vector signed char x, vector signed char y)
21 return vec_cmple (x, y);
24 vector bool char
25 cmple_uc (vector unsigned char x, vector unsigned char y)
27 return vec_cmple (x, y);
30 vector bool short
31 cmple_ss (vector signed short x, vector signed short y)
33 return vec_cmple (x, y);
36 vector bool short
37 cmple_us (vector unsigned short x, vector unsigned short y)
39 return vec_cmple (x, y);
42 vector bool int
43 cmple_si (vector signed int x, vector signed int y)
45 return vec_cmple (x, y);
48 vector bool int
49 cmple_ui (vector unsigned int x, vector unsigned int y)
51 return vec_cmple (x, y);
54 vector bool long long
55 cmple_sl (vector signed long long x, vector signed long long y)
57 return vec_cmple (x, y);
60 vector bool long long
61 cmple_ul (vector unsigned long long x, vector unsigned long long y)
63 return vec_cmple (x, y);
66 vector bool char
67 cmpge_sc (vector signed char x, vector signed char y)
69 return vec_cmpge (x, y);
72 vector bool char
73 cmpge_uc (vector unsigned char x, vector unsigned char y)
75 return vec_cmpge (x, y);
78 vector bool short
79 cmpge_ss (vector signed short x, vector signed short y)
81 return vec_cmpge (x, y);
84 vector bool short
85 cmpge_us (vector unsigned short x, vector unsigned short y)
87 return vec_cmpge (x, y);
90 vector bool int
91 cmpge_si (vector signed int x, vector signed int y)
93 return vec_cmpge (x, y);
96 vector bool int
97 cmpge_ui (vector unsigned int x, vector unsigned int y)
99 return vec_cmpge (x, y);
102 vector bool long long
103 cmpge_sl (vector signed long long x, vector signed long long y)
105 return vec_cmpge (x, y);
108 vector bool long long
109 cmpge_ul (vector unsigned long long x, vector unsigned long long y)
111 return vec_cmpge (x, y);