Fix typo.
[oota-llvm.git] / test / CodeGen / SystemZ / vec-cttz-01.ll
1 ; Test vector count trailing zeros
2 ;
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
4
5 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8> %src, i1 %is_zero_undef)
6 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16> %src, i1 %is_zero_undef)
7 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32> %src, i1 %is_zero_undef)
8 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64> %src, i1 %is_zero_undef)
9
10 define <16 x i8> @f1(<16 x i8> %a) {
11 ; CHECK-LABEL: f1:
12 ; CHECK: vctzb %v24, %v24
13 ; CHECK: br    %r14
14
15   %res = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
16   ret <16 x i8> %res
17 }
18
19 define <16 x i8> @f2(<16 x i8> %a) {
20 ; CHECK-LABEL: f2:
21 ; CHECK: vctzb %v24, %v24
22 ; CHECK: br    %r14
23
24   %res = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
25   ret <16 x i8> %res
26 }
27
28 define <8 x i16> @f3(<8 x i16> %a) {
29 ; CHECK-LABEL: f3:
30 ; CHECK: vctzh %v24, %v24
31 ; CHECK: br    %r14
32
33   %res = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
34   ret <8 x i16> %res
35 }
36
37 define <8 x i16> @f4(<8 x i16> %a) {
38 ; CHECK-LABEL: f4:
39 ; CHECK: vctzh %v24, %v24
40 ; CHECK: br    %r14
41
42   %res = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
43   ret <8 x i16> %res
44 }
45
46 define <4 x i32> @f5(<4 x i32> %a) {
47 ; CHECK-LABEL: f5:
48 ; CHECK: vctzf %v24, %v24
49 ; CHECK: br    %r14
50
51   %res = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
52   ret <4 x i32> %res
53 }
54
55 define <4 x i32> @f6(<4 x i32> %a) {
56 ; CHECK-LABEL: f6:
57 ; CHECK: vctzf %v24, %v24
58 ; CHECK: br    %r14
59
60   %res = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
61   ret <4 x i32> %res
62 }
63
64 define <2 x i64> @f7(<2 x i64> %a) {
65 ; CHECK-LABEL: f7:
66 ; CHECK: vctzg %v24, %v24
67 ; CHECK: br    %r14
68
69   %res = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
70   ret <2 x i64> %res
71 }
72
73 define <2 x i64> @f8(<2 x i64> %a) {
74 ; CHECK-LABEL: f8:
75 ; CHECK: vctzg %v24, %v24
76 ; CHECK: br    %r14
77
78   %res = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
79   ret <2 x i64> %res
80 }
81