blob: 9aa44a30af5750a568d636446e7bb063c7025d5e [file] [log] [blame]
Dan Gohman11eab022009-09-26 15:24:17 +00001; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3; Convert oeq and une to ole/oge/ule/uge when comparing with infinity
4; and negative infinity, because those are more efficient on x86.
5
6; CHECK: oeq_inff:
7; CHECK: ucomiss
Evan Cheng44be1a82010-09-20 22:52:00 +00008; CHECK: jb
Dan Gohman11eab022009-09-26 15:24:17 +00009define float @oeq_inff(float %x, float %y) nounwind readonly {
10 %t0 = fcmp oeq float %x, 0x7FF0000000000000
11 %t1 = select i1 %t0, float 1.0, float %y
12 ret float %t1
13}
14
15; CHECK: oeq_inf:
16; CHECK: ucomisd
Evan Cheng44be1a82010-09-20 22:52:00 +000017; CHECK: jb
Dan Gohman11eab022009-09-26 15:24:17 +000018define double @oeq_inf(double %x, double %y) nounwind readonly {
19 %t0 = fcmp oeq double %x, 0x7FF0000000000000
20 %t1 = select i1 %t0, double 1.0, double %y
21 ret double %t1
22}
23
24; CHECK: une_inff:
25; CHECK: ucomiss
Evan Cheng44be1a82010-09-20 22:52:00 +000026; CHECK: jae
Dan Gohman11eab022009-09-26 15:24:17 +000027define float @une_inff(float %x, float %y) nounwind readonly {
28 %t0 = fcmp une float %x, 0x7FF0000000000000
29 %t1 = select i1 %t0, float 1.0, float %y
30 ret float %t1
31}
32
33; CHECK: une_inf:
34; CHECK: ucomisd
Evan Cheng44be1a82010-09-20 22:52:00 +000035; CHECK: jae
Dan Gohman11eab022009-09-26 15:24:17 +000036define double @une_inf(double %x, double %y) nounwind readonly {
37 %t0 = fcmp une double %x, 0x7FF0000000000000
38 %t1 = select i1 %t0, double 1.0, double %y
39 ret double %t1
40}
41
42; CHECK: oeq_neg_inff:
43; CHECK: ucomiss
Evan Cheng44be1a82010-09-20 22:52:00 +000044; CHECK: jb
Dan Gohman11eab022009-09-26 15:24:17 +000045define float @oeq_neg_inff(float %x, float %y) nounwind readonly {
46 %t0 = fcmp oeq float %x, 0xFFF0000000000000
47 %t1 = select i1 %t0, float 1.0, float %y
48 ret float %t1
49}
50
51; CHECK: oeq_neg_inf:
52; CHECK: ucomisd
Evan Cheng44be1a82010-09-20 22:52:00 +000053; CHECK: jb
Dan Gohman11eab022009-09-26 15:24:17 +000054define double @oeq_neg_inf(double %x, double %y) nounwind readonly {
55 %t0 = fcmp oeq double %x, 0xFFF0000000000000
56 %t1 = select i1 %t0, double 1.0, double %y
57 ret double %t1
58}
59
60; CHECK: une_neg_inff:
61; CHECK: ucomiss
Evan Cheng44be1a82010-09-20 22:52:00 +000062; CHECK: jae
Dan Gohman11eab022009-09-26 15:24:17 +000063define float @une_neg_inff(float %x, float %y) nounwind readonly {
64 %t0 = fcmp une float %x, 0xFFF0000000000000
65 %t1 = select i1 %t0, float 1.0, float %y
66 ret float %t1
67}
68
69; CHECK: une_neg_inf:
70; CHECK: ucomisd
Evan Cheng44be1a82010-09-20 22:52:00 +000071; CHECK: jae
Dan Gohman11eab022009-09-26 15:24:17 +000072define double @une_neg_inf(double %x, double %y) nounwind readonly {
73 %t0 = fcmp une double %x, 0xFFF0000000000000
74 %t1 = select i1 %t0, double 1.0, double %y
75 ret double %t1
76}