1 ; Verify that a struct as generated by the frontend is correctly accessed in
2 ; both cases of enabling/disabling the vector facility.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu | \
5 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
6 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=generic | \
7 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
8 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | \
9 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
10 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | \
11 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
12 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=zEC12 | \
13 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
14 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | \
15 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-VECTOR %s
17 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=vector | \
18 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-VECTOR %s
19 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=+vector | \
20 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-VECTOR %s
21 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=-vector,vector | \
22 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-VECTOR %s
23 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=-vector,+vector | \
24 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-VECTOR %s
25 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=-vector | \
26 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
27 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=vector,-vector | \
28 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
29 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=+vector,-vector | \
30 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
32 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 -mattr=-vector | \
33 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
35 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 -mattr=+soft-float | \
36 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
37 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 \
38 ; RUN: -mattr=soft-float,-soft-float | \
39 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-VECTOR %s
40 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 \
41 ; RUN: -mattr=-soft-float,soft-float | \
42 ; RUN: FileCheck -check-prefixes=CHECK,CHECK-NOVECTOR %s
44 %struct.S_vx = type { i8, <2 x i64> }
45 %struct.S_novx = type { i8, [15 x i8], <2 x i64> }
47 define void @fun_vx(ptr %s) nounwind {
48 ; CHECK-LABEL: @fun_vx
50 ; CHECK-VECTOR: vl %v0, 8(%r2)
51 ; CHECK-VECTOR: vst %v0, 8(%r2), 3
53 ; CHECK-NOVECTOR-DAG: agsi 16(%r2), 1
54 ; CHECK-NOVECTOR-DAG: agsi 8(%r2), 1
55 %ptr = getelementptr %struct.S_vx, ptr %s, i64 0, i32 1
56 %vec = load <2 x i64>, ptr %ptr
57 %add = add <2 x i64> %vec, <i64 1, i64 1>
58 store <2 x i64> %add, ptr %ptr
62 define void @fun_novx(ptr %s) nounwind {
63 ; CHECK-LABEL: @fun_novx
65 ; CHECK-VECTOR: vl %v0, 16(%r2), 3
66 ; CHECK-VECTOR: vst %v0, 16(%r2), 3
68 ; CHECK-NOVECTOR-DAG: agsi 16(%r2), 1
69 ; CHECK-NOVECTOR-DAG: agsi 24(%r2), 1
70 %ptr = getelementptr %struct.S_novx, ptr %s, i64 0, i32 2
71 %vec = load <2 x i64>, ptr %ptr
72 %add = add <2 x i64> %vec, <i64 1, i64 1>
73 store <2 x i64> %add, ptr %ptr