2016-02-15 21:41:41 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2014-10-03 10:06:28 +08:00
|
|
|
; RUN: llc < %s -mtriple=i386-unknown-unknown -march=x86 -mattr=+sse2 | FileCheck %s
|
2009-01-20 08:16:18 +08:00
|
|
|
|
2011-08-30 05:15:46 +08:00
|
|
|
; rdar://6504833
|
|
|
|
define float @test1(i32 %x) nounwind readnone {
|
2014-10-03 09:44:04 +08:00
|
|
|
; CHECK-LABEL: test1:
|
|
|
|
; CHECK: # BB#0: # %entry
|
|
|
|
; CHECK-NEXT: pushl %eax
|
2016-02-15 21:41:41 +08:00
|
|
|
; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
|
|
|
|
; CHECK-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
|
2015-02-04 18:58:53 +08:00
|
|
|
; CHECK-NEXT: orpd %xmm0, %xmm1
|
2014-10-03 09:44:04 +08:00
|
|
|
; CHECK-NEXT: subsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: cvtsd2ss %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movss %xmm0, (%esp)
|
|
|
|
; CHECK-NEXT: flds (%esp)
|
|
|
|
; CHECK-NEXT: popl %eax
|
|
|
|
; CHECK-NEXT: retl
|
2009-01-20 08:16:18 +08:00
|
|
|
entry:
|
2016-02-15 21:41:41 +08:00
|
|
|
%0 = uitofp i32 %x to float
|
|
|
|
ret float %0
|
2009-01-20 08:16:18 +08:00
|
|
|
}
|
2011-08-30 05:15:46 +08:00
|
|
|
|
|
|
|
; PR10802
|
|
|
|
define float @test2(<4 x i32> %x) nounwind readnone ssp {
|
2014-10-03 09:44:04 +08:00
|
|
|
; CHECK-LABEL: test2:
|
|
|
|
; CHECK: # BB#0: # %entry
|
|
|
|
; CHECK-NEXT: pushl %eax
|
|
|
|
; CHECK-NEXT: xorps %xmm1, %xmm1
|
2016-02-15 21:41:41 +08:00
|
|
|
; CHECK-NEXT: movss {{.*#+}} xmm1 = xmm0[0],xmm1[1,2,3]
|
|
|
|
; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
|
2014-10-03 09:44:04 +08:00
|
|
|
; CHECK-NEXT: orps %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: subsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: cvtsd2ss %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: movss %xmm0, (%esp)
|
|
|
|
; CHECK-NEXT: flds (%esp)
|
|
|
|
; CHECK-NEXT: popl %eax
|
|
|
|
; CHECK-NEXT: retl
|
2011-08-30 05:15:46 +08:00
|
|
|
entry:
|
|
|
|
%vecext = extractelement <4 x i32> %x, i32 0
|
|
|
|
%conv = uitofp i32 %vecext to float
|
|
|
|
ret float %conv
|
|
|
|
}
|