brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 1ab8375 Raw
111 lines · plain
1; Test 32-bit floating-point loads for z13.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5; Test that we use LDE instead of LE - low end of the LE range.6define float @f1(ptr %src) {7; CHECK-LABEL: f1:8; CHECK: lde %f0, 0(%r2)9; CHECK: br %r1410  %val = load float, ptr %src11  ret float %val12}13 14; Test that we use LDE instead of LE - high end of the LE range.15define float @f2(ptr %src) {16; CHECK-LABEL: f2:17; CHECK: lde %f0, 4092(%r2)18; CHECK: br %r1419  %ptr = getelementptr float, ptr %src, i64 102320  %val = load float, ptr %ptr21  ret float %val22}23 24; Check the next word up, which should use LEY instead of LDE.25define float @f3(ptr %src) {26; CHECK-LABEL: f3:27; CHECK: ley %f0, 4096(%r2)28; CHECK: br %r1429  %ptr = getelementptr float, ptr %src, i64 102430  %val = load float, ptr %ptr31  ret float %val32}33 34; Check the high end of the aligned LEY range.35define float @f4(ptr %src) {36; CHECK-LABEL: f4:37; CHECK: ley %f0, 524284(%r2)38; CHECK: br %r1439  %ptr = getelementptr float, ptr %src, i64 13107140  %val = load float, ptr %ptr41  ret float %val42}43 44; Check the next word up, which needs separate address logic.45; Other sequences besides this one would be OK.46define float @f5(ptr %src) {47; CHECK-LABEL: f5:48; CHECK: agfi %r2, 52428849; CHECK: lde %f0, 0(%r2)50; CHECK: br %r1451  %ptr = getelementptr float, ptr %src, i64 13107252  %val = load float, ptr %ptr53  ret float %val54}55 56; Check the high end of the negative aligned LEY range.57define float @f6(ptr %src) {58; CHECK-LABEL: f6:59; CHECK: ley %f0, -4(%r2)60; CHECK: br %r1461  %ptr = getelementptr float, ptr %src, i64 -162  %val = load float, ptr %ptr63  ret float %val64}65 66; Check the low end of the LEY range.67define float @f7(ptr %src) {68; CHECK-LABEL: f7:69; CHECK: ley %f0, -524288(%r2)70; CHECK: br %r1471  %ptr = getelementptr float, ptr %src, i64 -13107272  %val = load float, ptr %ptr73  ret float %val74}75 76; Check the next word down, which needs separate address logic.77; Other sequences besides this one would be OK.78define float @f8(ptr %src) {79; CHECK-LABEL: f8:80; CHECK: agfi %r2, -52429281; CHECK: lde %f0, 0(%r2)82; CHECK: br %r1483  %ptr = getelementptr float, ptr %src, i64 -13107384  %val = load float, ptr %ptr85  ret float %val86}87 88; Check that LDE allows an index.89define float @f9(i64 %src, i64 %index) {90; CHECK-LABEL: f9:91; CHECK: lde %f0, 4092({{%r3,%r2|%r2,%r3}})92; CHECK: br %r1493  %add1 = add i64 %src, %index94  %add2 = add i64 %add1, 409295  %ptr = inttoptr i64 %add2 to ptr96  %val = load float, ptr %ptr97  ret float %val98}99 100; Check that LEY allows an index.101define float @f10(i64 %src, i64 %index) {102; CHECK-LABEL: f10:103; CHECK: ley %f0, 4096({{%r3,%r2|%r2,%r3}})104; CHECK: br %r14105  %add1 = add i64 %src, %index106  %add2 = add i64 %add1, 4096107  %ptr = inttoptr i64 %add2 to ptr108  %val = load float, ptr %ptr109  ret float %val110}111