1; Test f128 comparisons on z14.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
4
5; There is no memory form of 128-bit comparison.
6define i64 @f1(i64 %a, i64 %b, fp128 *%ptr1, fp128 *%ptr2) {
7; CHECK-LABEL: f1:
8; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r4)
9; CHECK-DAG: vl [[REG2:%v[0-9]+]], 0(%r5)
10; CHECK: wfcxb [[REG1]], [[REG2]]
11; CHECK-NEXT: locgrne %r2, %r3
12; CHECK: br %r14
13  %f1 = load fp128, fp128 *%ptr1
14  %f2 = load fp128, fp128 *%ptr2
15  %cond = fcmp oeq fp128 %f1, %f2
16  %res = select i1 %cond, i64 %a, i64 %b
17  ret i64 %res
18}
19
20; Check comparison with zero -- it is not worthwhile to copy to
21; FP pairs just so we can use LTXBR, so simply load up a zero.
22define i64 @f2(i64 %a, i64 %b, fp128 *%ptr) {
23; CHECK-LABEL: f2:
24; CHECK-DAG: vl [[REG1:%v[0-9]+]], 0(%r4)
25; CHECK-DAG: vzero [[REG2:%v[0-9]+]]
26; CHECK: wfcxb [[REG1]], [[REG2]]
27; CHECK-NEXT: locgrne %r2, %r3
28; CHECK: br %r14
29  %f = load fp128, fp128 *%ptr
30  %cond = fcmp oeq fp128 %f, 0xL00000000000000000000000000000000
31  %res = select i1 %cond, i64 %a, i64 %b
32  ret i64 %res
33}
34