blob: 618ecedf5815e3ad4e9319bd0714e3e9519e3039 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
/* { dg-options "-mcpu=power9 -O2" } */
#include <altivec.h>
vector signed char
count_trailing_zeros_v16qi_1s (vector signed char a)
{
return vec_vctz (a);
}
vector signed char
count_trailing_zeros_v16qi_2s (vector signed char a)
{
return vec_vctzb (a);
}
vector unsigned char
count_trailing_zeros_v16qi_1u (vector unsigned char a)
{
return vec_vctz (a);
}
vector unsigned char
count_trailing_zeros_v16qi_2u (vector unsigned char a)
{
return vec_vctzb (a);
}
vector short
count_trailing_zeros_v8hi_1s (vector short a)
{
return vec_vctz (a);
}
vector short
count_trailing_zeros_v8hi_2s (vector short a)
{
return vec_vctzh (a);
}
vector unsigned short
count_trailing_zeros_v8hi_1u (vector unsigned short a)
{
return vec_vctz (a);
}
vector unsigned short
count_trailing_zeros_v8hi_2u (vector unsigned short a)
{
return vec_vctzh (a);
}
vector int
count_trailing_zeros_v4si_1s (vector int a)
{
return vec_vctz (a);
}
vector int
count_trailing_zeros_v4si_2s (vector int a)
{
return vec_vctzw (a);
}
vector unsigned int
count_trailing_zeros_v4si_1u (vector unsigned int a)
{
return vec_vctz (a);
}
vector unsigned int
count_trailing_zeros_v4si_2u (vector unsigned int a)
{
return vec_vctzw (a);
}
vector long long
count_trailing_zeros_v2di_1s (vector long long a)
{
return vec_vctz (a);
}
vector long long
count_trailing_zeros_v2di_2s (vector long long a)
{
return vec_vctzd (a);
}
vector unsigned long long
count_trailing_zeros_v2di_1u (vector unsigned long long a)
{
return vec_vctz (a);
}
vector unsigned long long
count_trailing_zeros_v2di_2u (vector unsigned long long a)
{
return vec_vctzd (a);
}
/* { dg-final { scan-assembler "vctzb" } } */
/* { dg-final { scan-assembler "vctzd" } } */
/* { dg-final { scan-assembler "vctzh" } } */
/* { dg-final { scan-assembler "vctzw" } } */
/* { dg-final { scan-assembler-not "cnttzd" } } */
/* { dg-final { scan-assembler-not "cnttzw" } } */
|