1 ; Test extensions of f32 to f64.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 \
4 ; RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK-SCALAR %s
5 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
7 ; Check register extension.
8 define double @f1(float %val) {
10 ; CHECK: ldebr %f0, %f0
12 %res = fpext float %val to double
16 ; Check the low end of the LDEB range.
17 define double @f2(float *%ptr) {
19 ; CHECK: ldeb %f0, 0(%r2)
21 %val = load float, float *%ptr
22 %res = fpext float %val to double
26 ; Check the high end of the aligned LDEB range.
27 define double @f3(float *%base) {
29 ; CHECK: ldeb %f0, 4092(%r2)
31 %ptr = getelementptr float, float *%base, i64 1023
32 %val = load float, float *%ptr
33 %res = fpext float %val to double
37 ; Check the next word up, which needs separate address logic.
38 ; Other sequences besides this one would be OK.
39 define double @f4(float *%base) {
41 ; CHECK: aghi %r2, 4096
42 ; CHECK: ldeb %f0, 0(%r2)
44 %ptr = getelementptr float, float *%base, i64 1024
45 %val = load float, float *%ptr
46 %res = fpext float %val to double
50 ; Check negative displacements, which also need separate address logic.
51 define double @f5(float *%base) {
54 ; CHECK: ldeb %f0, 0(%r2)
56 %ptr = getelementptr float, float *%base, i64 -1
57 %val = load float, float *%ptr
58 %res = fpext float %val to double
62 ; Check that LDEB allows indices.
63 define double @f6(float *%base, i64 %index) {
65 ; CHECK: sllg %r1, %r3, 2
66 ; CHECK: ldeb %f0, 400(%r1,%r2)
68 %ptr1 = getelementptr float, float *%base, i64 %index
69 %ptr2 = getelementptr float, float *%ptr1, i64 100
70 %val = load float, float *%ptr2
71 %res = fpext float %val to double