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 08C703858426 for ; Fri, 6 Oct 2023 13:43:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08C703858426 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 9888E1F37C; Fri, 6 Oct 2023 13:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696599807; 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=mDKhHMO4bDLnb1tzH8HxyVbOe8VQRCisJH9K2J+UiGg=; b=hf4q6PsgDlD9dlLntKv+sHJyygDbjgXGyPxTyJRbUcFoyRSJE+++Hd9z1DfTSgPylbiaie gjpvaat9l7LtzskU2VHrhJf33LPahcJonw7Kpjb0BmLSNfRoJPYFGQ7H95MC4Y9eSty7dH 2u5H92lqgYTWC6MwusS9YWzcAfh2+AI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696599807; 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=mDKhHMO4bDLnb1tzH8HxyVbOe8VQRCisJH9K2J+UiGg=; b=96c+mrmR8EnsZZrudMAFfK0gj+ehCjx30XGFPtBO5yq8XHxo4JHt1QjPYsMNcMhnbIOxfK wTaJnESotSH+45Dw== 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 6E2E82C142; Fri, 6 Oct 2023 13:43:27 +0000 (UTC) Date: Fri, 6 Oct 2023 13:43:27 +0000 (UTC) From: Richard Biener To: Robin Dapp cc: Tamar Christina , gcc-patches Subject: Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction. In-Reply-To: Message-ID: References: <0193b63e-98dc-42bc-cd33-485361ea50bf@gmail.com> <671a575c-02ff-071b-967e-2e93d8986c1a@gmail.com> <85b08273-7eea-be3f-f08a-edf0780d36a7@gmail.com> <187932bd-3a22-acdb-025b-e17ca3408e3a@gmail.com> 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=-5.0 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 6 Oct 2023, Robin Dapp wrote: > > We might need a similar assert > > > > gcc_assert (HONOR_SIGNED_ZEROS (vectype_out) > > && !HONOR_SIGN_DEPENDENT_ROUNDING (vectype_out));? > > erm, obviously not that exact assert but more something like > > if (HONOR_SIGNED_ZEROS && !HONOR_SIGN_DEPENDENT_ROUNDING...) > { > if (dump) > ... > return false; > } > > or so. Yeah, of course the whole point of a fold-left reduction is to _not_ give up without -ffast-math which is why I added the above. I obviously didn't fully verify what happens for an original MINUS_EXPR. I think it's required to give up for -frounding-math, but I think I might have put the code to do that in a generic enough place. For x86 you need --param vect-partial-vector-usage=2 and an AVX512 enabled arch like -march=skylake-avx512 or -march=znver4. I think tranforming - x to + (-x) works for signed zeros. So if you think you got everything correct the patch is OK as-is, I just wasn't sure - maybe the neutral_element change deserves a comment as to how MINUS_EXPR is handled. Richard.