1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=-sse -O3 | FileCheck %s --check-prefixes=X86
3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -O3 | FileCheck %s --check-prefixes=X64
4
5define i32 @test_oeq_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
6; X86-LABEL: test_oeq_q:
7; X86:       # %bb.0:
8; X86-NEXT:    fldt {{[0-9]+}}(%esp)
9; X86-NEXT:    fldt {{[0-9]+}}(%esp)
10; X86-NEXT:    fucompp
11; X86-NEXT:    wait
12; X86-NEXT:    fnstsw %ax
13; X86-NEXT:    # kill: def $ah killed $ah killed $ax
14; X86-NEXT:    sahf
15; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
16; X86-NEXT:    jne .LBB0_3
17; X86-NEXT:  # %bb.1:
18; X86-NEXT:    jp .LBB0_3
19; X86-NEXT:  # %bb.2:
20; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
21; X86-NEXT:  .LBB0_3:
22; X86-NEXT:    movl (%eax), %eax
23; X86-NEXT:    retl
24;
25; X64-LABEL: test_oeq_q:
26; X64:       # %bb.0:
27; X64-NEXT:    movl %edi, %eax
28; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
29; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
30; X64-NEXT:    fucompi %st(1), %st
31; X64-NEXT:    fstp %st(0)
32; X64-NEXT:    wait
33; X64-NEXT:    cmovnel %esi, %eax
34; X64-NEXT:    cmovpl %esi, %eax
35; X64-NEXT:    retq
36  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
37                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"oeq",
38                                               metadata !"fpexcept.strict") #0
39  %res = select i1 %cond, i32 %a, i32 %b
40  ret i32 %res
41}
42
43define i32 @test_ogt_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
44; X86-LABEL: test_ogt_q:
45; X86:       # %bb.0:
46; X86-NEXT:    fldt {{[0-9]+}}(%esp)
47; X86-NEXT:    fldt {{[0-9]+}}(%esp)
48; X86-NEXT:    fucompp
49; X86-NEXT:    wait
50; X86-NEXT:    fnstsw %ax
51; X86-NEXT:    # kill: def $ah killed $ah killed $ax
52; X86-NEXT:    sahf
53; X86-NEXT:    ja .LBB1_1
54; X86-NEXT:  # %bb.2:
55; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
56; X86-NEXT:    movl (%eax), %eax
57; X86-NEXT:    retl
58; X86-NEXT:  .LBB1_1:
59; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
60; X86-NEXT:    movl (%eax), %eax
61; X86-NEXT:    retl
62;
63; X64-LABEL: test_ogt_q:
64; X64:       # %bb.0:
65; X64-NEXT:    movl %edi, %eax
66; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
67; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
68; X64-NEXT:    fucompi %st(1), %st
69; X64-NEXT:    fstp %st(0)
70; X64-NEXT:    wait
71; X64-NEXT:    cmovbel %esi, %eax
72; X64-NEXT:    retq
73  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
74                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ogt",
75                                               metadata !"fpexcept.strict") #0
76  %res = select i1 %cond, i32 %a, i32 %b
77  ret i32 %res
78}
79
80define i32 @test_oge_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
81; X86-LABEL: test_oge_q:
82; X86:       # %bb.0:
83; X86-NEXT:    fldt {{[0-9]+}}(%esp)
84; X86-NEXT:    fldt {{[0-9]+}}(%esp)
85; X86-NEXT:    fucompp
86; X86-NEXT:    wait
87; X86-NEXT:    fnstsw %ax
88; X86-NEXT:    # kill: def $ah killed $ah killed $ax
89; X86-NEXT:    sahf
90; X86-NEXT:    jae .LBB2_1
91; X86-NEXT:  # %bb.2:
92; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
93; X86-NEXT:    movl (%eax), %eax
94; X86-NEXT:    retl
95; X86-NEXT:  .LBB2_1:
96; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
97; X86-NEXT:    movl (%eax), %eax
98; X86-NEXT:    retl
99;
100; X64-LABEL: test_oge_q:
101; X64:       # %bb.0:
102; X64-NEXT:    movl %edi, %eax
103; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
104; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
105; X64-NEXT:    fucompi %st(1), %st
106; X64-NEXT:    fstp %st(0)
107; X64-NEXT:    wait
108; X64-NEXT:    cmovbl %esi, %eax
109; X64-NEXT:    retq
110  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
111                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"oge",
112                                               metadata !"fpexcept.strict") #0
113  %res = select i1 %cond, i32 %a, i32 %b
114  ret i32 %res
115}
116
117define i32 @test_olt_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
118; X86-LABEL: test_olt_q:
119; X86:       # %bb.0:
120; X86-NEXT:    fldt {{[0-9]+}}(%esp)
121; X86-NEXT:    fldt {{[0-9]+}}(%esp)
122; X86-NEXT:    fucompp
123; X86-NEXT:    wait
124; X86-NEXT:    fnstsw %ax
125; X86-NEXT:    # kill: def $ah killed $ah killed $ax
126; X86-NEXT:    sahf
127; X86-NEXT:    ja .LBB3_1
128; X86-NEXT:  # %bb.2:
129; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
130; X86-NEXT:    movl (%eax), %eax
131; X86-NEXT:    retl
132; X86-NEXT:  .LBB3_1:
133; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
134; X86-NEXT:    movl (%eax), %eax
135; X86-NEXT:    retl
136;
137; X64-LABEL: test_olt_q:
138; X64:       # %bb.0:
139; X64-NEXT:    movl %edi, %eax
140; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
141; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
142; X64-NEXT:    fucompi %st(1), %st
143; X64-NEXT:    fstp %st(0)
144; X64-NEXT:    wait
145; X64-NEXT:    cmovbel %esi, %eax
146; X64-NEXT:    retq
147  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
148                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"olt",
149                                               metadata !"fpexcept.strict") #0
150  %res = select i1 %cond, i32 %a, i32 %b
151  ret i32 %res
152}
153
154define i32 @test_ole_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
155; X86-LABEL: test_ole_q:
156; X86:       # %bb.0:
157; X86-NEXT:    fldt {{[0-9]+}}(%esp)
158; X86-NEXT:    fldt {{[0-9]+}}(%esp)
159; X86-NEXT:    fucompp
160; X86-NEXT:    wait
161; X86-NEXT:    fnstsw %ax
162; X86-NEXT:    # kill: def $ah killed $ah killed $ax
163; X86-NEXT:    sahf
164; X86-NEXT:    jae .LBB4_1
165; X86-NEXT:  # %bb.2:
166; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
167; X86-NEXT:    movl (%eax), %eax
168; X86-NEXT:    retl
169; X86-NEXT:  .LBB4_1:
170; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
171; X86-NEXT:    movl (%eax), %eax
172; X86-NEXT:    retl
173;
174; X64-LABEL: test_ole_q:
175; X64:       # %bb.0:
176; X64-NEXT:    movl %edi, %eax
177; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
178; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
179; X64-NEXT:    fucompi %st(1), %st
180; X64-NEXT:    fstp %st(0)
181; X64-NEXT:    wait
182; X64-NEXT:    cmovbl %esi, %eax
183; X64-NEXT:    retq
184  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
185                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ole",
186                                               metadata !"fpexcept.strict") #0
187  %res = select i1 %cond, i32 %a, i32 %b
188  ret i32 %res
189}
190
191define i32 @test_one_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
192; X86-LABEL: test_one_q:
193; X86:       # %bb.0:
194; X86-NEXT:    fldt {{[0-9]+}}(%esp)
195; X86-NEXT:    fldt {{[0-9]+}}(%esp)
196; X86-NEXT:    fucompp
197; X86-NEXT:    wait
198; X86-NEXT:    fnstsw %ax
199; X86-NEXT:    # kill: def $ah killed $ah killed $ax
200; X86-NEXT:    sahf
201; X86-NEXT:    jne .LBB5_1
202; X86-NEXT:  # %bb.2:
203; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
204; X86-NEXT:    movl (%eax), %eax
205; X86-NEXT:    retl
206; X86-NEXT:  .LBB5_1:
207; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
208; X86-NEXT:    movl (%eax), %eax
209; X86-NEXT:    retl
210;
211; X64-LABEL: test_one_q:
212; X64:       # %bb.0:
213; X64-NEXT:    movl %edi, %eax
214; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
215; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
216; X64-NEXT:    fucompi %st(1), %st
217; X64-NEXT:    fstp %st(0)
218; X64-NEXT:    wait
219; X64-NEXT:    cmovel %esi, %eax
220; X64-NEXT:    retq
221  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
222                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"one",
223                                               metadata !"fpexcept.strict") #0
224  %res = select i1 %cond, i32 %a, i32 %b
225  ret i32 %res
226}
227
228define i32 @test_ord_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
229; X86-LABEL: test_ord_q:
230; X86:       # %bb.0:
231; X86-NEXT:    fldt {{[0-9]+}}(%esp)
232; X86-NEXT:    fldt {{[0-9]+}}(%esp)
233; X86-NEXT:    fucompp
234; X86-NEXT:    wait
235; X86-NEXT:    fnstsw %ax
236; X86-NEXT:    # kill: def $ah killed $ah killed $ax
237; X86-NEXT:    sahf
238; X86-NEXT:    jnp .LBB6_1
239; X86-NEXT:  # %bb.2:
240; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
241; X86-NEXT:    movl (%eax), %eax
242; X86-NEXT:    retl
243; X86-NEXT:  .LBB6_1:
244; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
245; X86-NEXT:    movl (%eax), %eax
246; X86-NEXT:    retl
247;
248; X64-LABEL: test_ord_q:
249; X64:       # %bb.0:
250; X64-NEXT:    movl %edi, %eax
251; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
252; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
253; X64-NEXT:    fucompi %st(1), %st
254; X64-NEXT:    fstp %st(0)
255; X64-NEXT:    wait
256; X64-NEXT:    cmovpl %esi, %eax
257; X64-NEXT:    retq
258  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
259                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ord",
260                                               metadata !"fpexcept.strict") #0
261  %res = select i1 %cond, i32 %a, i32 %b
262  ret i32 %res
263}
264
265define i32 @test_ueq_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
266; X86-LABEL: test_ueq_q:
267; X86:       # %bb.0:
268; X86-NEXT:    fldt {{[0-9]+}}(%esp)
269; X86-NEXT:    fldt {{[0-9]+}}(%esp)
270; X86-NEXT:    fucompp
271; X86-NEXT:    wait
272; X86-NEXT:    fnstsw %ax
273; X86-NEXT:    # kill: def $ah killed $ah killed $ax
274; X86-NEXT:    sahf
275; X86-NEXT:    je .LBB7_1
276; X86-NEXT:  # %bb.2:
277; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
278; X86-NEXT:    movl (%eax), %eax
279; X86-NEXT:    retl
280; X86-NEXT:  .LBB7_1:
281; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
282; X86-NEXT:    movl (%eax), %eax
283; X86-NEXT:    retl
284;
285; X64-LABEL: test_ueq_q:
286; X64:       # %bb.0:
287; X64-NEXT:    movl %edi, %eax
288; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
289; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
290; X64-NEXT:    fucompi %st(1), %st
291; X64-NEXT:    fstp %st(0)
292; X64-NEXT:    wait
293; X64-NEXT:    cmovnel %esi, %eax
294; X64-NEXT:    retq
295  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
296                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ueq",
297                                               metadata !"fpexcept.strict") #0
298  %res = select i1 %cond, i32 %a, i32 %b
299  ret i32 %res
300}
301
302define i32 @test_ugt_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
303; X86-LABEL: test_ugt_q:
304; X86:       # %bb.0:
305; X86-NEXT:    fldt {{[0-9]+}}(%esp)
306; X86-NEXT:    fldt {{[0-9]+}}(%esp)
307; X86-NEXT:    fucompp
308; X86-NEXT:    wait
309; X86-NEXT:    fnstsw %ax
310; X86-NEXT:    # kill: def $ah killed $ah killed $ax
311; X86-NEXT:    sahf
312; X86-NEXT:    jb .LBB8_1
313; X86-NEXT:  # %bb.2:
314; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
315; X86-NEXT:    movl (%eax), %eax
316; X86-NEXT:    retl
317; X86-NEXT:  .LBB8_1:
318; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
319; X86-NEXT:    movl (%eax), %eax
320; X86-NEXT:    retl
321;
322; X64-LABEL: test_ugt_q:
323; X64:       # %bb.0:
324; X64-NEXT:    movl %edi, %eax
325; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
326; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
327; X64-NEXT:    fucompi %st(1), %st
328; X64-NEXT:    fstp %st(0)
329; X64-NEXT:    wait
330; X64-NEXT:    cmovael %esi, %eax
331; X64-NEXT:    retq
332  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
333                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ugt",
334                                               metadata !"fpexcept.strict") #0
335  %res = select i1 %cond, i32 %a, i32 %b
336  ret i32 %res
337}
338
339define i32 @test_uge_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
340; X86-LABEL: test_uge_q:
341; X86:       # %bb.0:
342; X86-NEXT:    fldt {{[0-9]+}}(%esp)
343; X86-NEXT:    fldt {{[0-9]+}}(%esp)
344; X86-NEXT:    fucompp
345; X86-NEXT:    wait
346; X86-NEXT:    fnstsw %ax
347; X86-NEXT:    # kill: def $ah killed $ah killed $ax
348; X86-NEXT:    sahf
349; X86-NEXT:    jbe .LBB9_1
350; X86-NEXT:  # %bb.2:
351; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
352; X86-NEXT:    movl (%eax), %eax
353; X86-NEXT:    retl
354; X86-NEXT:  .LBB9_1:
355; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
356; X86-NEXT:    movl (%eax), %eax
357; X86-NEXT:    retl
358;
359; X64-LABEL: test_uge_q:
360; X64:       # %bb.0:
361; X64-NEXT:    movl %edi, %eax
362; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
363; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
364; X64-NEXT:    fucompi %st(1), %st
365; X64-NEXT:    fstp %st(0)
366; X64-NEXT:    wait
367; X64-NEXT:    cmoval %esi, %eax
368; X64-NEXT:    retq
369  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
370                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"uge",
371                                               metadata !"fpexcept.strict") #0
372  %res = select i1 %cond, i32 %a, i32 %b
373  ret i32 %res
374}
375
376define i32 @test_ult_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
377; X86-LABEL: test_ult_q:
378; X86:       # %bb.0:
379; X86-NEXT:    fldt {{[0-9]+}}(%esp)
380; X86-NEXT:    fldt {{[0-9]+}}(%esp)
381; X86-NEXT:    fucompp
382; X86-NEXT:    wait
383; X86-NEXT:    fnstsw %ax
384; X86-NEXT:    # kill: def $ah killed $ah killed $ax
385; X86-NEXT:    sahf
386; X86-NEXT:    jb .LBB10_1
387; X86-NEXT:  # %bb.2:
388; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
389; X86-NEXT:    movl (%eax), %eax
390; X86-NEXT:    retl
391; X86-NEXT:  .LBB10_1:
392; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
393; X86-NEXT:    movl (%eax), %eax
394; X86-NEXT:    retl
395;
396; X64-LABEL: test_ult_q:
397; X64:       # %bb.0:
398; X64-NEXT:    movl %edi, %eax
399; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
400; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
401; X64-NEXT:    fucompi %st(1), %st
402; X64-NEXT:    fstp %st(0)
403; X64-NEXT:    wait
404; X64-NEXT:    cmovael %esi, %eax
405; X64-NEXT:    retq
406  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
407                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ult",
408                                               metadata !"fpexcept.strict") #0
409  %res = select i1 %cond, i32 %a, i32 %b
410  ret i32 %res
411}
412
413define i32 @test_ule_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
414; X86-LABEL: test_ule_q:
415; X86:       # %bb.0:
416; X86-NEXT:    fldt {{[0-9]+}}(%esp)
417; X86-NEXT:    fldt {{[0-9]+}}(%esp)
418; X86-NEXT:    fucompp
419; X86-NEXT:    wait
420; X86-NEXT:    fnstsw %ax
421; X86-NEXT:    # kill: def $ah killed $ah killed $ax
422; X86-NEXT:    sahf
423; X86-NEXT:    jbe .LBB11_1
424; X86-NEXT:  # %bb.2:
425; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
426; X86-NEXT:    movl (%eax), %eax
427; X86-NEXT:    retl
428; X86-NEXT:  .LBB11_1:
429; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
430; X86-NEXT:    movl (%eax), %eax
431; X86-NEXT:    retl
432;
433; X64-LABEL: test_ule_q:
434; X64:       # %bb.0:
435; X64-NEXT:    movl %edi, %eax
436; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
437; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
438; X64-NEXT:    fucompi %st(1), %st
439; X64-NEXT:    fstp %st(0)
440; X64-NEXT:    wait
441; X64-NEXT:    cmoval %esi, %eax
442; X64-NEXT:    retq
443  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
444                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ule",
445                                               metadata !"fpexcept.strict") #0
446  %res = select i1 %cond, i32 %a, i32 %b
447  ret i32 %res
448}
449
450define i32 @test_une_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
451; X86-LABEL: test_une_q:
452; X86:       # %bb.0:
453; X86-NEXT:    fldt {{[0-9]+}}(%esp)
454; X86-NEXT:    fldt {{[0-9]+}}(%esp)
455; X86-NEXT:    fucompp
456; X86-NEXT:    wait
457; X86-NEXT:    fnstsw %ax
458; X86-NEXT:    # kill: def $ah killed $ah killed $ax
459; X86-NEXT:    sahf
460; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
461; X86-NEXT:    jne .LBB12_3
462; X86-NEXT:  # %bb.1:
463; X86-NEXT:    jp .LBB12_3
464; X86-NEXT:  # %bb.2:
465; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
466; X86-NEXT:  .LBB12_3:
467; X86-NEXT:    movl (%eax), %eax
468; X86-NEXT:    retl
469;
470; X64-LABEL: test_une_q:
471; X64:       # %bb.0:
472; X64-NEXT:    movl %esi, %eax
473; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
474; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
475; X64-NEXT:    fucompi %st(1), %st
476; X64-NEXT:    fstp %st(0)
477; X64-NEXT:    wait
478; X64-NEXT:    cmovnel %edi, %eax
479; X64-NEXT:    cmovpl %edi, %eax
480; X64-NEXT:    retq
481  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
482                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"une",
483                                               metadata !"fpexcept.strict") #0
484  %res = select i1 %cond, i32 %a, i32 %b
485  ret i32 %res
486}
487
488define i32 @test_uno_q(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
489; X86-LABEL: test_uno_q:
490; X86:       # %bb.0:
491; X86-NEXT:    fldt {{[0-9]+}}(%esp)
492; X86-NEXT:    fldt {{[0-9]+}}(%esp)
493; X86-NEXT:    fucompp
494; X86-NEXT:    wait
495; X86-NEXT:    fnstsw %ax
496; X86-NEXT:    # kill: def $ah killed $ah killed $ax
497; X86-NEXT:    sahf
498; X86-NEXT:    jp .LBB13_1
499; X86-NEXT:  # %bb.2:
500; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
501; X86-NEXT:    movl (%eax), %eax
502; X86-NEXT:    retl
503; X86-NEXT:  .LBB13_1:
504; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
505; X86-NEXT:    movl (%eax), %eax
506; X86-NEXT:    retl
507;
508; X64-LABEL: test_uno_q:
509; X64:       # %bb.0:
510; X64-NEXT:    movl %edi, %eax
511; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
512; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
513; X64-NEXT:    fucompi %st(1), %st
514; X64-NEXT:    fstp %st(0)
515; X64-NEXT:    wait
516; X64-NEXT:    cmovnpl %esi, %eax
517; X64-NEXT:    retq
518  %cond = call i1 @llvm.experimental.constrained.fcmp.f80(
519                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"uno",
520                                               metadata !"fpexcept.strict") #0
521  %res = select i1 %cond, i32 %a, i32 %b
522  ret i32 %res
523}
524
525define i32 @test_oeq_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
526; X86-LABEL: test_oeq_s:
527; X86:       # %bb.0:
528; X86-NEXT:    fldt {{[0-9]+}}(%esp)
529; X86-NEXT:    fldt {{[0-9]+}}(%esp)
530; X86-NEXT:    fcompp
531; X86-NEXT:    wait
532; X86-NEXT:    fnstsw %ax
533; X86-NEXT:    # kill: def $ah killed $ah killed $ax
534; X86-NEXT:    sahf
535; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
536; X86-NEXT:    jne .LBB14_3
537; X86-NEXT:  # %bb.1:
538; X86-NEXT:    jp .LBB14_3
539; X86-NEXT:  # %bb.2:
540; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
541; X86-NEXT:  .LBB14_3:
542; X86-NEXT:    movl (%eax), %eax
543; X86-NEXT:    retl
544;
545; X64-LABEL: test_oeq_s:
546; X64:       # %bb.0:
547; X64-NEXT:    movl %edi, %eax
548; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
549; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
550; X64-NEXT:    fcompi %st(1), %st
551; X64-NEXT:    fstp %st(0)
552; X64-NEXT:    wait
553; X64-NEXT:    cmovnel %esi, %eax
554; X64-NEXT:    cmovpl %esi, %eax
555; X64-NEXT:    retq
556  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
557                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"oeq",
558                                               metadata !"fpexcept.strict") #0
559  %res = select i1 %cond, i32 %a, i32 %b
560  ret i32 %res
561}
562
563define i32 @test_ogt_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
564; X86-LABEL: test_ogt_s:
565; X86:       # %bb.0:
566; X86-NEXT:    fldt {{[0-9]+}}(%esp)
567; X86-NEXT:    fldt {{[0-9]+}}(%esp)
568; X86-NEXT:    fcompp
569; X86-NEXT:    wait
570; X86-NEXT:    fnstsw %ax
571; X86-NEXT:    # kill: def $ah killed $ah killed $ax
572; X86-NEXT:    sahf
573; X86-NEXT:    ja .LBB15_1
574; X86-NEXT:  # %bb.2:
575; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
576; X86-NEXT:    movl (%eax), %eax
577; X86-NEXT:    retl
578; X86-NEXT:  .LBB15_1:
579; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
580; X86-NEXT:    movl (%eax), %eax
581; X86-NEXT:    retl
582;
583; X64-LABEL: test_ogt_s:
584; X64:       # %bb.0:
585; X64-NEXT:    movl %edi, %eax
586; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
587; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
588; X64-NEXT:    fcompi %st(1), %st
589; X64-NEXT:    fstp %st(0)
590; X64-NEXT:    wait
591; X64-NEXT:    cmovbel %esi, %eax
592; X64-NEXT:    retq
593  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
594                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ogt",
595                                               metadata !"fpexcept.strict") #0
596  %res = select i1 %cond, i32 %a, i32 %b
597  ret i32 %res
598}
599
600define i32 @test_oge_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
601; X86-LABEL: test_oge_s:
602; X86:       # %bb.0:
603; X86-NEXT:    fldt {{[0-9]+}}(%esp)
604; X86-NEXT:    fldt {{[0-9]+}}(%esp)
605; X86-NEXT:    fcompp
606; X86-NEXT:    wait
607; X86-NEXT:    fnstsw %ax
608; X86-NEXT:    # kill: def $ah killed $ah killed $ax
609; X86-NEXT:    sahf
610; X86-NEXT:    jae .LBB16_1
611; X86-NEXT:  # %bb.2:
612; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
613; X86-NEXT:    movl (%eax), %eax
614; X86-NEXT:    retl
615; X86-NEXT:  .LBB16_1:
616; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
617; X86-NEXT:    movl (%eax), %eax
618; X86-NEXT:    retl
619;
620; X64-LABEL: test_oge_s:
621; X64:       # %bb.0:
622; X64-NEXT:    movl %edi, %eax
623; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
624; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
625; X64-NEXT:    fcompi %st(1), %st
626; X64-NEXT:    fstp %st(0)
627; X64-NEXT:    wait
628; X64-NEXT:    cmovbl %esi, %eax
629; X64-NEXT:    retq
630  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
631                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"oge",
632                                               metadata !"fpexcept.strict") #0
633  %res = select i1 %cond, i32 %a, i32 %b
634  ret i32 %res
635}
636
637define i32 @test_olt_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
638; X86-LABEL: test_olt_s:
639; X86:       # %bb.0:
640; X86-NEXT:    fldt {{[0-9]+}}(%esp)
641; X86-NEXT:    fldt {{[0-9]+}}(%esp)
642; X86-NEXT:    fcompp
643; X86-NEXT:    wait
644; X86-NEXT:    fnstsw %ax
645; X86-NEXT:    # kill: def $ah killed $ah killed $ax
646; X86-NEXT:    sahf
647; X86-NEXT:    ja .LBB17_1
648; X86-NEXT:  # %bb.2:
649; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
650; X86-NEXT:    movl (%eax), %eax
651; X86-NEXT:    retl
652; X86-NEXT:  .LBB17_1:
653; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
654; X86-NEXT:    movl (%eax), %eax
655; X86-NEXT:    retl
656;
657; X64-LABEL: test_olt_s:
658; X64:       # %bb.0:
659; X64-NEXT:    movl %edi, %eax
660; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
661; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
662; X64-NEXT:    fcompi %st(1), %st
663; X64-NEXT:    fstp %st(0)
664; X64-NEXT:    wait
665; X64-NEXT:    cmovbel %esi, %eax
666; X64-NEXT:    retq
667  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
668                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"olt",
669                                               metadata !"fpexcept.strict") #0
670  %res = select i1 %cond, i32 %a, i32 %b
671  ret i32 %res
672}
673
674define i32 @test_ole_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
675; X86-LABEL: test_ole_s:
676; X86:       # %bb.0:
677; X86-NEXT:    fldt {{[0-9]+}}(%esp)
678; X86-NEXT:    fldt {{[0-9]+}}(%esp)
679; X86-NEXT:    fcompp
680; X86-NEXT:    wait
681; X86-NEXT:    fnstsw %ax
682; X86-NEXT:    # kill: def $ah killed $ah killed $ax
683; X86-NEXT:    sahf
684; X86-NEXT:    jae .LBB18_1
685; X86-NEXT:  # %bb.2:
686; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
687; X86-NEXT:    movl (%eax), %eax
688; X86-NEXT:    retl
689; X86-NEXT:  .LBB18_1:
690; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
691; X86-NEXT:    movl (%eax), %eax
692; X86-NEXT:    retl
693;
694; X64-LABEL: test_ole_s:
695; X64:       # %bb.0:
696; X64-NEXT:    movl %edi, %eax
697; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
698; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
699; X64-NEXT:    fcompi %st(1), %st
700; X64-NEXT:    fstp %st(0)
701; X64-NEXT:    wait
702; X64-NEXT:    cmovbl %esi, %eax
703; X64-NEXT:    retq
704  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
705                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ole",
706                                               metadata !"fpexcept.strict") #0
707  %res = select i1 %cond, i32 %a, i32 %b
708  ret i32 %res
709}
710
711define i32 @test_one_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
712; X86-LABEL: test_one_s:
713; X86:       # %bb.0:
714; X86-NEXT:    fldt {{[0-9]+}}(%esp)
715; X86-NEXT:    fldt {{[0-9]+}}(%esp)
716; X86-NEXT:    fcompp
717; X86-NEXT:    wait
718; X86-NEXT:    fnstsw %ax
719; X86-NEXT:    # kill: def $ah killed $ah killed $ax
720; X86-NEXT:    sahf
721; X86-NEXT:    jne .LBB19_1
722; X86-NEXT:  # %bb.2:
723; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
724; X86-NEXT:    movl (%eax), %eax
725; X86-NEXT:    retl
726; X86-NEXT:  .LBB19_1:
727; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
728; X86-NEXT:    movl (%eax), %eax
729; X86-NEXT:    retl
730;
731; X64-LABEL: test_one_s:
732; X64:       # %bb.0:
733; X64-NEXT:    movl %edi, %eax
734; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
735; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
736; X64-NEXT:    fcompi %st(1), %st
737; X64-NEXT:    fstp %st(0)
738; X64-NEXT:    wait
739; X64-NEXT:    cmovel %esi, %eax
740; X64-NEXT:    retq
741  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
742                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"one",
743                                               metadata !"fpexcept.strict") #0
744  %res = select i1 %cond, i32 %a, i32 %b
745  ret i32 %res
746}
747
748define i32 @test_ord_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
749; X86-LABEL: test_ord_s:
750; X86:       # %bb.0:
751; X86-NEXT:    fldt {{[0-9]+}}(%esp)
752; X86-NEXT:    fldt {{[0-9]+}}(%esp)
753; X86-NEXT:    fcompp
754; X86-NEXT:    wait
755; X86-NEXT:    fnstsw %ax
756; X86-NEXT:    # kill: def $ah killed $ah killed $ax
757; X86-NEXT:    sahf
758; X86-NEXT:    jnp .LBB20_1
759; X86-NEXT:  # %bb.2:
760; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
761; X86-NEXT:    movl (%eax), %eax
762; X86-NEXT:    retl
763; X86-NEXT:  .LBB20_1:
764; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
765; X86-NEXT:    movl (%eax), %eax
766; X86-NEXT:    retl
767;
768; X64-LABEL: test_ord_s:
769; X64:       # %bb.0:
770; X64-NEXT:    movl %edi, %eax
771; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
772; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
773; X64-NEXT:    fcompi %st(1), %st
774; X64-NEXT:    fstp %st(0)
775; X64-NEXT:    wait
776; X64-NEXT:    cmovpl %esi, %eax
777; X64-NEXT:    retq
778  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
779                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ord",
780                                               metadata !"fpexcept.strict") #0
781  %res = select i1 %cond, i32 %a, i32 %b
782  ret i32 %res
783}
784
785define i32 @test_ueq_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
786; X86-LABEL: test_ueq_s:
787; X86:       # %bb.0:
788; X86-NEXT:    fldt {{[0-9]+}}(%esp)
789; X86-NEXT:    fldt {{[0-9]+}}(%esp)
790; X86-NEXT:    fcompp
791; X86-NEXT:    wait
792; X86-NEXT:    fnstsw %ax
793; X86-NEXT:    # kill: def $ah killed $ah killed $ax
794; X86-NEXT:    sahf
795; X86-NEXT:    je .LBB21_1
796; X86-NEXT:  # %bb.2:
797; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
798; X86-NEXT:    movl (%eax), %eax
799; X86-NEXT:    retl
800; X86-NEXT:  .LBB21_1:
801; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
802; X86-NEXT:    movl (%eax), %eax
803; X86-NEXT:    retl
804;
805; X64-LABEL: test_ueq_s:
806; X64:       # %bb.0:
807; X64-NEXT:    movl %edi, %eax
808; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
809; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
810; X64-NEXT:    fcompi %st(1), %st
811; X64-NEXT:    fstp %st(0)
812; X64-NEXT:    wait
813; X64-NEXT:    cmovnel %esi, %eax
814; X64-NEXT:    retq
815  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
816                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ueq",
817                                               metadata !"fpexcept.strict") #0
818  %res = select i1 %cond, i32 %a, i32 %b
819  ret i32 %res
820}
821
822define i32 @test_ugt_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
823; X86-LABEL: test_ugt_s:
824; X86:       # %bb.0:
825; X86-NEXT:    fldt {{[0-9]+}}(%esp)
826; X86-NEXT:    fldt {{[0-9]+}}(%esp)
827; X86-NEXT:    fcompp
828; X86-NEXT:    wait
829; X86-NEXT:    fnstsw %ax
830; X86-NEXT:    # kill: def $ah killed $ah killed $ax
831; X86-NEXT:    sahf
832; X86-NEXT:    jb .LBB22_1
833; X86-NEXT:  # %bb.2:
834; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
835; X86-NEXT:    movl (%eax), %eax
836; X86-NEXT:    retl
837; X86-NEXT:  .LBB22_1:
838; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
839; X86-NEXT:    movl (%eax), %eax
840; X86-NEXT:    retl
841;
842; X64-LABEL: test_ugt_s:
843; X64:       # %bb.0:
844; X64-NEXT:    movl %edi, %eax
845; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
846; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
847; X64-NEXT:    fcompi %st(1), %st
848; X64-NEXT:    fstp %st(0)
849; X64-NEXT:    wait
850; X64-NEXT:    cmovael %esi, %eax
851; X64-NEXT:    retq
852  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
853                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ugt",
854                                               metadata !"fpexcept.strict") #0
855  %res = select i1 %cond, i32 %a, i32 %b
856  ret i32 %res
857}
858
859define i32 @test_uge_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
860; X86-LABEL: test_uge_s:
861; X86:       # %bb.0:
862; X86-NEXT:    fldt {{[0-9]+}}(%esp)
863; X86-NEXT:    fldt {{[0-9]+}}(%esp)
864; X86-NEXT:    fcompp
865; X86-NEXT:    wait
866; X86-NEXT:    fnstsw %ax
867; X86-NEXT:    # kill: def $ah killed $ah killed $ax
868; X86-NEXT:    sahf
869; X86-NEXT:    jbe .LBB23_1
870; X86-NEXT:  # %bb.2:
871; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
872; X86-NEXT:    movl (%eax), %eax
873; X86-NEXT:    retl
874; X86-NEXT:  .LBB23_1:
875; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
876; X86-NEXT:    movl (%eax), %eax
877; X86-NEXT:    retl
878;
879; X64-LABEL: test_uge_s:
880; X64:       # %bb.0:
881; X64-NEXT:    movl %edi, %eax
882; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
883; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
884; X64-NEXT:    fcompi %st(1), %st
885; X64-NEXT:    fstp %st(0)
886; X64-NEXT:    wait
887; X64-NEXT:    cmoval %esi, %eax
888; X64-NEXT:    retq
889  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
890                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"uge",
891                                               metadata !"fpexcept.strict") #0
892  %res = select i1 %cond, i32 %a, i32 %b
893  ret i32 %res
894}
895
896define i32 @test_ult_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
897; X86-LABEL: test_ult_s:
898; X86:       # %bb.0:
899; X86-NEXT:    fldt {{[0-9]+}}(%esp)
900; X86-NEXT:    fldt {{[0-9]+}}(%esp)
901; X86-NEXT:    fcompp
902; X86-NEXT:    wait
903; X86-NEXT:    fnstsw %ax
904; X86-NEXT:    # kill: def $ah killed $ah killed $ax
905; X86-NEXT:    sahf
906; X86-NEXT:    jb .LBB24_1
907; X86-NEXT:  # %bb.2:
908; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
909; X86-NEXT:    movl (%eax), %eax
910; X86-NEXT:    retl
911; X86-NEXT:  .LBB24_1:
912; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
913; X86-NEXT:    movl (%eax), %eax
914; X86-NEXT:    retl
915;
916; X64-LABEL: test_ult_s:
917; X64:       # %bb.0:
918; X64-NEXT:    movl %edi, %eax
919; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
920; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
921; X64-NEXT:    fcompi %st(1), %st
922; X64-NEXT:    fstp %st(0)
923; X64-NEXT:    wait
924; X64-NEXT:    cmovael %esi, %eax
925; X64-NEXT:    retq
926  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
927                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ult",
928                                               metadata !"fpexcept.strict") #0
929  %res = select i1 %cond, i32 %a, i32 %b
930  ret i32 %res
931}
932
933define i32 @test_ule_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
934; X86-LABEL: test_ule_s:
935; X86:       # %bb.0:
936; X86-NEXT:    fldt {{[0-9]+}}(%esp)
937; X86-NEXT:    fldt {{[0-9]+}}(%esp)
938; X86-NEXT:    fcompp
939; X86-NEXT:    wait
940; X86-NEXT:    fnstsw %ax
941; X86-NEXT:    # kill: def $ah killed $ah killed $ax
942; X86-NEXT:    sahf
943; X86-NEXT:    jbe .LBB25_1
944; X86-NEXT:  # %bb.2:
945; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
946; X86-NEXT:    movl (%eax), %eax
947; X86-NEXT:    retl
948; X86-NEXT:  .LBB25_1:
949; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
950; X86-NEXT:    movl (%eax), %eax
951; X86-NEXT:    retl
952;
953; X64-LABEL: test_ule_s:
954; X64:       # %bb.0:
955; X64-NEXT:    movl %edi, %eax
956; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
957; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
958; X64-NEXT:    fcompi %st(1), %st
959; X64-NEXT:    fstp %st(0)
960; X64-NEXT:    wait
961; X64-NEXT:    cmoval %esi, %eax
962; X64-NEXT:    retq
963  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
964                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"ule",
965                                               metadata !"fpexcept.strict") #0
966  %res = select i1 %cond, i32 %a, i32 %b
967  ret i32 %res
968}
969
970define i32 @test_une_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
971; X86-LABEL: test_une_s:
972; X86:       # %bb.0:
973; X86-NEXT:    fldt {{[0-9]+}}(%esp)
974; X86-NEXT:    fldt {{[0-9]+}}(%esp)
975; X86-NEXT:    fcompp
976; X86-NEXT:    wait
977; X86-NEXT:    fnstsw %ax
978; X86-NEXT:    # kill: def $ah killed $ah killed $ax
979; X86-NEXT:    sahf
980; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
981; X86-NEXT:    jne .LBB26_3
982; X86-NEXT:  # %bb.1:
983; X86-NEXT:    jp .LBB26_3
984; X86-NEXT:  # %bb.2:
985; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
986; X86-NEXT:  .LBB26_3:
987; X86-NEXT:    movl (%eax), %eax
988; X86-NEXT:    retl
989;
990; X64-LABEL: test_une_s:
991; X64:       # %bb.0:
992; X64-NEXT:    movl %esi, %eax
993; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
994; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
995; X64-NEXT:    fcompi %st(1), %st
996; X64-NEXT:    fstp %st(0)
997; X64-NEXT:    wait
998; X64-NEXT:    cmovnel %edi, %eax
999; X64-NEXT:    cmovpl %edi, %eax
1000; X64-NEXT:    retq
1001  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
1002                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"une",
1003                                               metadata !"fpexcept.strict") #0
1004  %res = select i1 %cond, i32 %a, i32 %b
1005  ret i32 %res
1006}
1007
1008define i32 @test_uno_s(i32 %a, i32 %b, x86_fp80 %f1, x86_fp80 %f2) #0 {
1009; X86-LABEL: test_uno_s:
1010; X86:       # %bb.0:
1011; X86-NEXT:    fldt {{[0-9]+}}(%esp)
1012; X86-NEXT:    fldt {{[0-9]+}}(%esp)
1013; X86-NEXT:    fcompp
1014; X86-NEXT:    wait
1015; X86-NEXT:    fnstsw %ax
1016; X86-NEXT:    # kill: def $ah killed $ah killed $ax
1017; X86-NEXT:    sahf
1018; X86-NEXT:    jp .LBB27_1
1019; X86-NEXT:  # %bb.2:
1020; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
1021; X86-NEXT:    movl (%eax), %eax
1022; X86-NEXT:    retl
1023; X86-NEXT:  .LBB27_1:
1024; X86-NEXT:    leal {{[0-9]+}}(%esp), %eax
1025; X86-NEXT:    movl (%eax), %eax
1026; X86-NEXT:    retl
1027;
1028; X64-LABEL: test_uno_s:
1029; X64:       # %bb.0:
1030; X64-NEXT:    movl %edi, %eax
1031; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
1032; X64-NEXT:    fldt {{[0-9]+}}(%rsp)
1033; X64-NEXT:    fcompi %st(1), %st
1034; X64-NEXT:    fstp %st(0)
1035; X64-NEXT:    wait
1036; X64-NEXT:    cmovnpl %esi, %eax
1037; X64-NEXT:    retq
1038  %cond = call i1 @llvm.experimental.constrained.fcmps.f80(
1039                                               x86_fp80 %f1, x86_fp80 %f2, metadata !"uno",
1040                                               metadata !"fpexcept.strict") #0
1041  %res = select i1 %cond, i32 %a, i32 %b
1042  ret i32 %res
1043}
1044
1045attributes #0 = { strictfp }
1046
1047declare i1 @llvm.experimental.constrained.fcmp.f80(x86_fp80, x86_fp80, metadata, metadata)
1048declare i1 @llvm.experimental.constrained.fcmps.f80(x86_fp80, x86_fp80, metadata, metadata)
1049