83 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5;6; Test extensions of f32 to f64.7;8 9; Check register extension.10define double @f1(float %val) {11; CHECK-LABEL: f1:12; CHECK: # %bb.0:13; CHECK-NEXT: ldebr %f0, %f014; CHECK-NEXT: br %r1415 %res = fpext float %val to double16 ret double %res17}18 19; Check the low end of the LDEB range.20define double @f2(ptr %ptr) {21; CHECK-LABEL: f2:22; CHECK: # %bb.0:23; CHECK-NEXT: ldeb %f0, 0(%r2)24; CHECK-NEXT: br %r1425 %val = load float, ptr %ptr26 %res = fpext float %val to double27 ret double %res28}29 30; Check the high end of the aligned LDEB range.31define double @f3(ptr %base) {32; CHECK-LABEL: f3:33; CHECK: # %bb.0:34; CHECK-NEXT: ldeb %f0, 4092(%r2)35; CHECK-NEXT: br %r1436 %ptr = getelementptr float, ptr %base, i64 102337 %val = load float, ptr %ptr38 %res = fpext float %val to double39 ret double %res40}41 42; Check the next word up, which needs separate address logic.43; Other sequences besides this one would be OK.44define double @f4(ptr %base) {45; CHECK-LABEL: f4:46; CHECK: # %bb.0:47; CHECK-NEXT: aghi %r2, 409648; CHECK-NEXT: ldeb %f0, 0(%r2)49; CHECK-NEXT: br %r1450 %ptr = getelementptr float, ptr %base, i64 102451 %val = load float, ptr %ptr52 %res = fpext float %val to double53 ret double %res54}55 56; Check negative displacements, which also need separate address logic.57define double @f5(ptr %base) {58; CHECK-LABEL: f5:59; CHECK: # %bb.0:60; CHECK-NEXT: aghi %r2, -461; CHECK-NEXT: ldeb %f0, 0(%r2)62; CHECK-NEXT: br %r1463 %ptr = getelementptr float, ptr %base, i64 -164 %val = load float, ptr %ptr65 %res = fpext float %val to double66 ret double %res67}68 69; Check that LDEB allows indices.70define double @f6(ptr %base, i64 %index) {71; CHECK-LABEL: f6:72; CHECK: # %bb.0:73; CHECK-NEXT: sllg %r1, %r3, 274; CHECK-NEXT: ldeb %f0, 400(%r1,%r2)75; CHECK-NEXT: br %r1476 %ptr1 = getelementptr float, ptr %base, i64 %index77 %ptr2 = getelementptr float, ptr %ptr1, i64 10078 %val = load float, ptr %ptr279 %res = fpext float %val to double80 ret double %res81}82 83