brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 725d53c Raw
93 lines · plain
1; Test strict extensions of f32 to f64.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s4 5declare double @llvm.experimental.constrained.fpext.f64.f16(half, metadata)6declare double @llvm.experimental.constrained.fpext.f64.f32(float, metadata)7 8; Check register extension.9define double @f0(half %val) #0 {10; CHECK-LABEL: f0:11; CHECK: brasl %r14, __extendhfdf2@PLT12; CHECK: br %r1413  %res = call double @llvm.experimental.constrained.fpext.f64.f16(half %val,14                                               metadata !"fpexcept.strict") #015  ret double %res16}17 18; Check register extension.19define double @f1(float %val) #0 {20; CHECK-LABEL: f1:21; CHECK: ldebr %f0, %f022; CHECK: br %r1423  %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,24                                               metadata !"fpexcept.strict") #025  ret double %res26}27 28; Check the low end of the LDEB range.29define double @f2(ptr %ptr) #0 {30; CHECK-LABEL: f2:31; CHECK: ldeb %f0, 0(%r2)32; CHECK: br %r1433  %val = load float, ptr %ptr34  %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,35                                               metadata !"fpexcept.strict") #036  ret double %res37}38 39; Check the high end of the aligned LDEB range.40define double @f3(ptr %base) #0 {41; CHECK-LABEL: f3:42; CHECK: ldeb %f0, 4092(%r2)43; CHECK: br %r1444  %ptr = getelementptr float, ptr %base, i64 102345  %val = load float, ptr %ptr46  %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,47                                               metadata !"fpexcept.strict") #048  ret double %res49}50 51; Check the next word up, which needs separate address logic.52; Other sequences besides this one would be OK.53define double @f4(ptr %base) #0 {54; CHECK-LABEL: f4:55; CHECK: aghi %r2, 409656; CHECK: ldeb %f0, 0(%r2)57; CHECK: br %r1458  %ptr = getelementptr float, ptr %base, i64 102459  %val = load float, ptr %ptr60  %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,61                                               metadata !"fpexcept.strict") #062  ret double %res63}64 65; Check negative displacements, which also need separate address logic.66define double @f5(ptr %base) #0 {67; CHECK-LABEL: f5:68; CHECK: aghi %r2, -469; CHECK: ldeb %f0, 0(%r2)70; CHECK: br %r1471  %ptr = getelementptr float, ptr %base, i64 -172  %val = load float, ptr %ptr73  %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,74                                               metadata !"fpexcept.strict") #075  ret double %res76}77 78; Check that LDEB allows indices.79define double @f6(ptr %base, i64 %index) #0 {80; CHECK-LABEL: f6:81; CHECK: sllg %r1, %r3, 282; CHECK: ldeb %f0, 400(%r1,%r2)83; CHECK: br %r1484  %ptr1 = getelementptr float, ptr %base, i64 %index85  %ptr2 = getelementptr float, ptr %ptr1, i64 10086  %val = load float, ptr %ptr287  %res = call double @llvm.experimental.constrained.fpext.f64.f32(float %val,88                                               metadata !"fpexcept.strict") #089  ret double %res90}91 92attributes #0 = { strictfp }93