diff options
Diffstat (limited to 'test/CodeGen/SystemZ/fp-cmp-01.ll')
-rw-r--r-- | test/CodeGen/SystemZ/fp-cmp-01.ll | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/fp-cmp-01.ll b/test/CodeGen/SystemZ/fp-cmp-01.ll index 6a9598e30c..7f194014f9 100644 --- a/test/CodeGen/SystemZ/fp-cmp-01.ll +++ b/test/CodeGen/SystemZ/fp-cmp-01.ll @@ -159,3 +159,160 @@ define i64 @f8(i64 %a, i64 %b, float %f) { %res = select i1 %cond, i64 %a, i64 %b ret i64 %res } + +; Check the comparison can be reversed if that allows CEB to be used, +; first with oeq. +define i64 @f9(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f9: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: je {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp oeq float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then one. +define i64 @f10(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f10: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jlh {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp one float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then olt. +define i64 @f11(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f11: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jh {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp olt float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then ole. +define i64 @f12(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f12: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jhe {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp ole float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then oge. +define i64 @f13(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f13: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jle {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp oge float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then ogt. +define i64 @f14(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f14: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jl {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp ogt float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then ueq. +define i64 @f15(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f15: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jnlh {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp ueq float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then une. +define i64 @f16(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f16: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jne {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp une float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then ult. +define i64 @f17(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f17: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jnle {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp ult float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then ule. +define i64 @f18(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f18: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jnl {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp ule float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then uge. +define i64 @f19(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f19: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jnh {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp uge float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} + +; ...then ugt. +define i64 @f20(i64 %a, i64 %b, float %f2, float *%ptr) { +; CHECK-LABEL: f20: +; CHECK: ceb %f0, 0(%r4) +; CHECK-NEXT: jnhe {{\.L.*}} +; CHECK: lgr %r2, %r3 +; CHECK: br %r14 + %f1 = load float *%ptr + %cond = fcmp ugt float %f1, %f2 + %res = select i1 %cond, i64 %a, i64 %b + ret i64 %res +} |