[SystemZ] Add floating-point load-and-test instructions
[oota-llvm.git] / test / CodeGen / SystemZ / fp-cmp-02.ll
index 48374a722bbbc3822f7c2179ef37010cfa108338..309d12e824afa1aab89f74e4c3953a81f2ccedab 100644 (file)
@@ -147,3 +147,15 @@ define double @f7(double *%ptr0) {
 
   ret double %sel10
 }
+
+; Check comparison with zero.
+define i64 @f8(i64 %a, i64 %b, double %f) {
+; CHECK-LABEL: f8:
+; CHECK: ltdbr %f0, %f0
+; CHECK-NEXT: je
+; CHECK: lgr %r2, %r3
+; CHECK: br %r14
+  %cond = fcmp oeq double %f, 0.0
+  %res = select i1 %cond, i64 %a, i64 %b
+  ret i64 %res
+}