From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6907 invoked by alias); 22 Nov 2013 01:51:11 -0000 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 Received: (qmail 6836 invoked by uid 89); 22 Nov 2013 01:51:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-ie0-f175.google.com Received: from Unknown (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 22 Nov 2013 01:51:10 +0000 Received: by mail-ie0-f175.google.com with SMTP id x13so1061353ief.6 for ; Thu, 21 Nov 2013 17:51:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tmEh2WOj71JvF9BOiWWKS6qDVr5EDkn7Hj72EAdGmr0=; b=immvDMU8qF1UUeXRg2O/QVHpkQ3JGtY2yvbAsfork0341FzrytdvT6TZZ0g6qSl7OK g1S4lkhDZ6yaOwKXmQB+UYT1bXDtBVr/9eWkLqSAZHpRwVEQ/cZk2YhgQ7QZ/Kh0MxMy EXRoylRPE7SIHSgaiQoRyIu5XcRl8oLr67qgAvP9ci8CX/xQGvuNE4EGE6ch6LQstvpo e+rTTIDkMkCPvcPX7Pn0sK0ge5ZQrkgIxqGTlnEujT2RsaazivgE4kC6iKMl99oMvHg8 ww4/e6hVDWq+Ysc8VV9LGnbty9SZc99VQthgww3YW2lSYDb6r8sfS1hayxfbASoWBakd B7Rg== X-Gm-Message-State: ALoCoQnCfY4OFiFNr8+eNawOW6EkZYjaUDvj4Sqcjyf++ysq/oPvu79P0Jyh25v+9pUfL+f5TIJUM2M4/ZHMLt/qP0yS8ddw2iYfq+OKBG3hDcgbKKvE6RB9HdtvC8WDM38hal/yqrP8XmYLquvRca2L5f6n7ROEzw6XvfXYbSJDdk98BG/ImzgQCvjgzqR35rzBhTX2NboggSGhZ4/ZTHwgRFG/1sHSdw== MIME-Version: 1.0 X-Received: by 10.50.30.66 with SMTP id q2mr381069igh.17.1385085062516; Thu, 21 Nov 2013 17:51:02 -0800 (PST) Received: by 10.64.236.37 with HTTP; Thu, 21 Nov 2013 17:51:02 -0800 (PST) In-Reply-To: References: Date: Fri, 22 Nov 2013 05:49:00 -0000 Message-ID: Subject: Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer. From: Cong Hou To: GCC Patches Cc: Richard Biener Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-11/txt/msg02808.txt.bz2 On Thu, Nov 21, 2013 at 4:39 PM, Marc Glisse wrote: > On Thu, 21 Nov 2013, Cong Hou wrote: > >> While I added the new define_insn_and_split for vec_merge, a bug is >> exposed: in config/i386/sse.md, [ define_expand "xop_vmfrcz2" ] >> only takes one input, but the corresponding builtin functions have two >> inputs, which are shown in i386.c: >> >> { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv4sf2, >> "__builtin_ia32_vfrczss", IX86_BUILTIN_VFRCZSS, UNKNOWN, >> (int)MULTI_ARG_2_SF }, >> { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv2df2, >> "__builtin_ia32_vfrczsd", IX86_BUILTIN_VFRCZSD, UNKNOWN, >> (int)MULTI_ARG_2_DF }, >> >> In consequence, the ix86_expand_multi_arg_builtin() function tries to >> check two args but based on the define_expand of xop_vmfrcz2, >> the content of insn_data[CODE_FOR_xop_vmfrczv4sf2].operand[2] may be >> incorrect (because it only needs one input). >> >> The patch below fixed this issue. >> >> Bootstrapped and tested on ax x86-64 machine. Note that this patch >> should be applied before the one I sent earlier (sorry for sending >> them in wrong order). > > > This is PR 56788. Your patch seems strange to me and I don't think it > fixes the real issue, but I'll let more knowledgeable people answer. Thank you for pointing out the bug report. This patch is not intended to fix PR56788. For your function: #include __m128d f(__m128d x, __m128d y){ return _mm_frcz_sd(x,y); } Note that the second parameter is ignored intentionally, but the prototype of this function contains two parameters. My fix is explicitly telling GCC that the optab xop_vmfrczv4sf3 should have three operands instead of two, to let it have the correct information in insn_data[CODE_FOR_xop_vmfrczv4sf3].operand[2] which is used to match the type of the second parameter in the builtin function in ix86_expand_multi_arg_builtin(). thanks, Cong > > -- > Marc Glisse