1
; RUN: llc < %s -march=mipsel -mcpu=mips32 | FileCheck %s -check-prefix=ALL -check-prefix=FCC -check-prefix=32-FCC
2
; RUN: llc < %s -march=mipsel -mcpu=mips32r2 | FileCheck %s -check-prefix=ALL -check-prefix=FCC -check-prefix=32-FCC
3
; RUN: llc < %s -march=mipsel -mcpu=mips32r6 | FileCheck %s -check-prefix=ALL -check-prefix=GPR -check-prefix=32-GPR
4
; RUN: llc < %s -march=mips64el -mcpu=mips64 | FileCheck %s -check-prefix=ALL -check-prefix=FCC -check-prefix=64-FCC
5
; RUN: llc < %s -march=mips64el -mcpu=mips64r2 | FileCheck %s -check-prefix=ALL -check-prefix=FCC -check-prefix=64-FCC
6
; RUN: llc < %s -march=mips64el -mcpu=mips64r6 | FileCheck %s -check-prefix=ALL -check-prefix=GPR -check-prefix=64-GPR
8
define void @func0(float %f2, float %f3) nounwind {
12
; 32-FCC: c.eq.s $f12, $f14
13
; 64-FCC: c.eq.s $f12, $f13
16
; 32-GPR: cmp.eq.s $[[FGRCC:f[0-9]+]], $f12, $f14
17
; 64-GPR: cmp.eq.s $[[FGRCC:f[0-9]+]], $f12, $f13
18
; GPR: mfc1 $[[GPRCC:[0-9]+]], $[[FGRCC:f[0-9]+]]
19
; FIXME: We ought to be able to transform not+bnez -> beqz
20
; GPR: not $[[GPRCC]], $[[GPRCC]]
21
; GPR: bnez $[[GPRCC]], $BB0_2
23
%cmp = fcmp oeq float %f2, %f3
24
br i1 %cmp, label %if.then, label %if.else
26
if.then: ; preds = %entry
27
tail call void (...) @g0() nounwind
30
if.else: ; preds = %entry
31
tail call void (...) @g1() nounwind
34
if.end: ; preds = %if.else, %if.then
42
define void @func1(float %f2, float %f3) nounwind {
46
; 32-FCC: c.olt.s $f12, $f14
47
; 64-FCC: c.olt.s $f12, $f13
50
; 32-GPR: cmp.ule.s $[[FGRCC:f[0-9]+]], $f14, $f12
51
; 64-GPR: cmp.ule.s $[[FGRCC:f[0-9]+]], $f13, $f12
52
; GPR: mfc1 $[[GPRCC:[0-9]+]], $[[FGRCC:f[0-9]+]]
53
; GPR-NOT: not $[[GPRCC]], $[[GPRCC]]
54
; GPR: bnez $[[GPRCC]], $BB1_2
56
%cmp = fcmp olt float %f2, %f3
57
br i1 %cmp, label %if.then, label %if.else
59
if.then: ; preds = %entry
60
tail call void (...) @g0() nounwind
63
if.else: ; preds = %entry
64
tail call void (...) @g1() nounwind
67
if.end: ; preds = %if.else, %if.then
71
define void @func2(float %f2, float %f3) nounwind {
75
; 32-FCC: c.ole.s $f12, $f14
76
; 64-FCC: c.ole.s $f12, $f13
79
; 32-GPR: cmp.ult.s $[[FGRCC:f[0-9]+]], $f14, $f12
80
; 64-GPR: cmp.ult.s $[[FGRCC:f[0-9]+]], $f13, $f12
81
; GPR: mfc1 $[[GPRCC:[0-9]+]], $[[FGRCC:f[0-9]+]]
82
; GPR-NOT: not $[[GPRCC]], $[[GPRCC]]
83
; GPR: beqz $[[GPRCC]], $BB2_2
85
%cmp = fcmp ugt float %f2, %f3
86
br i1 %cmp, label %if.else, label %if.then
88
if.then: ; preds = %entry
89
tail call void (...) @g0() nounwind
92
if.else: ; preds = %entry
93
tail call void (...) @g1() nounwind
96
if.end: ; preds = %if.else, %if.then
100
define void @func3(double %f2, double %f3) nounwind {
104
; 32-FCC: c.eq.d $f12, $f14
105
; 64-FCC: c.eq.d $f12, $f13
108
; 32-GPR: cmp.eq.d $[[FGRCC:f[0-9]+]], $f12, $f14
109
; 64-GPR: cmp.eq.d $[[FGRCC:f[0-9]+]], $f12, $f13
110
; GPR: mfc1 $[[GPRCC:[0-9]+]], $[[FGRCC:f[0-9]+]]
111
; FIXME: We ought to be able to transform not+bnez -> beqz
112
; GPR: not $[[GPRCC]], $[[GPRCC]]
113
; GPR: bnez $[[GPRCC]], $BB3_2
115
%cmp = fcmp oeq double %f2, %f3
116
br i1 %cmp, label %if.then, label %if.else
118
if.then: ; preds = %entry
119
tail call void (...) @g0() nounwind
122
if.else: ; preds = %entry
123
tail call void (...) @g1() nounwind
126
if.end: ; preds = %if.else, %if.then
130
define void @func4(double %f2, double %f3) nounwind {
134
; 32-FCC: c.olt.d $f12, $f14
135
; 64-FCC: c.olt.d $f12, $f13
138
; 32-GPR: cmp.ule.d $[[FGRCC:f[0-9]+]], $f14, $f12
139
; 64-GPR: cmp.ule.d $[[FGRCC:f[0-9]+]], $f13, $f12
140
; GPR: mfc1 $[[GPRCC:[0-9]+]], $[[FGRCC:f[0-9]+]]
141
; GPR-NOT: not $[[GPRCC]], $[[GPRCC]]
142
; GPR: bnez $[[GPRCC]], $BB4_2
144
%cmp = fcmp olt double %f2, %f3
145
br i1 %cmp, label %if.then, label %if.else
147
if.then: ; preds = %entry
148
tail call void (...) @g0() nounwind
151
if.else: ; preds = %entry
152
tail call void (...) @g1() nounwind
155
if.end: ; preds = %if.else, %if.then
159
define void @func5(double %f2, double %f3) nounwind {
163
; 32-FCC: c.ole.d $f12, $f14
164
; 64-FCC: c.ole.d $f12, $f13
167
; 32-GPR: cmp.ult.d $[[FGRCC:f[0-9]+]], $f14, $f12
168
; 64-GPR: cmp.ult.d $[[FGRCC:f[0-9]+]], $f13, $f12
169
; GPR: mfc1 $[[GPRCC:[0-9]+]], $[[FGRCC:f[0-9]+]]
170
; GPR-NOT: not $[[GPRCC]], $[[GPRCC]]
171
; GPR: beqz $[[GPRCC]], $BB5_2
173
%cmp = fcmp ugt double %f2, %f3
174
br i1 %cmp, label %if.else, label %if.then
176
if.then: ; preds = %entry
177
tail call void (...) @g0() nounwind
180
if.else: ; preds = %entry
181
tail call void (...) @g1() nounwind
184
if.end: ; preds = %if.else, %if.then