xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/llvm-ir/select-dbl.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
2*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,M2,M2-M3
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
4*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-32,CMOV-32R1
5*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
6*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-32,CMOV-32R2-R5
7*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
8*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-32,CMOV-32R2-R5
9*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
10*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-32,CMOV-32R2-R5
11*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
12*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,SEL-32,32R6
13*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
14*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,M3,M2-M3
15*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
16*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-64
17*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
18*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-64
19*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
20*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-64
21*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s \
22*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-64
23*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s \
24*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,CMOV,CMOV-64
25*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
26*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,SEL-64,64R6
27*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips | FileCheck %s \
28*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,MM32R3
29*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s \
30*9880d681SAndroid Build Coastguard Worker; RUN:    -check-prefixes=ALL,MM32R6,SEL-32
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_i1_double(i1 signext %s, double %x, double %y) {
33*9880d681SAndroid Build Coastguard Workerentry:
34*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_i1_double:
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker  ; M2:         andi    $[[T0:[0-9]+]], $4, 1
37*9880d681SAndroid Build Coastguard Worker  ; M2:         bnez    $[[T0]], $[[BB0:BB[0-9_]+]]
38*9880d681SAndroid Build Coastguard Worker  ; M2:         nop
39*9880d681SAndroid Build Coastguard Worker  ; M2:         ldc1    $f0, 16($sp)
40*9880d681SAndroid Build Coastguard Worker  ; M2:         jr      $ra
41*9880d681SAndroid Build Coastguard Worker  ; M2:         nop
42*9880d681SAndroid Build Coastguard Worker  ; M2:         $[[BB0]]:
43*9880d681SAndroid Build Coastguard Worker  ; M2:         mtc1    $7, $f0
44*9880d681SAndroid Build Coastguard Worker  ; M2:         jr      $ra
45*9880d681SAndroid Build Coastguard Worker  ; M2:         mtc1    $6, $f1
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:      mtc1    $7, $[[F0:f[0-9]+]]
48*9880d681SAndroid Build Coastguard Worker  ; CMOV-32R1:    mtc1    $6, $f{{[0-9]+}}
49*9880d681SAndroid Build Coastguard Worker  ; CMOV-32R2-R5: mthc1   $6, $[[F0]]
50*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:      andi    $[[T0:[0-9]+]], $4, 1
51*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:      ldc1    $f0, 16($sp)
52*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:      movn.d  $f0, $[[F0]], $[[T0]]
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     mtc1    $7, $[[F0:f[0-9]+]]
55*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     mthc1   $6, $[[F0]]
56*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     ldc1    $[[F1:f[0-9]+]], 16($sp)
57*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     mtc1    $4, $f0
58*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d   $f0, $[[F1]], $[[F0]]
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker  ; M3:         andi    $[[T0:[0-9]+]], $4, 1
61*9880d681SAndroid Build Coastguard Worker  ; M3:         bnez    $[[T0]], $[[BB0:BB[0-9_]+]]
62*9880d681SAndroid Build Coastguard Worker  ; M3:         nop
63*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d   $f13, $f14
64*9880d681SAndroid Build Coastguard Worker  ; M3:         $[[BB0]]:
65*9880d681SAndroid Build Coastguard Worker  ; M3:         jr      $ra
66*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d   $f0, $f13
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    andi    $[[T0:[0-9]+]], $4, 1
69*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movn.d  $f14, $f13, $[[T0]]
70*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d   $f0, $f14
71*9880d681SAndroid Build Coastguard Worker
72*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     mtc1    $4, $f0
73*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d   $f0, $f14, $f13
74*9880d681SAndroid Build Coastguard Worker
75*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mtc1    $7, $[[F0:f[0-9]+]]
76*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mthc1   $6, $[[F0]]
77*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     andi16  $[[T0:[0-9]+]], $4, 1
78*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     ldc1    $f0, 16($sp)
79*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movn.d  $f0, $[[F0]], $[[T0]]
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
82*9880d681SAndroid Build Coastguard Worker  ret double %r
83*9880d681SAndroid Build Coastguard Worker}
84*9880d681SAndroid Build Coastguard Worker
85*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_i1_double_reordered(double %x, double %y,
86*9880d681SAndroid Build Coastguard Worker                                              i1 signext %s) {
87*9880d681SAndroid Build Coastguard Workerentry:
88*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_i1_double_reordered:
89*9880d681SAndroid Build Coastguard Worker
90*9880d681SAndroid Build Coastguard Worker  ; M2:         lw      $[[T0:[0-9]+]], 16($sp)
91*9880d681SAndroid Build Coastguard Worker  ; M2:         andi    $[[T1:[0-9]+]], $[[T0]], 1
92*9880d681SAndroid Build Coastguard Worker  ; M2:         bnez    $[[T1]], $[[BB0:BB[0-9_]+]]
93*9880d681SAndroid Build Coastguard Worker  ; M2:         nop
94*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d   $f12, $f14
95*9880d681SAndroid Build Coastguard Worker  ; M2:         $[[BB0]]:
96*9880d681SAndroid Build Coastguard Worker  ; M2:         jr      $ra
97*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d   $f0, $f12
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    lw      $[[T0:[0-9]+]], 16($sp)
100*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    andi    $[[T1:[0-9]+]], $[[T0]], 1
101*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movn.d  $f14, $f12, $[[T1]]
102*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d   $f0, $f14
103*9880d681SAndroid Build Coastguard Worker
104*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     lw      $[[T0:[0-9]+]], 16($sp)
105*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     mtc1    $[[T0]], $f0
106*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d   $f0, $f14, $f12
107*9880d681SAndroid Build Coastguard Worker
108*9880d681SAndroid Build Coastguard Worker  ; M3:         andi    $[[T0:[0-9]+]], $6, 1
109*9880d681SAndroid Build Coastguard Worker  ; M3:         bnez    $[[T0]], $[[BB0:BB[0-9_]+]]
110*9880d681SAndroid Build Coastguard Worker  ; M3:         nop
111*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d   $f12, $f13
112*9880d681SAndroid Build Coastguard Worker  ; M3:         $[[BB0]]:
113*9880d681SAndroid Build Coastguard Worker  ; M3:         jr      $ra
114*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d   $f0, $f12
115*9880d681SAndroid Build Coastguard Worker
116*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    andi    $[[T0:[0-9]+]], $6, 1
117*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movn.d  $f13, $f12, $[[T0]]
118*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d   $f0, $f13
119*9880d681SAndroid Build Coastguard Worker
120*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     mtc1    $6, $f0
121*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d   $f0, $f13, $f12
122*9880d681SAndroid Build Coastguard Worker
123*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     lw      $[[T0:[0-9]+]], 16($sp)
124*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     andi16  $[[T1:[0-9]+]], $[[T0:[0-9]+]], 1
125*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movn.d  $f14, $f12, $[[T1]]
126*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d   $f0, $f14
127*9880d681SAndroid Build Coastguard Worker
128*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
129*9880d681SAndroid Build Coastguard Worker  ret double %r
130*9880d681SAndroid Build Coastguard Worker}
131*9880d681SAndroid Build Coastguard Worker
132*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_fcmp_olt_double(double %x, double %y) {
133*9880d681SAndroid Build Coastguard Workerentry:
134*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_fcmp_olt_double:
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard Worker  ; M2:         c.olt.d   $f12, $f14
137*9880d681SAndroid Build Coastguard Worker  ; M3:         c.olt.d   $f12, $f13
138*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      bc1t      $[[BB0:BB[0-9_]+]]
139*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      nop
140*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d     $f12, $f14
141*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d     $f12, $f13
142*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      $[[BB0]]:
143*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      jr        $ra
144*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      mov.d     $f0, $f12
145*9880d681SAndroid Build Coastguard Worker
146*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    c.olt.d   $f12, $f14
147*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movt.d    $f14, $f12, $fcc0
148*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d     $f0, $f14
149*9880d681SAndroid Build Coastguard Worker
150*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     cmp.lt.d  $f0, $f12, $f14
151*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d     $f0, $f14, $f12
152*9880d681SAndroid Build Coastguard Worker
153*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    c.olt.d   $f12, $f13
154*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movt.d    $f13, $f12, $fcc0
155*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d     $f0, $f13
156*9880d681SAndroid Build Coastguard Worker
157*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     cmp.lt.d  $f0, $f12, $f13
158*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d     $f0, $f13, $f12
159*9880d681SAndroid Build Coastguard Worker
160*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     c.olt.d   $f12, $f14
161*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movt.d    $f14, $f12, $fcc0
162*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d     $f0, $f14
163*9880d681SAndroid Build Coastguard Worker
164*9880d681SAndroid Build Coastguard Worker  %s = fcmp olt double %x, %y
165*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
166*9880d681SAndroid Build Coastguard Worker  ret double %r
167*9880d681SAndroid Build Coastguard Worker}
168*9880d681SAndroid Build Coastguard Worker
169*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_fcmp_ole_double(double %x, double %y) {
170*9880d681SAndroid Build Coastguard Workerentry:
171*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_fcmp_ole_double:
172*9880d681SAndroid Build Coastguard Worker
173*9880d681SAndroid Build Coastguard Worker  ; M2:         c.ole.d   $f12, $f14
174*9880d681SAndroid Build Coastguard Worker  ; M3:         c.ole.d   $f12, $f13
175*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      bc1t      $[[BB0:BB[0-9_]+]]
176*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      nop
177*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d     $f12, $f14
178*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d     $f12, $f13
179*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      $[[BB0]]:
180*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      jr        $ra
181*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      mov.d     $f0, $f12
182*9880d681SAndroid Build Coastguard Worker
183*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    c.ole.d   $f12, $f14
184*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movt.d    $f14, $f12, $fcc0
185*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d     $f0, $f14
186*9880d681SAndroid Build Coastguard Worker
187*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     cmp.le.d  $f0, $f12, $f14
188*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d     $f0, $f14, $f12
189*9880d681SAndroid Build Coastguard Worker
190*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    c.ole.d   $f12, $f13
191*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movt.d    $f13, $f12, $fcc0
192*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d     $f0, $f13
193*9880d681SAndroid Build Coastguard Worker
194*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     cmp.le.d  $f0, $f12, $f13
195*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d     $f0, $f13, $f12
196*9880d681SAndroid Build Coastguard Worker
197*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     c.ole.d   $f12, $f14
198*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movt.d    $f14, $f12, $fcc0
199*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d     $f0, $f14
200*9880d681SAndroid Build Coastguard Worker
201*9880d681SAndroid Build Coastguard Worker  %s = fcmp ole double %x, %y
202*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
203*9880d681SAndroid Build Coastguard Worker  ret double %r
204*9880d681SAndroid Build Coastguard Worker}
205*9880d681SAndroid Build Coastguard Worker
206*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_fcmp_ogt_double(double %x, double %y) {
207*9880d681SAndroid Build Coastguard Workerentry:
208*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_fcmp_ogt_double:
209*9880d681SAndroid Build Coastguard Worker
210*9880d681SAndroid Build Coastguard Worker  ; M2:         c.ule.d   $f12, $f14
211*9880d681SAndroid Build Coastguard Worker  ; M3:         c.ule.d   $f12, $f13
212*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      bc1f      $[[BB0:BB[0-9_]+]]
213*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      nop
214*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d     $f12, $f14
215*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d     $f12, $f13
216*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      $[[BB0]]:
217*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      jr        $ra
218*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      mov.d     $f0, $f12
219*9880d681SAndroid Build Coastguard Worker
220*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    c.ule.d   $f12, $f14
221*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movf.d    $f14, $f12, $fcc0
222*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d     $f0, $f14
223*9880d681SAndroid Build Coastguard Worker
224*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     cmp.lt.d  $f0, $f14, $f12
225*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d     $f0, $f14, $f12
226*9880d681SAndroid Build Coastguard Worker
227*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    c.ule.d   $f12, $f13
228*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movf.d    $f13, $f12, $fcc0
229*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d     $f0, $f13
230*9880d681SAndroid Build Coastguard Worker
231*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     cmp.lt.d  $f0, $f13, $f12
232*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d     $f0, $f13, $f12
233*9880d681SAndroid Build Coastguard Worker
234*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     c.ule.d   $f12, $f14
235*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movf.d    $f14, $f12, $fcc0
236*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d     $f0, $f14
237*9880d681SAndroid Build Coastguard Worker
238*9880d681SAndroid Build Coastguard Worker  %s = fcmp ogt double %x, %y
239*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
240*9880d681SAndroid Build Coastguard Worker  ret double %r
241*9880d681SAndroid Build Coastguard Worker}
242*9880d681SAndroid Build Coastguard Worker
243*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_fcmp_oge_double(double %x, double %y) {
244*9880d681SAndroid Build Coastguard Workerentry:
245*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_fcmp_oge_double:
246*9880d681SAndroid Build Coastguard Worker
247*9880d681SAndroid Build Coastguard Worker  ; M2:         c.ult.d   $f12, $f14
248*9880d681SAndroid Build Coastguard Worker  ; M3:         c.ult.d   $f12, $f13
249*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      bc1f      $[[BB0:BB[0-9_]+]]
250*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      nop
251*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d     $f12, $f14
252*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d     $f12, $f13
253*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      $[[BB0]]:
254*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      jr        $ra
255*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      mov.d     $f0, $f12
256*9880d681SAndroid Build Coastguard Worker
257*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    c.ult.d   $f12, $f14
258*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movf.d    $f14, $f12, $fcc0
259*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d     $f0, $f14
260*9880d681SAndroid Build Coastguard Worker
261*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     cmp.le.d  $f0, $f14, $f12
262*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d     $f0, $f14, $f12
263*9880d681SAndroid Build Coastguard Worker
264*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    c.ult.d   $f12, $f13
265*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movf.d    $f13, $f12, $fcc0
266*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d     $f0, $f13
267*9880d681SAndroid Build Coastguard Worker
268*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     cmp.le.d  $f0, $f13, $f12
269*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d     $f0, $f13, $f12
270*9880d681SAndroid Build Coastguard Worker
271*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     c.ult.d   $f12, $f14
272*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movf.d    $f14, $f12, $fcc0
273*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d     $f0, $f14
274*9880d681SAndroid Build Coastguard Worker
275*9880d681SAndroid Build Coastguard Worker  %s = fcmp oge double %x, %y
276*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
277*9880d681SAndroid Build Coastguard Worker  ret double %r
278*9880d681SAndroid Build Coastguard Worker}
279*9880d681SAndroid Build Coastguard Worker
280*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_fcmp_oeq_double(double %x, double %y) {
281*9880d681SAndroid Build Coastguard Workerentry:
282*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_fcmp_oeq_double:
283*9880d681SAndroid Build Coastguard Worker
284*9880d681SAndroid Build Coastguard Worker  ; M2:         c.eq.d    $f12, $f14
285*9880d681SAndroid Build Coastguard Worker  ; M3:         c.eq.d    $f12, $f13
286*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      bc1t      $[[BB0:BB[0-9_]+]]
287*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      nop
288*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d     $f12, $f14
289*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d     $f12, $f13
290*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      $[[BB0]]:
291*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      jr        $ra
292*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      mov.d     $f0, $f12
293*9880d681SAndroid Build Coastguard Worker
294*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    c.eq.d    $f12, $f14
295*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movt.d    $f14, $f12, $fcc0
296*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d     $f0, $f14
297*9880d681SAndroid Build Coastguard Worker
298*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     cmp.eq.d  $f0, $f12, $f14
299*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d     $f0, $f14, $f12
300*9880d681SAndroid Build Coastguard Worker
301*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    c.eq.d    $f12, $f13
302*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movt.d    $f13, $f12, $fcc0
303*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d     $f0, $f13
304*9880d681SAndroid Build Coastguard Worker
305*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     cmp.eq.d  $f0, $f12, $f13
306*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d     $f0, $f13, $f12
307*9880d681SAndroid Build Coastguard Worker
308*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     c.eq.d    $f12, $f14
309*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movt.d    $f14, $f12, $fcc0
310*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d     $f0, $f14
311*9880d681SAndroid Build Coastguard Worker
312*9880d681SAndroid Build Coastguard Worker  %s = fcmp oeq double %x, %y
313*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
314*9880d681SAndroid Build Coastguard Worker  ret double %r
315*9880d681SAndroid Build Coastguard Worker}
316*9880d681SAndroid Build Coastguard Worker
317*9880d681SAndroid Build Coastguard Workerdefine double @tst_select_fcmp_one_double(double %x, double %y) {
318*9880d681SAndroid Build Coastguard Workerentry:
319*9880d681SAndroid Build Coastguard Worker  ; ALL-LABEL: tst_select_fcmp_one_double:
320*9880d681SAndroid Build Coastguard Worker
321*9880d681SAndroid Build Coastguard Worker  ; M2:         c.ueq.d   $f12, $f14
322*9880d681SAndroid Build Coastguard Worker  ; M3:         c.ueq.d   $f12, $f13
323*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      bc1f      $[[BB0:BB[0-9_]+]]
324*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      nop
325*9880d681SAndroid Build Coastguard Worker  ; M2:         mov.d     $f12, $f14
326*9880d681SAndroid Build Coastguard Worker  ; M3:         mov.d     $f12, $f13
327*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      $[[BB0]]:
328*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      jr        $ra
329*9880d681SAndroid Build Coastguard Worker  ; M2-M3:      mov.d     $f0, $f12
330*9880d681SAndroid Build Coastguard Worker
331*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    c.ueq.d   $f12, $f14
332*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    movf.d    $f14, $f12, $fcc0
333*9880d681SAndroid Build Coastguard Worker  ; CMOV-32:    mov.d     $f0, $f14
334*9880d681SAndroid Build Coastguard Worker
335*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     cmp.ueq.d $f0, $f12, $f14
336*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     mfc1      $[[T0:[0-9]+]], $f0
337*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     not       $[[T0]], $[[T0]]
338*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     mtc1      $[[T0:[0-9]+]], $f0
339*9880d681SAndroid Build Coastguard Worker  ; SEL-32:     sel.d     $f0, $f14, $f12
340*9880d681SAndroid Build Coastguard Worker
341*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    c.ueq.d   $f12, $f13
342*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    movf.d    $f13, $f12, $fcc0
343*9880d681SAndroid Build Coastguard Worker  ; CMOV-64:    mov.d     $f0, $f13
344*9880d681SAndroid Build Coastguard Worker
345*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     cmp.ueq.d $f0, $f12, $f13
346*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     mfc1      $[[T0:[0-9]+]], $f0
347*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     not       $[[T0]], $[[T0]]
348*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     mtc1      $[[T0:[0-9]+]], $f0
349*9880d681SAndroid Build Coastguard Worker  ; SEL-64:     sel.d     $f0, $f13, $f12
350*9880d681SAndroid Build Coastguard Worker
351*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     c.ueq.d   $f12, $f14
352*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     movf.d    $f14, $f12, $fcc0
353*9880d681SAndroid Build Coastguard Worker  ; MM32R3:     mov.d     $f0, $f14
354*9880d681SAndroid Build Coastguard Worker
355*9880d681SAndroid Build Coastguard Worker  %s = fcmp one double %x, %y
356*9880d681SAndroid Build Coastguard Worker  %r = select i1 %s, double %x, double %y
357*9880d681SAndroid Build Coastguard Worker  ret double %r
358*9880d681SAndroid Build Coastguard Worker}
359