brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 01318f3 Raw
95 lines · plain
1; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s2; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s3 4; Check comparisons with zero. If the tested value is live after the5; comparison, load and test cannot be used to the same register.6 7; Compared value is used afterwards.8define i64 @f1(i64 %a, i64 %b, float %V, ptr %dst) {9; CHECK-LABEL: f1:10; CHECK: ltebr %f1, %f011  %cond = fcmp oeq float %V, 0.012  %res = select i1 %cond, i64 %a, i64 %b13  store volatile float %V, ptr %dst14  ret i64 %res15}16 17define i64 @f1m(i64 %a, i64 %b, float %V, ptr %dst) {18; CHECK-LABEL: f1m:19; CHECK: ltebr %f1, %f020  %cond = fcmp oeq float %V, -0.021  %res = select i1 %cond, i64 %a, i64 %b22  store volatile float %V, ptr %dst23  ret i64 %res24}25 26; Value only used in comparison.27define i64 @f2(i64 %a, i64 %b, float %V) {28; CHECK-LABEL: f2:29; CHECK: ltebr %f0, %f030  %cond = fcmp oeq float %V, 0.031  %res = select i1 %cond, i64 %a, i64 %b32  ret i64 %res33}34 35define i64 @f2m(i64 %a, i64 %b, float %V) {36; CHECK-LABEL: f2m:37; CHECK: ltebr %f0, %f038  %cond = fcmp oeq float %V, -0.039  %res = select i1 %cond, i64 %a, i64 %b40  ret i64 %res41}42 43; Same for double44define i64 @f3(i64 %a, i64 %b, double %V, ptr %dst) {45; CHECK-LABEL: f3:46; CHECK: ltdbr %f1, %f047  %cond = fcmp oeq double %V, 0.048  %res = select i1 %cond, i64 %a, i64 %b49  store volatile double %V, ptr %dst50  ret i64 %res51}52 53define i64 @f3m(i64 %a, i64 %b, double %V, ptr %dst) {54; CHECK-LABEL: f3m:55; CHECK: ltdbr %f1, %f056  %cond = fcmp oeq double %V, -0.057  %res = select i1 %cond, i64 %a, i64 %b58  store volatile double %V, ptr %dst59  ret i64 %res60}61 62define i64 @f4(i64 %a, i64 %b, double %V) {63; CHECK-LABEL: f4:64; CHECK: ltdbr %f0, %f065  %cond = fcmp oeq double %V, 0.066  %res = select i1 %cond, i64 %a, i64 %b67  ret i64 %res68}69 70define i64 @f4m(i64 %a, i64 %b, double %V) {71; CHECK-LABEL: f4m:72; CHECK: ltdbr %f0, %f073  %cond = fcmp oeq double %V, -0.074  %res = select i1 %cond, i64 %a, i64 %b75  ret i64 %res76}77 78; Same for fp12879define i64 @f5(i64 %a, i64 %b, fp128 %V, ptr %dst) {80; CHECK-LABEL: f5:81; CHECK: ltxbr %f1, %f082  %cond = fcmp oeq fp128 %V, 0xL0000000000000000800000000000000083  %res = select i1 %cond, i64 %a, i64 %b84  store volatile fp128 %V, ptr %dst85  ret i64 %res86}87 88define i64 @f6(i64 %a, i64 %b, fp128 %V) {89; CHECK-LABEL: f6:90; CHECK: ltxbr %f0, %f091  %cond = fcmp oeq fp128 %V, 0xL0000000000000000800000000000000092  %res = select i1 %cond, i64 %a, i64 %b93  ret i64 %res94}95