[SystemZ] Add CodeGen test cases
[oota-llvm.git] / test / CodeGen / SystemZ / fp-cmp-03.ll
1 ; Test 128-bit floating-point comparison.
2 ;
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5 ; There is no memory form of 128-bit comparison.
6 define i64 @f1(i64 %a, i64 %b, fp128 *%ptr, float %f2) {
7 ; CHECK: f1:
8 ; CHECK: lxebr %f0, %f0
9 ; CHECK: ld %f1, 0(%r4)
10 ; CHECK: ld %f3, 8(%r4)
11 ; CHECK: cxbr %f1, %f0
12 ; CHECK-NEXT: j{{g?}}e
13 ; CHECK: lgr %r2, %r3
14 ; CHECK: br %r14
15   %f2x = fpext float %f2 to fp128
16   %f1 = load fp128 *%ptr
17   %cond = fcmp oeq fp128 %f1, %f2x
18   %res = select i1 %cond, i64 %a, i64 %b
19   ret i64 %res
20 }