X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FSystemZ%2Fint-cmp-06.ll;h=8ab62e89ec39b86f0088b69d82d9a93e889e6802;hb=219d2b8695d4322b7a3d6b9892880e65915106a7;hp=cdd61141d8d7233ab96947e66009fb4482f388d8;hpb=8b2b8a18354546d534b72f912153a3252ab4b857;p=oota-llvm.git diff --git a/test/CodeGen/SystemZ/int-cmp-06.ll b/test/CodeGen/SystemZ/int-cmp-06.ll index cdd61141d8d..8ab62e89ec3 100644 --- a/test/CodeGen/SystemZ/int-cmp-06.ll +++ b/test/CodeGen/SystemZ/int-cmp-06.ll @@ -104,7 +104,7 @@ define double @f8(double %a, double %b, i64 %i1, i64 %unext) { ret double %res } -; Check unsigned comparisonn with memory. +; Check unsigned comparison with memory. define double @f9(double %a, double %b, i64 %i1, i32 *%ptr) { ; CHECK-LABEL: f9: ; CHECK: clgf %r2, 0(%r3) @@ -340,3 +340,17 @@ define i64 @f19(i32 *%ptr0) { ret i64 %sel9 } + +; Check the comparison can be reversed if that allows CLGF to be used. +define double @f20(double %a, double %b, i64 %i2, i32 *%ptr) { +; CHECK-LABEL: f20: +; CHECK: clgf %r2, 0(%r3) +; CHECK-NEXT: jh {{\.L.*}} +; CHECK: ldr %f0, %f2 +; CHECK: br %r14 + %unext = load i32 *%ptr + %i1 = zext i32 %unext to i64 + %cond = icmp ult i64 %i1, %i2 + %res = select i1 %cond, double %a, double %b + ret double %res +}