blob: 4a98e63f38fc92f487befc747c59eb03a4b65f98 [file] [log] [blame]
Stuart Hastings865f0932011-06-03 23:53:54 +00001; RUN: llc < %s -march=x86 -mattr=+sse2 | FileCheck %s
Dan Gohman279c22e2008-10-21 03:29:32 +00002
3define i32 @isint_return(double %d) nounwind {
Stuart Hastings865f0932011-06-03 23:53:54 +00004; CHECK-NOT: xor
5; CHECK: cvt
Dan Gohman279c22e2008-10-21 03:29:32 +00006 %i = fptosi double %d to i32
Stuart Hastings865f0932011-06-03 23:53:54 +00007; CHECK-NEXT: cvt
Dan Gohman279c22e2008-10-21 03:29:32 +00008 %e = sitofp i32 %i to double
Stuart Hastings865f0932011-06-03 23:53:54 +00009; CHECK: cmpeqsd
Dan Gohman279c22e2008-10-21 03:29:32 +000010 %c = fcmp oeq double %d, %e
Stuart Hastings865f0932011-06-03 23:53:54 +000011; CHECK-NEXT: movd
12; CHECK-NEXT: andl
Dan Gohman279c22e2008-10-21 03:29:32 +000013 %z = zext i1 %c to i32
14 ret i32 %z
15}
16
17declare void @foo()
18
19define void @isint_branch(double %d) nounwind {
Stuart Hastings865f0932011-06-03 23:53:54 +000020; CHECK: cvt
Dan Gohman279c22e2008-10-21 03:29:32 +000021 %i = fptosi double %d to i32
Stuart Hastings865f0932011-06-03 23:53:54 +000022; CHECK-NEXT: cvt
Dan Gohman279c22e2008-10-21 03:29:32 +000023 %e = sitofp i32 %i to double
Stuart Hastings865f0932011-06-03 23:53:54 +000024; CHECK: ucomisd
Dan Gohman279c22e2008-10-21 03:29:32 +000025 %c = fcmp oeq double %d, %e
Stuart Hastings865f0932011-06-03 23:53:54 +000026; CHECK-NEXT: jne
27; CHECK-NEXT: jp
Dan Gohman279c22e2008-10-21 03:29:32 +000028 br i1 %c, label %true, label %false
29true:
30 call void @foo()
31 ret void
32false:
33 ret void
34}