From 174f8033951d9abc2cb1b3f4e75b25460640a571 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 17 May 2007 18:44:37 +0000 Subject: [PATCH] Added missing patterns for UNPCKH* and PUNPCKH*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37172 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 1d454aa67b3..8e64f7b1687 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -170,6 +170,10 @@ def UNPCKL_v_undef_shuffle_mask : PatLeaf<(build_vector), [{ return X86::isUNPCKL_v_undef_Mask(N); }]>; +def UNPCKH_v_undef_shuffle_mask : PatLeaf<(build_vector), [{ + return X86::isUNPCKH_v_undef_Mask(N); +}]>; + def PSHUFD_shuffle_mask : PatLeaf<(build_vector), [{ return X86::isPSHUFDMask(N); }], SHUFFLE_get_shuf_imm>; @@ -2266,6 +2270,22 @@ def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef), (PUNPCKLDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>; } +// vector_shuffle v1, , <2, 2, 3, 3, ...> +let AddedComplexity = 10 in { +def : Pat<(v4f32 (vector_shuffle VR128:$src, (undef), + UNPCKH_v_undef_shuffle_mask)), + (UNPCKHPSrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>; +def : Pat<(v16i8 (vector_shuffle VR128:$src, (undef), + UNPCKH_v_undef_shuffle_mask)), + (PUNPCKHBWrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>; +def : Pat<(v8i16 (vector_shuffle VR128:$src, (undef), + UNPCKH_v_undef_shuffle_mask)), + (PUNPCKHWDrr VR128:$src, VR128:$src)>, Requires<[HasSSE2]>; +def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef), + UNPCKH_v_undef_shuffle_mask)), + (PUNPCKHDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>; +} + let AddedComplexity = 15 in { // vector_shuffle v1, v2 <0, 1, 4, 5> using MOVLHPS def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,