1 ; Test vector byte masks, v16i8 version.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; Test an all-zeros vector.
6 define <16 x i8> @f1() {
10 ret <16 x i8> zeroinitializer
13 ; Test an all-ones vector.
14 define <16 x i8> @f2() {
16 ; CHECK: vgbm %v24, 65535
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>
24 ; Test a mixed vector (mask 0x8c75).
25 define <16 x i8> @f3() {
27 ; CHECK: vgbm %v24, 35957
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>
35 ; Test that undefs are treated as zero.
36 define <16 x i8> @f4() {
38 ; CHECK: vgbm %v24, 35957
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>
46 ; Test that we don't use VGBM if one of the bytes is not 0 or 0xff.
47 define <16 x i8> @f5() {
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>
57 ; Test an all-zeros v2i8 that gets promoted to v16i8.
58 define <2 x i8> @f6() {
62 ret <2 x i8> zeroinitializer
65 ; Test a mixed v2i8 that gets promoted to v16i8 (mask 0x8000).
66 define <2 x i8> @f7() {
68 ; CHECK: vgbm %v24, 32768
70 ret <2 x i8> <i8 255, i8 0>
73 ; Test an all-zeros v4i8 that gets promoted to v16i8.
74 define <4 x i8> @f8() {
78 ret <4 x i8> zeroinitializer
81 ; Test a mixed v4i8 that gets promoted to v16i8 (mask 0x9000).
82 define <4 x i8> @f9() {
84 ; CHECK: vgbm %v24, 36864
86 ret <4 x i8> <i8 255, i8 0, i8 0, i8 255>
89 ; Test an all-zeros v8i8 that gets promoted to v16i8.
90 define <8 x i8> @f10() {
94 ret <8 x i8> zeroinitializer
97 ; Test a mixed v8i8 that gets promoted to v16i8 (mask 0xE500).
98 define <8 x i8> @f11() {
100 ; CHECK: vgbm %v24, 58624
102 ret <8 x i8> <i8 255, i8 255, i8 255, i8 0, i8 0, i8 255, i8 0, i8 255>