From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 42D3C39BB632 for ; Fri, 25 Jun 2021 06:48:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 42D3C39BB632 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 0E47321BE2; Fri, 25 Jun 2021 06:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624603702; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EeygXWzStMcu93oL7tSWdhBwgzP9rOtWKBd6GcZRnhw=; b=V9SDwqevpL2poOGMeA0CHDrbdmcODdPNaaUmIejpKk99n9jQTIufckvZMNAVgu3+ivsHCv NZ6eIOSRRrjfEOslRbxzy2zK7/3ZOFvaJ14oJ43ew2W+nYP+KOGORuqpd8X2ZmqyuXaPNn rTRNmZKw/jIrHUXXdjvVmFedNdXjL/U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624603702; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EeygXWzStMcu93oL7tSWdhBwgzP9rOtWKBd6GcZRnhw=; b=FodMLqnUeYRV78ANhHAJ2RJQIbNka1b7eyDDmFrKwR49OzXgpmSX50ehqEjAiIrezf0dVa phjGCmThq/Uts1DA== Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D6287A3BB4; Fri, 25 Jun 2021 06:48:21 +0000 (UTC) Date: Fri, 25 Jun 2021 08:48:21 +0200 (CEST) From: Richard Biener To: Uros Bizjak cc: Hongtao Liu , "gcc-patches@gcc.gnu.org" , Richard Sandiford Subject: Re: [PATCH][RFC] Add x86 subadd SLP pattern In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 06:48:24 -0000 On Thu, 24 Jun 2021, Uros Bizjak wrote: > On Thu, Jun 24, 2021 at 1:07 PM Richard Biener wrote: > > > This addds SLP pattern recognition for the SSE3/AVX [v]addsubp{ds} v0, v1 > > instructions which compute { v0[0] - v1[0], v0[1], + v1[1], ... } > > thus subtract, add alternating on lanes, starting with subtract. > > > > It adds a corresponding optab and direct internal function, > > vec_addsub$a3 and renames the existing i386 backend patterns to > > the new canonical name. > > > > The SLP pattern matches the exact alternating lane sequence rather > > than trying to be clever and anticipating incoming permutes - we > > could permute the two input vectors to the needed lane alternation, > > do the addsub and then permute the result vector back but that's > > only profitable in case the two input or the output permute will > > vanish - something Tamars refactoring of SLP pattern recog should > > make possible. > > Using the attached patch, I was also able to generate addsub for the > following testcase: > > float x[2], y[2], z[2]; > > void foo () > { > x[0] = y[0] - z[0]; > x[1] = y[1] + z[1]; > } > > vmovq y(%rip), %xmm0 > vmovq z(%rip), %xmm1 > vaddsubps %xmm1, %xmm0, %xmm0 > vmovlps %xmm0, x(%rip) > ret Nice. But I suppose it can be merged with the other now single pattern? Richard.