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: xscmpudp cr7, f1, f3
9 ; CHECK-NEXT: mfocrf r3, 1
10 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
11 ; CHECK-NEXT: xscmpudp cr7, f2, f4
12 ; CHECK-NEXT: mfocrf r4, 1
13 ; CHECK-NEXT: rlwinm r4, r4, 31, 31, 31
14 ; CHECK-NEXT: xori r4, r4, 1
15 ; CHECK-NEXT: and r4, r3, r4
16 ; CHECK-NEXT: xscmpudp cr7, f1, f3
17 ; CHECK-NEXT: mfocrf r3, 1
18 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
19 ; CHECK-NEXT: xori r3, r3, 1
20 ; CHECK-NEXT: xscmpudp cr7, f1, f3
21 ; CHECK-NEXT: mfocrf r5, 1
22 ; CHECK-NEXT: rlwinm r5, r5, 31, 31, 31
23 ; CHECK-NEXT: xori r5, r5, 1
24 ; CHECK-NEXT: and r3, r3, r5
25 ; CHECK-NEXT: or r3, r3, r4
26 ; CHECK-NEXT: # kill: def $r4 killed $r3
27 ; CHECK-NEXT: clrldi r3, r3, 32
30 %0 = call i1 @llvm.experimental.constrained.fcmp.ppcf128(ppc_fp128 %a, ppc_fp128 %b, metadata !"une", metadata !"fpexcept.strict") #0
31 %1 = zext i1 %0 to i32
35 ; This is a different branch from une
36 define i32 @ogt_ppcf128(ppc_fp128 %a, ppc_fp128 %b) #0 {
37 ; CHECK-LABEL: ogt_ppcf128:
38 ; CHECK: # %bb.0: # %entry
39 ; CHECK-NEXT: xscmpudp cr7, f1, f3
40 ; CHECK-NEXT: mfocrf r3, 1
41 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
42 ; CHECK-NEXT: xscmpudp cr7, f2, f4
43 ; CHECK-NEXT: mfocrf r4, 1
44 ; CHECK-NEXT: rlwinm r4, r4, 30, 31, 31
45 ; CHECK-NEXT: and r4, r3, r4
46 ; CHECK-NEXT: xscmpudp cr0, f1, f3
47 ; CHECK-NEXT: mfocrf r3, 128
48 ; CHECK-NEXT: stw r3, -4(r1)
49 ; CHECK-NEXT: xscmpudp cr7, f1, f3
50 ; CHECK-NEXT: mfocrf r3, 1
51 ; CHECK-NEXT: lwz r5, -4(r1)
52 ; CHECK-NEXT: rotlwi r5, r5, 4
53 ; CHECK-NEXT: mtocrf 1, r5
54 ; CHECK-NEXT: rlwinm r5, r3, 30, 31, 31
55 ; CHECK-NEXT: mfocrf r3, 1
56 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
57 ; CHECK-NEXT: xori r3, r3, 1
58 ; CHECK-NEXT: and r3, r3, r5
59 ; CHECK-NEXT: or r3, r3, r4
60 ; CHECK-NEXT: # kill: def $r4 killed $r3
61 ; CHECK-NEXT: clrldi r3, r3, 32
64 %0 = call i1 @llvm.experimental.constrained.fcmp.ppcf128(ppc_fp128 %a, ppc_fp128 %b, metadata !"ogt", metadata !"fpexcept.strict") #0
65 %1 = zext i1 %0 to i32
69 define i1 @test_f128(fp128 %a, fp128 %b) #0 {
70 ; CHECK-LABEL: test_f128:
71 ; CHECK: # %bb.0: # %entry
72 ; CHECK-NEXT: xscmpuqp cr7, v2, v3
73 ; CHECK-NEXT: mfocrf r3, 1
74 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
75 ; CHECK-NEXT: xori r4, r3, 1
76 ; CHECK-NEXT: # implicit-def: $x3
77 ; CHECK-NEXT: mr r3, r4
80 %0 = call i1 @llvm.experimental.constrained.fcmp.f128(fp128 %a, fp128 %b, metadata !"une", metadata !"fpexcept.strict") #0
84 define i1 @testbr_f64(double %a, double %b) #0 {
85 ; CHECK-LABEL: testbr_f64:
86 ; CHECK: # %bb.0: # %entry
87 ; CHECK-NEXT: xscmpudp cr7, f1, f2
88 ; CHECK-NEXT: mfocrf r3, 1
89 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
90 ; CHECK-NEXT: cmplwi r3, 0
91 ; CHECK-NEXT: bne cr0, .LBB3_2
92 ; CHECK-NEXT: b .LBB3_1
93 ; CHECK-NEXT: .LBB3_1: # %tr
94 ; CHECK-NEXT: li r3, -1
96 ; CHECK-NEXT: .LBB3_2: # %fl
97 ; CHECK-NEXT: li r3, 0
100 %0 = call i1 @llvm.experimental.constrained.fcmp.f64(double %a, double %b, metadata !"une", metadata !"fpexcept.strict") #0
101 br i1 %0, label %tr, label %fl
108 define i1 @testbr_f32(float %a, float %b) #0 {
109 ; CHECK-LABEL: testbr_f32:
110 ; CHECK: # %bb.0: # %entry
111 ; CHECK-NEXT: fcmpu cr7, f1, f2
112 ; CHECK-NEXT: mfocrf r3, 1
113 ; CHECK-NEXT: rlwinm r3, r3, 31, 31, 31
114 ; CHECK-NEXT: cmplwi r3, 0
115 ; CHECK-NEXT: bne cr0, .LBB4_2
116 ; CHECK-NEXT: b .LBB4_1
117 ; CHECK-NEXT: .LBB4_1: # %tr
118 ; CHECK-NEXT: li r3, -1
120 ; CHECK-NEXT: .LBB4_2: # %fl
121 ; CHECK-NEXT: li r3, 0
124 %0 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"une", metadata !"fpexcept.strict") #0
125 br i1 %0, label %tr, label %fl
132 declare i1 @llvm.experimental.constrained.fcmp.ppcf128(ppc_fp128, ppc_fp128, metadata, metadata)
133 declare i1 @llvm.experimental.constrained.fcmp.f128(fp128, fp128, metadata, metadata)
134 declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)
135 declare i1 @llvm.experimental.constrained.fcmp.f32(float, float, metadata, metadata)
137 attributes #0 = { strictfp }