55 lines · plain
1; Test 32-bit unsigned comparisons in which the second operand is constant.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s4 5; Check a value near the low end of the range. We use signed forms for6; comparisons with zero, or things that are equivalent to them.7define double @f1(double %a, double %b, i32 %i1) {8; CHECK-LABEL: f1:9; CHECK: clijh %r2, 110; CHECK: ldr %f0, %f211; CHECK: br %r1412 %cond = icmp ugt i32 %i1, 113 %tmp = select i1 %cond, double %a, double %b14 %res = fadd double %tmp, 1.015 ret double %res16}17 18; Check the top of the CLIJ range.19define double @f2(double %a, double %b, i32 %i1) {20; CHECK-LABEL: f2:21; CHECK: clijl %r2, 25522; CHECK: ldr %f0, %f223; CHECK: br %r1424 %cond = icmp ult i32 %i1, 25525 %tmp = select i1 %cond, double %a, double %b26 %res = fadd double %tmp, 1.027 ret double %res28}29 30; Check the next value up, which needs a separate comparison.31define double @f3(double %a, double %b, i32 %i1) {32; CHECK-LABEL: f3:33; CHECK: clfi %r2, 25634; CHECK: jl35; CHECK: ldr %f0, %f236; CHECK: br %r1437 %cond = icmp ult i32 %i1, 25638 %tmp = select i1 %cond, double %a, double %b39 %res = fadd double %tmp, 1.040 ret double %res41}42 43; Check a value near the high end of the range.44define double @f4(double %a, double %b, i32 %i1) {45; CHECK-LABEL: f4:46; CHECK: clfi %r2, 429496728047; CHECK-NEXT: jl48; CHECK: ldr %f0, %f249; CHECK: br %r1450 %cond = icmp ult i32 %i1, 429496728051 %tmp = select i1 %cond, double %a, double %b52 %res = fadd double %tmp, 1.053 ret double %res54}55