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