1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 ; Test extensions of f32 to f64.
9 ; Check register extension.
10 define double @f1(float %val) {
13 ; CHECK-NEXT: ldebr %f0, %f0
15 %res = fpext float %val to double
19 ; Check the low end of the LDEB range.
20 define double @f2(float *%ptr) {
23 ; CHECK-NEXT: ldeb %f0, 0(%r2)
25 %val = load float, float *%ptr
26 %res = fpext float %val to double
30 ; Check the high end of the aligned LDEB range.
31 define double @f3(float *%base) {
34 ; CHECK-NEXT: ldeb %f0, 4092(%r2)
36 %ptr = getelementptr float, float *%base, i64 1023
37 %val = load float, float *%ptr
38 %res = fpext float %val to double
42 ; Check the next word up, which needs separate address logic.
43 ; Other sequences besides this one would be OK.
44 define double @f4(float *%base) {
47 ; CHECK-NEXT: aghi %r2, 4096
48 ; CHECK-NEXT: ldeb %f0, 0(%r2)
50 %ptr = getelementptr float, float *%base, i64 1024
51 %val = load float, float *%ptr
52 %res = fpext float %val to double
56 ; Check negative displacements, which also need separate address logic.
57 define double @f5(float *%base) {
60 ; CHECK-NEXT: aghi %r2, -4
61 ; CHECK-NEXT: ldeb %f0, 0(%r2)
63 %ptr = getelementptr float, float *%base, i64 -1
64 %val = load float, float *%ptr
65 %res = fpext float %val to double
69 ; Check that LDEB allows indices.
70 define double @f6(float *%base, i64 %index) {
73 ; CHECK-NEXT: sllg %r1, %r3, 2
74 ; CHECK-NEXT: ldeb %f0, 400(%r1,%r2)
76 %ptr1 = getelementptr float, float *%base, i64 %index
77 %ptr2 = getelementptr float, float *%ptr1, i64 100
78 %val = load float, float *%ptr2
79 %res = fpext float %val to double