1; RUN: llc < %s -mtriple=x86_64-pc-unknown -mattr=+sse2 | FileCheck %s 2; RUN: llc < %s -mtriple=i686-pc-unknown -mattr=+sse2 | FileCheck %s 3 4; PR19059 5; RUN: llc < %s -mtriple=i686-pc-unknown -mattr=+sse2 | FileCheck -check-prefix=CHECK32 %s 6 7define i32 @isint_return(double %d) nounwind { 8; CHECK-LABEL: isint_return: 9; CHECK-NOT: xor 10; CHECK: cvt 11 %i = fptosi double %d to i32 12; CHECK-NEXT: cvt 13 %e = sitofp i32 %i to double 14; CHECK: cmpeqsd 15 %c = fcmp oeq double %d, %e 16; CHECK32-NOT: movd {{.*}}, %r{{.*}} 17; CHECK32-NOT: andq 18; CHECK-NEXT: movd 19; CHECK-NEXT: andl 20 %z = zext i1 %c to i32 21 ret i32 %z 22} 23 24define i32 @isint_float_return(float %f) nounwind { 25; CHECK-LABEL: isint_float_return: 26; CHECK-NOT: xor 27; CHECK: cvt 28 %i = fptosi float %f to i32 29; CHECK-NEXT: cvt 30 %g = sitofp i32 %i to float 31; CHECK: cmpeqss 32 %c = fcmp oeq float %f, %g 33; CHECK-NOT: movd {{.*}}, %r{{.*}} 34; CHECK-NEXT: movd 35; CHECK-NEXT: andl 36 %z = zext i1 %c to i32 37 ret i32 %z 38} 39 40declare void @foo() 41 42define void @isint_branch(double %d) nounwind { 43; CHECK-LABEL: isint_branch: 44; CHECK: cvt 45 %i = fptosi double %d to i32 46; CHECK-NEXT: cvt 47 %e = sitofp i32 %i to double 48; CHECK: ucomisd 49 %c = fcmp oeq double %d, %e 50; CHECK-NEXT: jne 51; CHECK-NEXT: jp 52 br i1 %c, label %true, label %false 53true: 54 call void @foo() 55 ret void 56false: 57 ret void 58} 59