From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 518AB3959E41 for ; Wed, 16 Nov 2022 12:19:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 518AB3959E41 Authentication-Results: sourceware.org; dmarc=pass (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-out2.suse.de (Postfix) with ESMTP id 8DD631F912; Wed, 16 Nov 2022 12:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668601162; 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=kS9P5dU1YZGb4wW5cmu78q1XLPn/o56pBHVdBtfTsVw=; b=qV0YQQCO6TxRXguCwIVuGOIe0PFF1bK0oSeqninszJ9OuwtvsnO9Wub6qOa+boYYvmKMBa QxgqHH8ILB05VHSS+9nu/uP/pWQGSfLV2VWukoqf+TnTDJ+U+wg9++nkiIf5XHNJXPSqw7 YjPPMvUujzU/wsTVW/kAKiO0BnQdygU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668601162; 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=kS9P5dU1YZGb4wW5cmu78q1XLPn/o56pBHVdBtfTsVw=; b=szuRsxBSrh1Iu4zbVdXrvNtATYIUBBuy8d5eNfBUSjnBnyblieR4ck0ROKiHmGAkNf85+v ONmSVo7ZpaH4xiBw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (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 6B8592C14F; Wed, 16 Nov 2022 12:19:22 +0000 (UTC) Date: Wed, 16 Nov 2022 12:19:22 +0000 (UTC) From: Richard Biener To: Richard Sandiford cc: Tamar Christina , Tamar Christina via Gcc-patches , nd , "jlaw@ventanamicro.com" Subject: Re: [PATCH]middle-end: replace GET_MODE_WIDER_MODE with GET_MODE_NEXT_MODE In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 15 Nov 2022, Richard Sandiford wrote: > Tamar Christina writes: > >> -----Original Message----- > >> From: Richard Sandiford > >> Sent: Tuesday, November 15, 2022 11:59 AM > >> To: Tamar Christina via Gcc-patches > >> Cc: Tamar Christina ; nd ; > >> rguenther@suse.de; jlaw@ventanamicro.com > >> Subject: Re: [PATCH]middle-end: replace GET_MODE_WIDER_MODE with > >> GET_MODE_NEXT_MODE > >> > >> Tamar Christina via Gcc-patches writes: > >> > Hi All, > >> > > >> > After the fix to the addsub patch yesterday for bootstrap I had only > >> regtested on x86. > >> > While looking today it seemed the new tests were failing, this was > >> > caused by a change in the behavior of the GET_MODE_WIDER_MODE > >> macro on trunk. > >> > > >> > This patch fixes that issue. Sorry for the mess, have rebased all branches > >> now. > >> > > >> > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > >> > > >> > Ok for master? > >> > > >> > Thanks, > >> > Tamar > >> > > >> > gcc/ChangeLog: > >> > > >> > * match.pd: Replace GET_MODE_WIDER_MODE with > >> > GET_MODE_NEXT_MODE. > >> > > >> > --- inline copy of patch -- > >> > diff --git a/gcc/match.pd b/gcc/match.pd index > >> > > >> 1b0ab7cf60fa4772fbe8304c622b0b8fab1bdefa..28191a992039c6f3a1dab5f7c0 > >> e3 > >> > 5dd58dc47092 100644 > >> > --- a/gcc/match.pd > >> > +++ b/gcc/match.pd > >> > @@ -7997,7 +7997,7 @@ and, > >> > machine_mode wide_mode; > >> > } > >> > (if (sel.series_p (0, 2, 0, 2) > >> > - && GET_MODE_WIDER_MODE (vec_mode).exists (&wide_mode) > >> > + && GET_MODE_NEXT_MODE (vec_mode).exists (&wide_mode) > >> > && VECTOR_MODE_P (wide_mode) > >> > && (GET_MODE_UNIT_BITSIZE (vec_mode) * 2 > >> > == GET_MODE_UNIT_BITSIZE (wide_mode))) > >> > >> Does anything guarantee that the next mode will be the right one? > >> It think it would be safer to replace the last three && conditions with: > >> > >> && GET_MODE_2XWIDER_MODE (GET_MODE_INNER (vec_mode)).exists > >> (&wide_elt_mode) > >> && multiple_p (GET_MODE_NUNITS (vec_mode), 2, &wide_nunits) > >> && related_vector_mode (vec_mode, wide_elt_mode, > >> wide_nunits).exists (&wide_mode) > > > > I see, respun patch accordingly. > > LGTM, but I'm nervous when it comes to match.pd stuff so I'd prefer > Richi or Jeff to have the final say. I see nothing wrong here, so OK. Richard. > Thanks, > Richard > > > > > Ok for master? > > > > --- inline copy of patch --- > > > > diff --git a/gcc/match.pd b/gcc/match.pd > > index 1b0ab7cf60fa4772fbe8304c622b0b8fab1bdefa..82f05bbc912e4f80f3984d930c4a8dcb010136e1 100644 > > --- a/gcc/match.pd > > +++ b/gcc/match.pd > > @@ -7995,12 +7995,15 @@ and, > > vec_perm_indices sel (builder, 2, nelts); > > machine_mode vec_mode = TYPE_MODE (type); > > machine_mode wide_mode; > > + scalar_mode wide_elt_mode; > > + poly_uint64 wide_nunits; > > + scalar_mode inner_mode = GET_MODE_INNER (vec_mode); > > } > > (if (sel.series_p (0, 2, 0, 2) > > - && GET_MODE_WIDER_MODE (vec_mode).exists (&wide_mode) > > - && VECTOR_MODE_P (wide_mode) > > - && (GET_MODE_UNIT_BITSIZE (vec_mode) * 2 > > - == GET_MODE_UNIT_BITSIZE (wide_mode))) > > + && GET_MODE_2XWIDER_MODE (inner_mode).exists (&wide_elt_mode) > > + && multiple_p (GET_MODE_NUNITS (vec_mode), 2, &wide_nunits) > > + && related_vector_mode (vec_mode, wide_elt_mode, > > + wide_nunits).exists (&wide_mode)) > > (with > > { > > tree stype > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)