1 ; RUN: llc < %s -mtriple=s390x-linux-gnu \
2 ; RUN: | FileCheck %s --check-prefixes=CHECK,DEFAULT
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=soft-float \
4 ; RUN: | FileCheck %s --check-prefixes=CHECK,SOFT-FLOAT
5 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=-soft-float \
6 ; RUN: | FileCheck %s --check-prefixes=CHECK,NO-SOFT-FL
7 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mattr=-vector \
8 ; RUN: | FileCheck %s --check-prefixes=CHECK,NO-VECTOR
10 ; Test per function attributes and command line arguments that override them.
12 attributes #1 = { "target-cpu"="z14" "target-features"="+vector" "use-soft-float"="false" }
13 define double @fun1(ptr %A) #1 {
15 ; DEFAULT: ld %f0, 0(%r2)
16 ; SOFT-FLOAT: lg %r2, 0(%r2)
17 ; NO-SOFT-FL: ld %f0, 0(%r2)
18 ; NO-VECTOR: ld %f0, 0(%r2)
21 %0 = load double, ptr %A
25 attributes #2 = { "target-cpu"="z14" "target-features"="+vector" "use-soft-float"="true" }
26 define double @fun2(ptr %A) #2 {
28 ; DEFAULT: lg %r2, 0(%r2)
29 ; SOFT-FLOAT: lg %r2, 0(%r2)
30 ; NO-SOFT-FL: lg %r2, 0(%r2)
31 ; NO-VECTOR: lg %r2, 0(%r2)
34 %0 = load double, ptr %A
38 attributes #3 = { "target-cpu"="z14" "target-features"="+vector" "use-soft-float"="false" }
39 define <2 x double> @fun3(ptr %A) #3 {
41 ; DEFAULT: vl %v24, 0(%r2), 3
42 ; SOFT-FLOAT: lg %r0, 0(%r2)
43 ; SOFT-FLOAT-NEXT: lg %r3, 8(%r2)
44 ; SOFT-FLOAT-NEXT: lgr %r2, %r0
45 ; NO-SOFT-FL: vl %v24, 0(%r2), 3
46 ; NO-VECTOR: ld %f0, 0(%r2)
47 ; NO-VECTOR-NEXT: ld %f2, 8(%r2)
50 %0 = load <2 x double>, ptr %A
54 attributes #4 = { "target-cpu"="z14" "target-features"="+vector" "use-soft-float"="true" }
55 define <2 x double> @fun4(ptr %A) #4 {
57 ; DEFAULT: lg %r0, 0(%r2)
58 ; DEFAULT-NEXT: lg %r3, 8(%r2)
59 ; DEFAULT-NEXT: lgr %r2, %r0
60 ; SOFT-FLOAT: lg %r0, 0(%r2)
61 ; SOFT-FLOAT-NEXT: lg %r3, 8(%r2)
62 ; SOFT-FLOAT-NEXT: lgr %r2, %r0
63 ; NO-SOFT-FL: lg %r0, 0(%r2)
64 ; NO-SOFT-FL-NEXT: lg %r3, 8(%r2)
65 ; NO-SOFT-FL-NEXT: lgr %r2, %r0
66 ; NO-VECTOR: lg %r0, 0(%r2)
67 ; NO-VECTOR-NEXT: lg %r3, 8(%r2)
68 ; NO-VECTOR-NEXT: lgr %r2, %r0
71 %0 = load <2 x double>, ptr %A
75 attributes #5 = { "target-cpu"="z14" "target-features"="-vector" "use-soft-float"="false" }
76 define <2 x double> @fun5(ptr %A) #5 {
78 ; DEFAULT: ld %f0, 0(%r2)
79 ; DEFAULT-NEXT: ld %f2, 8(%r2)
80 ; SOFT-FLOAT: lg %r0, 0(%r2)
81 ; SOFT-FLOAT-NEXT: lg %r3, 8(%r2)
82 ; SOFT-FLOAT-NEXT: lgr %r2, %r0
83 ; NO-SOFT-FL: ld %f0, 0(%r2)
84 ; NO-SOFT-FL-NEXT: ld %f2, 8(%r2)
85 ; NO-VECTOR: ld %f0, 0(%r2)
86 ; NO-VECTOR-NEXT: ld %f2, 8(%r2)
89 %0 = load <2 x double>, ptr %A
93 attributes #6 = { "target-cpu"="zEC12" "use-soft-float"="false" }
94 define <2 x double> @fun6(ptr %A) #6 {
96 ; DEFAULT: ld %f0, 0(%r2)
97 ; DEFAULT-NEXT: ld %f2, 8(%r2)
98 ; SOFT-FLOAT: lg %r0, 0(%r2)
99 ; SOFT-FLOAT-NEXT: lg %r3, 8(%r2)
100 ; SOFT-FLOAT-NEXT: lgr %r2, %r0
101 ; NO-SOFT-FL: ld %f0, 0(%r2)
102 ; NO-SOFT-FL-NEXT: ld %f2, 8(%r2)
103 ; NO-VECTOR: ld %f0, 0(%r2)
104 ; NO-VECTOR-NEXT: ld %f2, 8(%r2)
105 ; CHECK-NEXT: br %r14
107 %0 = load <2 x double>, ptr %A
111 attributes #7 = { "target-cpu"="zEC12" "target-features"="+vector" "use-soft-float"="false" }
112 define <2 x double> @fun7(ptr %A) #7 {
114 ; DEFAULT: vl %v24, 0(%r2), 3
115 ; SOFT-FLOAT: lg %r0, 0(%r2)
116 ; SOFT-FLOAT-NEXT: lg %r3, 8(%r2)
117 ; SOFT-FLOAT-NEXT: lgr %r2, %r0
118 ; NO-SOFT-FL: vl %v24, 0(%r2), 3
119 ; NO-VECTOR: ld %f0, 0(%r2)
120 ; NO-VECTOR-NEXT: ld %f2, 8(%r2)
121 ; CHECK-NEXT: br %r14
123 %0 = load <2 x double>, ptr %A