• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=i386-unknown-unknown -march=x86 -mattr=+sse2 | FileCheck %s
2
3; rdar://6504833
4define float @test1(i32 %x) nounwind readnone {
5; CHECK-LABEL: test1:
6; CHECK:       # BB#0: # %entry
7; CHECK-NEXT:    pushl %eax
8; CHECK-NEXT:    movsd .LCPI0_0, %xmm0
9; CHECK-NEXT:    movd {{[0-9]+}}(%esp), %xmm1
10; CHECK-NEXT:    orpd %xmm0, %xmm1
11; CHECK-NEXT:    subsd %xmm0, %xmm1
12; CHECK-NEXT:    xorps %xmm0, %xmm0
13; CHECK-NEXT:    cvtsd2ss %xmm1, %xmm0
14; CHECK-NEXT:    movss %xmm0, (%esp)
15; CHECK-NEXT:    flds (%esp)
16; CHECK-NEXT:    popl %eax
17; CHECK-NEXT:    retl
18entry:
19	%0 = uitofp i32 %x to float
20	ret float %0
21}
22
23; PR10802
24define float @test2(<4 x i32> %x) nounwind readnone ssp {
25; CHECK-LABEL: test2:
26; CHECK:       # BB#0: # %entry
27; CHECK-NEXT:    pushl %eax
28; CHECK-NEXT:    xorps %xmm1, %xmm1
29; CHECK-NEXT:    movss %xmm0, %xmm1
30; CHECK-NEXT:    movsd .LCPI1_0, %xmm0
31; CHECK-NEXT:    orps %xmm0, %xmm1
32; CHECK-NEXT:    subsd %xmm0, %xmm1
33; CHECK-NEXT:    xorps %xmm0, %xmm0
34; CHECK-NEXT:    cvtsd2ss %xmm1, %xmm0
35; CHECK-NEXT:    movss %xmm0, (%esp)
36; CHECK-NEXT:    flds (%esp)
37; CHECK-NEXT:    popl %eax
38; CHECK-NEXT:    retl
39entry:
40  %vecext = extractelement <4 x i32> %x, i32 0
41  %conv = uitofp i32 %vecext to float
42  ret float %conv
43}
44