• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test vector byte masks, v16i8 version.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
4
5; Test an all-zeros vector.
6define <16 x i8> @f1() {
7; CHECK-LABEL: f1:
8; CHECK: vgbm %v24, 0
9; CHECK: br %r14
10  ret <16 x i8> zeroinitializer
11}
12
13; Test an all-ones vector.
14define <16 x i8> @f2() {
15; CHECK-LABEL: f2:
16; CHECK: vgbm %v24, 65535
17; CHECK: br %r14
18  ret <16 x i8> <i8 -1, i8 -1, i8 -1, i8 -1,
19                 i8 -1, i8 -1, i8 -1, i8 -1,
20                 i8 -1, i8 -1, i8 -1, i8 -1,
21                 i8 -1, i8 -1, i8 -1, i8 -1>
22}
23
24; Test a mixed vector (mask 0x8c75).
25define <16 x i8> @f3() {
26; CHECK-LABEL: f3:
27; CHECK: vgbm %v24, 35957
28; CHECK: br %r14
29  ret <16 x i8> <i8 -1, i8 0, i8 0, i8 0,
30                 i8 -1, i8 -1, i8 0, i8 0,
31                 i8 0, i8 -1, i8 -1, i8 -1,
32                 i8 0, i8 -1, i8 0, i8 -1>
33}
34
35; Test that undefs are treated as zero.
36define <16 x i8> @f4() {
37; CHECK-LABEL: f4:
38; CHECK: vgbm %v24, 35957
39; CHECK: br %r14
40  ret <16 x i8> <i8 -1, i8 undef, i8 undef, i8 undef,
41                 i8 -1, i8 -1, i8 undef, i8 undef,
42                 i8 undef, i8 -1, i8 -1, i8 -1,
43                 i8 undef, i8 -1, i8 undef, i8 -1>
44}
45
46; Test that we don't use VGBM if one of the bytes is not 0 or 0xff.
47define <16 x i8> @f5() {
48; CHECK-LABEL: f5:
49; CHECK-NOT: vgbm
50; CHECK: br %r14
51  ret <16 x i8> <i8 -1, i8 0, i8 0, i8 0,
52                 i8 -1, i8 -1, i8 0, i8 1,
53                 i8 0, i8 -1, i8 -1, i8 -1,
54                 i8 0, i8 -1, i8 0, i8 -1>
55}
56
57; Test an all-zeros v2i8 that gets promoted to v16i8.
58define <2 x i8> @f6() {
59; CHECK-LABEL: f6:
60; CHECK: vgbm %v24, 0
61; CHECK: br %r14
62  ret <2 x i8> zeroinitializer
63}
64
65; Test a mixed v2i8 that gets promoted to v16i8 (mask 0x8000).
66define <2 x i8> @f7() {
67; CHECK-LABEL: f7:
68; CHECK: vgbm %v24, 32768
69; CHECK: br %r14
70  ret <2 x i8> <i8 255, i8 0>
71}
72
73; Test an all-zeros v4i8 that gets promoted to v16i8.
74define <4 x i8> @f8() {
75; CHECK-LABEL: f8:
76; CHECK: vgbm %v24, 0
77; CHECK: br %r14
78  ret <4 x i8> zeroinitializer
79}
80
81; Test a mixed v4i8 that gets promoted to v16i8 (mask 0x9000).
82define <4 x i8> @f9() {
83; CHECK-LABEL: f9:
84; CHECK: vgbm %v24, 36864
85; CHECK: br %r14
86  ret <4 x i8> <i8 255, i8 0, i8 0, i8 255>
87}
88
89; Test an all-zeros v8i8 that gets promoted to v16i8.
90define <8 x i8> @f10() {
91; CHECK-LABEL: f10:
92; CHECK: vgbm %v24, 0
93; CHECK: br %r14
94  ret <8 x i8> zeroinitializer
95}
96
97; Test a mixed v8i8 that gets promoted to v16i8 (mask 0xE500).
98define <8 x i8> @f11() {
99; CHECK-LABEL: f11:
100; CHECK: vgbm %v24, 58624
101; CHECK: br %r14
102  ret <8 x i8> <i8 255, i8 255, i8 255, i8 0, i8 0, i8 255, i8 0, i8 255>
103}
104