From ae4f7421c0a6ba7fdf5dc6ad8d4c1c61ba6d98c3 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Thu, 9 Sep 2010 18:48:34 +0000 Subject: [PATCH] Add one more pattern to fallback movddup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113522 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 2 ++ test/CodeGen/X86/vec_shuffle-37.ll | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 88b60229b2c..eed685d84b4 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -5688,6 +5688,8 @@ def : Pat<(v2i64 (X86Movddup VR128:$src)), (MOVLHPSrr VR128:$src, VR128:$src)>; def : Pat<(v4f32 (X86Movddup VR128:$src)), (MOVLHPSrr VR128:$src, VR128:$src)>; +def : Pat<(v2f64 (X86Movddup VR128:$src)), + (UNPCKLPDrr VR128:$src, VR128:$src)>; // Shuffle with MOVLHPD def : Pat<(v2f64 (X86Movlhpd VR128:$src1, diff --git a/test/CodeGen/X86/vec_shuffle-37.ll b/test/CodeGen/X86/vec_shuffle-37.ll index 1ed858de64e..b09093089c5 100644 --- a/test/CodeGen/X86/vec_shuffle-37.ll +++ b/test/CodeGen/X86/vec_shuffle-37.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -march=x86-64 | FileCheck %s +; RUN: llc -O0 < %s -march=x86 -mcpu=core2 | FileCheck %s --check-prefix=CHECK_O0 define <4 x i32> @t00(<4 x i32>* %a0) nounwind ssp { entry: @@ -12,3 +13,12 @@ entry: ret <4 x i32> %2 } +define void @t01(double* %a0) nounwind ssp { +entry: +; CHECK_O0: movsd (%eax), %xmm0 +; CHECK_O0: unpcklpd %xmm0, %xmm0 + %tmp93 = load double* %a0, align 8 + %vecinit94 = insertelement <2 x double> undef, double %tmp93, i32 1 + store <2 x double> %vecinit94, <2 x double>* undef + ret void +}