2012-10-10 18:04:52 +00:00
|
|
|
; RUN: llc < %s -march=x86 -mcpu=corei7 | FileCheck %s
|
|
|
|
; RUN: llc < %s -march=x86 -mcpu=core-avx-i | FileCheck %s --check-prefix=AVX
|
2011-03-23 22:18:48 +00:00
|
|
|
|
|
|
|
define <1 x float> @test1(<1 x double> %x) nounwind {
|
2012-10-10 16:53:28 +00:00
|
|
|
; CHECK: test1
|
2011-03-23 22:18:48 +00:00
|
|
|
; CHECK: cvtsd2ss
|
|
|
|
; CHECK: ret
|
2012-10-10 16:53:28 +00:00
|
|
|
; AVX: test1
|
|
|
|
; AVX: vcvtsd2ss
|
|
|
|
; AVX: ret
|
2011-03-23 22:18:48 +00:00
|
|
|
%y = fptrunc <1 x double> %x to <1 x float>
|
|
|
|
ret <1 x float> %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x float> @test2(<2 x double> %x) nounwind {
|
2012-10-10 16:53:28 +00:00
|
|
|
; CHECK: test2
|
|
|
|
; CHECK: cvtpd2ps
|
2011-03-23 22:18:48 +00:00
|
|
|
; CHECK: ret
|
2012-10-10 16:53:28 +00:00
|
|
|
; AVX: test2
|
|
|
|
; AVX-NOT: vcvtpd2psy
|
|
|
|
; AVX: vcvtpd2ps
|
|
|
|
; AVX: ret
|
2011-03-23 22:18:48 +00:00
|
|
|
%y = fptrunc <2 x double> %x to <2 x float>
|
|
|
|
ret <2 x float> %y
|
|
|
|
}
|
|
|
|
|
2012-10-10 16:53:28 +00:00
|
|
|
define <4 x float> @test3(<4 x double> %x) nounwind {
|
|
|
|
; CHECK: test3
|
|
|
|
; CHECK: cvtpd2ps
|
|
|
|
; CHECK: cvtpd2ps
|
|
|
|
; CHECK: movlhps
|
|
|
|
; CHECK: ret
|
|
|
|
; AVX: test3
|
|
|
|
; AVX: vcvtpd2psy
|
|
|
|
; AVX: ret
|
|
|
|
%y = fptrunc <4 x double> %x to <4 x float>
|
|
|
|
ret <4 x float> %y
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x float> @test4(<8 x double> %x) nounwind {
|
|
|
|
; CHECK: test4
|
|
|
|
; CHECK: cvtpd2ps
|
|
|
|
; CHECK: cvtpd2ps
|
|
|
|
; CHECK: movlhps
|
|
|
|
; CHECK: cvtpd2ps
|
|
|
|
; CHECK: cvtpd2ps
|
|
|
|
; CHECK: movlhps
|
2011-03-23 22:18:48 +00:00
|
|
|
; CHECK: ret
|
2012-10-10 16:53:28 +00:00
|
|
|
; AVX: test4
|
|
|
|
; AVX: vcvtpd2psy
|
|
|
|
; AVX: vcvtpd2psy
|
|
|
|
; AVX: vinsertf128
|
|
|
|
; AVX: ret
|
2011-03-23 22:18:48 +00:00
|
|
|
%y = fptrunc <8 x double> %x to <8 x float>
|
|
|
|
ret <8 x float> %y
|
|
|
|
}
|
|
|
|
|
|
|
|
|