blob: 55f3cdd59027a43a0e8140020989e6a46ca5b179 [file] [log] [blame]
Ulrich Weigand80b3af72015-05-05 19:27:45 +00001; Test vector byte masks, v4f32 version.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
4
5; Test an all-zeros vector.
6define <4 x float> @f1() {
7; CHECK-LABEL: f1:
8; CHECK: vgbm %v24, 0
9; CHECK: br %r14
10 ret <4 x float> zeroinitializer
11}
12
13; Test an all-ones vector.
14define <4 x float> @f2() {
15; CHECK-LABEL: f2:
16; CHECK: vgbm %v24, 65535
17; CHECK: br %r14
18 ret <4 x float> <float 0xffffffffe0000000, float 0xffffffffe0000000,
19 float 0xffffffffe0000000, float 0xffffffffe0000000>
20}
21
22; Test a mixed vector (mask 0xc731).
23define <4 x float> @f3() {
24; CHECK-LABEL: f3:
25; CHECK: vgbm %v24, 50993
26; CHECK: br %r14
27 ret <4 x float> <float 0xffffe00000000000, float 0x381fffffe0000000,
28 float 0x379fffe000000000, float 0x371fe00000000000>
29}
30
31; Test that undefs are treated as zero (mask 0xc031).
32define <4 x float> @f4() {
33; CHECK-LABEL: f4:
34; CHECK: vgbm %v24, 49201
35; CHECK: br %r14
36 ret <4 x float> <float 0xffffe00000000000, float undef,
37 float 0x379fffe000000000, float 0x371fe00000000000>
38}
39
40; Test that we don't use VGBM if one of the bytes is not 0 or 0xff.
41define <4 x float> @f5() {
42; CHECK-LABEL: f5:
43; CHECK-NOT: vgbm
44; CHECK: br %r14
45 ret <4 x float> <float 0xffffe00000000000, float 0x381fffffc0000000,
46 float 0x379fffe000000000, float 0x371fe00000000000>
47}
Ulrich Weigandcd2a1b52015-05-05 19:29:21 +000048
49; Test an all-zeros v2f32 that gets promoted to v4f32.
50define <2 x float> @f6() {
51; CHECK-LABEL: f6:
52; CHECK: vgbm %v24, 0
53; CHECK: br %r14
54 ret <2 x float> zeroinitializer
55}
56
57; Test a mixed v2f32 that gets promoted to v4f32 (mask 0xc700).
58define <2 x float> @f7() {
59; CHECK-LABEL: f7:
60; CHECK: vgbm %v24, 50944
61; CHECK: br %r14
62 ret <2 x float> <float 0xffffe00000000000, float 0x381fffffe0000000>
63}