blob: 55efffa34ff5f47a02a5f74aa0344afb46af6971 [file] [log] [blame]
Evan Chengce707522008-10-14 18:13:38 +00001; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep fcmp | count 3
Evan Cheng67786cc2008-10-14 17:15:11 +00002; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret | grep 0
3
4define zeroext i8 @t1(float %x, float %y) nounwind {
5 %a = fcmp ueq float %x, %y
6 %b = fcmp ord float %x, %y
7 %c = and 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
14 %b = fcmp ord float %x, %y
15 %c = and 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 oge float %x, %y
22 %b = fcmp uno float %x, %y
23 %c = and i1 %a, %b
24 %retval = zext i1 %c to i8
25 ret i8 %retval
26}
Evan Chengce707522008-10-14 18:13:38 +000027
28define zeroext i8 @t4(float %x, float %y) nounwind {
29 %a = fcmp one float %y, %x
30 %b = fcmp ord float %x, %y
31 %c = and i1 %a, %b
32 %retval = zext i1 %c to i8
33 ret i8 %retval
34}