From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31284 invoked by alias); 2 Dec 2012 10:51:07 -0000 Received: (qmail 31269 invoked by uid 22791); 2 Dec 2012 10:51:06 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 Dec 2012 10:51:01 +0000 Received: by mail-pb0-f47.google.com with SMTP id un1so1231542pbc.20 for ; Sun, 02 Dec 2012 02:51:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.197.71 with SMTP id is7mr20147741pbc.79.1354445460730; Sun, 02 Dec 2012 02:51:00 -0800 (PST) Received: by 10.66.246.232 with HTTP; Sun, 2 Dec 2012 02:51:00 -0800 (PST) In-Reply-To: References: Date: Sun, 02 Dec 2012 10:51:00 -0000 Message-ID: Subject: Re: [i386] scalar ops that preserve the high part of a vector From: Uros Bizjak To: Marc Glisse Cc: gcc-patches@gcc.gnu.org, "H.J. Lu" Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00069.txt.bz2 On Sat, Dec 1, 2012 at 6:27 PM, Marc Glisse wrote: > here is a patch. If it is accepted, I'll extend it to other vm patterns > (mul, div, min, max are likely candidates, but I need to check the doc). It > passed bootstrap+testsuite on x86_64-linux. > > > 2012-12-01 Marc Glisse > > PR target/54855 > gcc/ > * config/i386/sse.md (_vm3): Rewrite > pattern. > * config/i386/i386-builtin-types.def: New function types. > * config/i386/i386.c (ix86_expand_args_builtin): Likewise. > (bdesc_args) <__builtin_ia32_addss, __builtin_ia32_subss, > __builtin_ia32_addsd, __builtin_ia32_subsd>: Change prototype. > * config/i386/xmmintrin.h: Adapt to new builtin prototype. > * config/i386/emmintrin.h: Likewise. > * doc/extend.texi (X86 Built-in Functions): Document changed > prototype. > > testsuite/ > * gcc.target/i386/pr54855-1.c: New testcase. > * gcc.target/i386/pr54855-2.c: New testcase. Yes, the approach looks correct to me, but I wonder why we have different representations for v4sf and v2df cases? I'd say that we should canonicalize patterns somewhere in the middle end (probably to vec_merge variant, as IMO vec_dup looks like degenerated vec_merge variant), otherwise we will have pattern explosion. However, the patch is too late for 4.8, but definitely a wanted generalization and fix of a (partially) wrong representation. I have also CCd HJ for his opinion, since the patch touches published headers. Thanks, Uros.