1 ; Test vector replicates that use VECTOR GENERATE MASK, v8i16 version.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; Test a word-granularity replicate with the lowest value that cannot use
7 define <8 x i16> @f1() {
9 ; CHECK: vgmf %v24, 16, 16
11 ret <8 x i16> <i16 0, i16 32768, i16 0, i16 32768,
12 i16 0, i16 32768, i16 0, i16 32768>
15 ; Test a word-granularity replicate that has the lower 17 bits set.
16 define <8 x i16> @f2() {
18 ; CHECK: vgmf %v24, 15, 31
20 ret <8 x i16> <i16 1, i16 -1, i16 1, i16 -1,
21 i16 1, i16 -1, i16 1, i16 -1>
24 ; Test a word-granularity replicate that has the upper 15 bits set.
25 define <8 x i16> @f3() {
27 ; CHECK: vgmf %v24, 0, 14
29 ret <8 x i16> <i16 -2, i16 0, i16 -2, i16 0,
30 i16 -2, i16 0, i16 -2, i16 0>
33 ; Test a word-granularity replicate that has middle bits set.
34 define <8 x i16> @f4() {
36 ; CHECK: vgmf %v24, 12, 17
38 ret <8 x i16> <i16 15, i16 49152, i16 15, i16 49152,
39 i16 15, i16 49152, i16 15, i16 49152>
42 ; Test a word-granularity replicate with a wrap-around mask.
43 define <8 x i16> @f5() {
45 ; CHECK: vgmf %v24, 17, 15
47 ret <8 x i16> <i16 -1, i16 32767, i16 -1, i16 32767,
48 i16 -1, i16 32767, i16 -1, i16 32767>
51 ; Test a doubleword-granularity replicate with the lowest value that cannot
53 define <8 x i16> @f6() {
55 ; CHECK: vgmg %v24, 48, 48
57 ret <8 x i16> <i16 0, i16 0, i16 0, i16 32768,
58 i16 0, i16 0, i16 0, i16 32768>
61 ; Test a doubleword-granularity replicate that has the lower 22 bits set.
62 define <8 x i16> @f7() {
64 ; CHECK: vgmg %v24, 42, 63
66 ret <8 x i16> <i16 0, i16 0, i16 63, i16 -1,
67 i16 0, i16 0, i16 63, i16 -1>
70 ; Test a doubleword-granularity replicate that has the upper 45 bits set.
71 define <8 x i16> @f8() {
73 ; CHECK: vgmg %v24, 0, 44
75 ret <8 x i16> <i16 -1, i16 -1, i16 -8, i16 0,
76 i16 -1, i16 -1, i16 -8, i16 0>
79 ; Test a doubleword-granularity replicate that has middle bits set.
80 define <8 x i16> @f9() {
82 ; CHECK: vgmg %v24, 31, 42
84 ret <8 x i16> <i16 0, i16 1, i16 -32, i16 0,
85 i16 0, i16 1, i16 -32, i16 0>
88 ; Test a doubleword-granularity replicate with a wrap-around mask.
89 define <8 x i16> @f10() {
91 ; CHECK: vgmg %v24, 18, 0
93 ret <8 x i16> <i16 32768, i16 16383, i16 -1, i16 -1,
94 i16 32768, i16 16383, i16 -1, i16 -1>
97 ; Retest f1 with arbitrary undefs instead of 0s.
98 define <8 x i16> @f11() {
100 ; CHECK: vgmf %v24, 16, 16
102 ret <8 x i16> <i16 undef, i16 32768, i16 0, i16 32768,
103 i16 0, i16 32768, i16 undef, i16 32768>
107 define <8 x i16> @f12() {
109 ; CHECK: vgmg %v24, 31, 42
111 ret <8 x i16> <i16 undef, i16 1, i16 -32, i16 0,
112 i16 0, i16 1, i16 -32, i16 undef>