c4828335c4b62c05c230d931aad2bd479cd2f714
[oota-llvm.git] / test / CodeGen / SystemZ / vec-const-05.ll
1 ; 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.
6 define <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.
14 define <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).
23 define <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).
32 define <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.
41 define <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 }