mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 17:31:50 +00:00
4e2c56bdcb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165638 91177308-0d34-0410-b5e6-96231b3b80d8
59 lines
1.2 KiB
LLVM
59 lines
1.2 KiB
LLVM
; RUN: llc < %s -march=x86 -mcpu=corei7 | FileCheck %s
|
|
; RUN: llc < %s -march=x86 -mcpu=core-avx-i | FileCheck %s --check-prefix=AVX
|
|
|
|
define <1 x float> @test1(<1 x double> %x) nounwind {
|
|
; CHECK: test1
|
|
; CHECK: cvtsd2ss
|
|
; CHECK: ret
|
|
; AVX: test1
|
|
; AVX: vcvtsd2ss
|
|
; AVX: ret
|
|
%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 {
|
|
; CHECK: test2
|
|
; CHECK: cvtpd2ps
|
|
; CHECK: ret
|
|
; AVX: test2
|
|
; AVX-NOT: vcvtpd2psy
|
|
; AVX: vcvtpd2ps
|
|
; AVX: ret
|
|
%y = fptrunc <2 x double> %x to <2 x float>
|
|
ret <2 x float> %y
|
|
}
|
|
|
|
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
|
|
; CHECK: ret
|
|
; AVX: test4
|
|
; AVX: vcvtpd2psy
|
|
; AVX: vcvtpd2psy
|
|
; AVX: vinsertf128
|
|
; AVX: ret
|
|
%y = fptrunc <8 x double> %x to <8 x float>
|
|
ret <8 x float> %y
|
|
}
|
|
|
|
|