From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16105 invoked by alias); 4 Dec 2012 18:12:58 -0000 Received: (qmail 16097 invoked by uid 22791); 4 Dec 2012 18:12:56 -0000 X-SWARE-Spam-Status: No, hits=-3.8 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,TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-qa0-f47.google.com (HELO mail-qa0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Dec 2012 18:12:52 +0000 Received: by mail-qa0-f47.google.com with SMTP id a19so1191452qad.20 for ; Tue, 04 Dec 2012 10:12:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.191.137 with SMTP id dm9mr20732488qab.40.1354644771395; Tue, 04 Dec 2012 10:12:51 -0800 (PST) Received: by 10.49.12.210 with HTTP; Tue, 4 Dec 2012 10:12:51 -0800 (PST) In-Reply-To: References: Date: Tue, 04 Dec 2012 18:12:00 -0000 Message-ID: Subject: Re: [i386] scalar ops that preserve the high part of a vector From: "H.J. Lu" To: Uros Bizjak , Kirill Yukhin Cc: Marc Glisse , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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/msg00249.txt.bz2 On Tue, Dec 4, 2012 at 10:06 AM, Uros Bizjak wrote: > On Tue, Dec 4, 2012 at 5:28 PM, Marc Glisse wrote: >> On Tue, 4 Dec 2012, Marc Glisse wrote: >> >>> Do you agree? >> >> >> Like this ? (only tested on the new testcases, and then I'd need to ask Eric >> his opinion) >> >> 2012-12-04 Marc Glisse >> >> PR target/54855 >> gcc/ >> * simplify-rtx.c (simplify_binary_operation_1) : Replace >> with VEC_MERGE. >> >> * 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 taken in this patch looks really good to me. There > should be no code differences with your patch, but let's ask HJ for > his opinion on intrinsics header changes. Hi Kirill, Can you take a look? Thanks. > A little nit below: > >> + rtx newop0 = gen_rtx_fmt_e (VEC_DUPLICATE, mode, trueop0); >> + rtx newop1 = XEXP (trueop1, 0); >> + return simplify_gen_ternary (VEC_MERGE, mode, GET_MODE (newop0), >> + newop0, newop1, GEN_INT (1)); > > You can use const1_rtx here. > > Thanks, > Uros. -- H.J.