diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-03-23 22:18:48 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-03-23 22:18:48 +0000 |
commit | b141099c14bfa86167b2137e8a9544c6ee805955 (patch) | |
tree | 288d96908630b227b41cfe0dec0723ca2711fe20 /test | |
parent | d8fa01fbd7f32e2e1f17c9adb57899baae1d0cfe (diff) | |
download | external_llvm-b141099c14bfa86167b2137e8a9544c6ee805955.zip external_llvm-b141099c14bfa86167b2137e8a9544c6ee805955.tar.gz external_llvm-b141099c14bfa86167b2137e8a9544c6ee805955.tar.bz2 |
PR9535: add support for splitting and scalarizing vector ISD::FP_ROUND.
Also cleaning up some duplicated code while I'm here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/fp-trunc.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fp-trunc.ll b/test/CodeGen/X86/fp-trunc.ll new file mode 100644 index 0000000..4fe78ec --- /dev/null +++ b/test/CodeGen/X86/fp-trunc.ll @@ -0,0 +1,35 @@ +; RUN: llc < %s -march=x86 -mattr=+sse2,-avx + +define <1 x float> @test1(<1 x double> %x) nounwind { +; CHECK: cvtsd2ss +; CHECK: 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 { +; FIXME: It would be nice if this compiled down to a cvtpd2ps +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: ret + %y = fptrunc <2 x double> %x to <2 x float> + ret <2 x float> %y +} + +define <8 x float> @test3(<8 x double> %x) nounwind { +; FIXME: It would be nice if this compiled down to a series of cvtpd2ps +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: cvtsd2ss +; CHECK: ret + %y = fptrunc <8 x double> %x to <8 x float> + ret <8 x float> %y +} + + |