1 ; Test strict extensions of f32 to f128.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare fp128 @llvm.experimental.constrained.fpext.f128.f32(float, metadata)
7 ; Check register extension.
8 define void @f1(fp128 *%dst, float %val) {
10 ; CHECK: lxebr %f0, %f0
11 ; CHECK: std %f0, 0(%r2)
12 ; CHECK: std %f2, 8(%r2)
14 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
15 metadata !"fpexcept.strict")
16 store fp128 %res, fp128 *%dst
20 ; Check the low end of the LXEB range.
21 define void @f2(fp128 *%dst, float *%ptr) {
23 ; CHECK: lxeb %f0, 0(%r3)
24 ; CHECK: std %f0, 0(%r2)
25 ; CHECK: std %f2, 8(%r2)
27 %val = load float, float *%ptr
28 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
29 metadata !"fpexcept.strict")
30 store fp128 %res, fp128 *%dst
34 ; Check the high end of the aligned LXEB range.
35 define void @f3(fp128 *%dst, float *%base) {
37 ; CHECK: lxeb %f0, 4092(%r3)
38 ; CHECK: std %f0, 0(%r2)
39 ; CHECK: std %f2, 8(%r2)
41 %ptr = getelementptr float, float *%base, i64 1023
42 %val = load float, float *%ptr
43 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
44 metadata !"fpexcept.strict")
45 store fp128 %res, fp128 *%dst
49 ; Check the next word up, which needs separate address logic.
50 ; Other sequences besides this one would be OK.
51 define void @f4(fp128 *%dst, float *%base) {
53 ; CHECK: aghi %r3, 4096
54 ; CHECK: lxeb %f0, 0(%r3)
55 ; CHECK: std %f0, 0(%r2)
56 ; CHECK: std %f2, 8(%r2)
58 %ptr = getelementptr float, float *%base, i64 1024
59 %val = load float, float *%ptr
60 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
61 metadata !"fpexcept.strict")
62 store fp128 %res, fp128 *%dst
66 ; Check negative displacements, which also need separate address logic.
67 define void @f5(fp128 *%dst, float *%base) {
70 ; CHECK: lxeb %f0, 0(%r3)
71 ; CHECK: std %f0, 0(%r2)
72 ; CHECK: std %f2, 8(%r2)
74 %ptr = getelementptr float, float *%base, i64 -1
75 %val = load float, float *%ptr
76 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
77 metadata !"fpexcept.strict")
78 store fp128 %res, fp128 *%dst
82 ; Check that LXEB allows indices.
83 define void @f6(fp128 *%dst, float *%base, i64 %index) {
85 ; CHECK: sllg %r1, %r4, 2
86 ; CHECK: lxeb %f0, 400(%r1,%r3)
87 ; CHECK: std %f0, 0(%r2)
88 ; CHECK: std %f2, 8(%r2)
90 %ptr1 = getelementptr float, float *%base, i64 %index
91 %ptr2 = getelementptr float, float *%ptr1, i64 100
92 %val = load float, float *%ptr2
93 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val,
94 metadata !"fpexcept.strict")
95 store fp128 %res, fp128 *%dst