1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
3 ; RUN: < %s -mtriple=powerpc64-unknown-linux -mcpu=pwr9 -O0 | FileCheck %s
5 define i32 @une_ppcf128(ppc_fp128 %a, ppc_fp128 %b) #0 {
6 ; CHECK-LABEL: une_ppcf128:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: fcmpu cr0, f1, f3
9 ; CHECK-NEXT: crmove 4*cr5+lt, eq
10 ; CHECK-NEXT: fcmpu cr1, f2, f4
11 ; CHECK-NEXT: crmove 4*cr5+gt, 4*cr1+eq
12 ; CHECK-NEXT: crnot 4*cr5+gt, 4*cr5+gt
13 ; CHECK-NEXT: crand 4*cr5+gt, 4*cr5+lt, 4*cr5+gt
14 ; CHECK-NEXT: crmove 4*cr5+lt, eq
15 ; CHECK-NEXT: crnot 4*cr5+lt, 4*cr5+lt
16 ; CHECK-NEXT: crand 4*cr5+lt, 4*cr5+lt, 4*cr5+lt
17 ; CHECK-NEXT: cror 4*cr5+lt, 4*cr5+lt, 4*cr5+gt
18 ; CHECK-NEXT: li r4, 0
19 ; CHECK-NEXT: li r3, 1
20 ; CHECK-NEXT: isel r3, r3, r4, 4*cr5+lt
21 ; CHECK-NEXT: clrldi r3, r3, 32
24 %0 = call i1 @llvm.experimental.constrained.fcmp.ppcf128(ppc_fp128 %a, ppc_fp128 %b, metadata !"une", metadata !"fpexcept.strict") #0
25 %1 = zext i1 %0 to i32
29 ; This is a different branch from une
30 define i32 @ogt_ppcf128(ppc_fp128 %a, ppc_fp128 %b) #0 {
31 ; CHECK-LABEL: ogt_ppcf128:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: fcmpu cr0, f1, f3
34 ; CHECK-NEXT: crmove 4*cr5+lt, eq
35 ; CHECK-NEXT: fcmpu cr1, f2, f4
36 ; CHECK-NEXT: crmove 4*cr5+gt, 4*cr1+gt
37 ; CHECK-NEXT: crand 4*cr5+gt, 4*cr5+lt, 4*cr5+gt
38 ; CHECK-NEXT: crmove 4*cr5+lt, eq
39 ; CHECK-NEXT: crnot 4*cr5+lt, 4*cr5+lt
40 ; CHECK-NEXT: crmove 4*cr5+eq, gt
41 ; CHECK-NEXT: crand 4*cr5+lt, 4*cr5+lt, 4*cr5+eq
42 ; CHECK-NEXT: cror 4*cr5+lt, 4*cr5+lt, 4*cr5+gt
43 ; CHECK-NEXT: li r4, 0
44 ; CHECK-NEXT: li r3, 1
45 ; CHECK-NEXT: isel r3, r3, r4, 4*cr5+lt
46 ; CHECK-NEXT: clrldi r3, r3, 32
49 %0 = call i1 @llvm.experimental.constrained.fcmp.ppcf128(ppc_fp128 %a, ppc_fp128 %b, metadata !"ogt", metadata !"fpexcept.strict") #0
50 %1 = zext i1 %0 to i32
54 define i1 @test_f128(fp128 %a, fp128 %b) #0 {
55 ; CHECK-LABEL: test_f128:
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: xscmpuqp cr0, v2, v3
58 ; CHECK-NEXT: crmove 4*cr5+lt, eq
59 ; CHECK-NEXT: crnot 4*cr5+lt, 4*cr5+lt
60 ; CHECK-NEXT: li r4, 0
61 ; CHECK-NEXT: li r3, 1
62 ; CHECK-NEXT: isel r3, r3, r4, 4*cr5+lt
65 %0 = call i1 @llvm.experimental.constrained.fcmp.f128(fp128 %a, fp128 %b, metadata !"une", metadata !"fpexcept.strict") #0
69 define i1 @testbr_f64(double %a, double %b) #0 {
70 ; CHECK-LABEL: testbr_f64:
71 ; CHECK: # %bb.0: # %entry
72 ; CHECK-NEXT: fcmpu cr0, f1, f2
73 ; CHECK-NEXT: crmove 4*cr5+lt, eq
74 ; CHECK-NEXT: bc 12, 4*cr5+lt, .LBB3_2
75 ; CHECK-NEXT: b .LBB3_1
76 ; CHECK-NEXT: .LBB3_1: # %tr
77 ; CHECK-NEXT: li r3, -1
79 ; CHECK-NEXT: .LBB3_2: # %fl
80 ; CHECK-NEXT: li r3, 0
83 %0 = call i1 @llvm.experimental.constrained.fcmp.f64(double %a, double %b, metadata !"une", metadata !"fpexcept.strict") #0
84 br i1 %0, label %tr, label %fl
91 define i1 @testbr_f32(float %a, float %b) #0 {
92 ; CHECK-LABEL: testbr_f32:
93 ; CHECK: # %bb.0: # %entry
94 ; CHECK-NEXT: fcmpu cr0, f1, f2
95 ; CHECK-NEXT: crmove 4*cr5+lt, eq
96 ; CHECK-NEXT: bc 12, 4*cr5+lt, .LBB4_2
97 ; CHECK-NEXT: b .LBB4_1
98 ; CHECK-NEXT: .LBB4_1: # %tr
99 ; CHECK-NEXT: li r3, -1
101 ; CHECK-NEXT: .LBB4_2: # %fl
102 ; CHECK-NEXT: li r3, 0
105 %0 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"une", metadata !"fpexcept.strict") #0
106 br i1 %0, label %tr, label %fl
113 declare i1 @llvm.experimental.constrained.fcmp.ppcf128(ppc_fp128, ppc_fp128, metadata, metadata)
114 declare i1 @llvm.experimental.constrained.fcmp.f128(fp128, fp128, metadata, metadata)
115 declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)
116 declare i1 @llvm.experimental.constrained.fcmp.f32(float, float, metadata, metadata)
118 attributes #0 = { strictfp }