1 ; Test strict extensions of f32 to f64.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare double @llvm.experimental.constrained.fpext.f64.f32(float, metadata)
7 ; Check register extension.
8 define double @f1(float %val) {
10 ; CHECK: ldebr %f0, %f0
12 %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,
13 metadata !"fpexcept.strict")
17 ; Check the low end of the LDEB range.
18 define double @f2(float *%ptr) {
20 ; CHECK: ldeb %f0, 0(%r2)
22 %val = load float, float *%ptr
23 %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,
24 metadata !"fpexcept.strict")
28 ; Check the high end of the aligned LDEB range.
29 define double @f3(float *%base) {
31 ; CHECK: ldeb %f0, 4092(%r2)
33 %ptr = getelementptr float, float *%base, i64 1023
34 %val = load float, float *%ptr
35 %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,
36 metadata !"fpexcept.strict")
40 ; Check the next word up, which needs separate address logic.
41 ; Other sequences besides this one would be OK.
42 define double @f4(float *%base) {
44 ; CHECK: aghi %r2, 4096
45 ; CHECK: ldeb %f0, 0(%r2)
47 %ptr = getelementptr float, float *%base, i64 1024
48 %val = load float, float *%ptr
49 %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,
50 metadata !"fpexcept.strict")
54 ; Check negative displacements, which also need separate address logic.
55 define double @f5(float *%base) {
58 ; CHECK: ldeb %f0, 0(%r2)
60 %ptr = getelementptr float, float *%base, i64 -1
61 %val = load float, float *%ptr
62 %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,
63 metadata !"fpexcept.strict")
67 ; Check that LDEB allows indices.
68 define double @f6(float *%base, i64 %index) {
70 ; CHECK: sllg %r1, %r3, 2
71 ; CHECK: ldeb %f0, 400(%r1,%r2)
73 %ptr1 = getelementptr float, float *%base, i64 %index
74 %ptr2 = getelementptr float, float *%ptr1, i64 100
75 %val = load float, float *%ptr2
76 %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,
77 metadata !"fpexcept.strict")