1 ; Test multiplication of two f32s, producing an f32 result.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
7 ; Check register multiplication.
8 define float @f1(float %f1, float %f2) {
10 ; CHECK: meebr %f0, %f2
12 %res = fmul float %f1, %f2
16 ; Check the low end of the MEEB range.
17 define float @f2(float %f1, float *%ptr) {
19 ; CHECK: meeb %f0, 0(%r2)
21 %f2 = load float *%ptr
22 %res = fmul float %f1, %f2
26 ; Check the high end of the aligned MEEB range.
27 define float @f3(float %f1, float *%base) {
29 ; CHECK: meeb %f0, 4092(%r2)
31 %ptr = getelementptr float *%base, i64 1023
32 %f2 = load float *%ptr
33 %res = fmul float %f1, %f2
37 ; Check the next word up, which needs separate address logic.
38 ; Other sequences besides this one would be OK.
39 define float @f4(float %f1, float *%base) {
41 ; CHECK: aghi %r2, 4096
42 ; CHECK: meeb %f0, 0(%r2)
44 %ptr = getelementptr float *%base, i64 1024
45 %f2 = load float *%ptr
46 %res = fmul float %f1, %f2
50 ; Check negative displacements, which also need separate address logic.
51 define float @f5(float %f1, float *%base) {
54 ; CHECK: meeb %f0, 0(%r2)
56 %ptr = getelementptr float *%base, i64 -1
57 %f2 = load float *%ptr
58 %res = fmul float %f1, %f2
62 ; Check that MEEB allows indices.
63 define float @f6(float %f1, float *%base, i64 %index) {
65 ; CHECK: sllg %r1, %r3, 2
66 ; CHECK: meeb %f0, 400(%r1,%r2)
68 %ptr1 = getelementptr float *%base, i64 %index
69 %ptr2 = getelementptr float *%ptr1, i64 100
70 %f2 = load float *%ptr2
71 %res = fmul float %f1, %f2
75 ; Check that multiplications of spilled values can use MEEB rather than MEEBR.
76 define float @f7(float *%ptr0) {
78 ; CHECK: brasl %r14, foo@PLT
79 ; CHECK: meeb %f0, 16{{[04]}}(%r15)
81 %ptr1 = getelementptr float *%ptr0, i64 2
82 %ptr2 = getelementptr float *%ptr0, i64 4
83 %ptr3 = getelementptr float *%ptr0, i64 6
84 %ptr4 = getelementptr float *%ptr0, i64 8
85 %ptr5 = getelementptr float *%ptr0, i64 10
86 %ptr6 = getelementptr float *%ptr0, i64 12
87 %ptr7 = getelementptr float *%ptr0, i64 14
88 %ptr8 = getelementptr float *%ptr0, i64 16
89 %ptr9 = getelementptr float *%ptr0, i64 18
90 %ptr10 = getelementptr float *%ptr0, i64 20
92 %val0 = load float *%ptr0
93 %val1 = load float *%ptr1
94 %val2 = load float *%ptr2
95 %val3 = load float *%ptr3
96 %val4 = load float *%ptr4
97 %val5 = load float *%ptr5
98 %val6 = load float *%ptr6
99 %val7 = load float *%ptr7
100 %val8 = load float *%ptr8
101 %val9 = load float *%ptr9
102 %val10 = load float *%ptr10
104 %ret = call float @foo()
106 %mul0 = fmul float %ret, %val0
107 %mul1 = fmul float %mul0, %val1
108 %mul2 = fmul float %mul1, %val2
109 %mul3 = fmul float %mul2, %val3
110 %mul4 = fmul float %mul3, %val4
111 %mul5 = fmul float %mul4, %val5
112 %mul6 = fmul float %mul5, %val6
113 %mul7 = fmul float %mul6, %val7
114 %mul8 = fmul float %mul7, %val8
115 %mul9 = fmul float %mul8, %val9
116 %mul10 = fmul float %mul9, %val10