blob: 9692bfcc597030cc368205414df7c7d92ea823f8 [file] [log] [blame]
Dan Gohman72a13d22009-09-08 22:34:10 +00001; RUN: opt < %s -instcombine -S | grep fcmp | count 3
2; RUN: opt < %s -instcombine -S | grep ret | grep 1
Evan Chengd885f6e2008-10-14 18:44:08 +00003
4define zeroext i8 @t1(float %x, float %y) nounwind {
5 %a = fcmp ueq float %x, %y ; <i1> [#uses=1]
6 %b = fcmp uno float %x, %y ; <i1> [#uses=1]
7 %c = or i1 %a, %b
8 %retval = zext i1 %c to i8
9 ret i8 %retval
10}
11
12define zeroext i8 @t2(float %x, float %y) nounwind {
13 %a = fcmp olt float %x, %y ; <i1> [#uses=1]
14 %b = fcmp oeq float %x, %y ; <i1> [#uses=1]
15 %c = or i1 %a, %b
16 %retval = zext i1 %c to i8
17 ret i8 %retval
18}
19
20define zeroext i8 @t3(float %x, float %y) nounwind {
21 %a = fcmp ult float %x, %y ; <i1> [#uses=1]
22 %b = fcmp uge float %x, %y ; <i1> [#uses=1]
23 %c = or i1 %a, %b
24 %retval = zext i1 %c to i8
25 ret i8 %retval
26}
27
28define zeroext i8 @t4(float %x, float %y) nounwind {
29 %a = fcmp ult float %x, %y ; <i1> [#uses=1]
30 %b = fcmp ugt float %x, %y ; <i1> [#uses=1]
31 %c = or i1 %a, %b
32 %retval = zext i1 %c to i8
33 ret i8 %retval
34}