From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4F51D3858CD1 for ; Sat, 25 Nov 2023 12:09:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F51D3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F51D3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700914161; cv=none; b=JMDdgA+J/FyMiS/TH3zEBlIEyc2le1i29cnAoR7eDa4CxPQIKY1f5GfyGgE8lXCEtdxbEiwozstTE177s3iqdINhVMEklsiGcNoU6K3Ua+p6l5UG9Ygz1Ak1HldYxWCaLJdjlB6qyuCgifgi19VPMv5W5lCiObDUDdl0T7GGjKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700914161; c=relaxed/simple; bh=bpy2RQG7RzsTvsKxW4j7shw2DUih+Ny3VZ5f7OL4ATw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=rnA0CfTVGHuZFon9QBsThAdc5cvlJSQUrkoPe/OE6SZhTYdHm+E5wTmsFwrwKSDjZFU/TnNsskWCRX8wOH3h0OCcBwlO/GMeAu4ETkGwv9d0nfUcKgqHOPGQSr0CMBgBejg/zKWnV27oA/or5jFLWgCilQIL35YqxpCiF+Z2ITg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700914159; h=from:from:reply-to:reply-to:subject:subject: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=MKSDpZxvLGG+Ee2adrgx6Nie3Ar6sj9PipWCJs8l7ds=; b=ac5vGjIOrVSQvn8Wpe38FwvMut6rbEjF2ZmoFE8xMxOkKy8KhtVrEQ/YkHBgBw+eqDrHSc TS3z/Ggm2IL1xnbDBo7g+B6phfMsPbVvgZmv/eUsVkg8x9HhRO9QK6ixlvg/lWzEqn05/y kzSpD2Z0rsdfcxuRcYQ3Tp/NfBuE0GM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-nEHrloytP1C29gdl9rAdhg-1; Sat, 25 Nov 2023 07:09:16 -0500 X-MC-Unique: nEHrloytP1C29gdl9rAdhg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C56FF3C025C9; Sat, 25 Nov 2023 12:09:15 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8498F2166B26; Sat, 25 Nov 2023 12:09:15 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3APC9CXw1793960 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 25 Nov 2023 13:09:12 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3APC9AoC1793959; Sat, 25 Nov 2023 13:09:10 +0100 Date: Sat, 25 Nov 2023 13:09:10 +0100 From: Jakub Jelinek To: Tamar Christina Cc: Xi Ruoyao , Segher Boessenkool , David Edelsohn , "gcc-patches@gcc.gnu.org" , Andrew Pinski Subject: Re: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606] Message-ID: Reply-To: Jakub Jelinek References: <60b5367881c834d1b0f7377a4f352c7c512e2d37.camel@xry111.site> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Sat, Nov 25, 2023 at 12:03:56PM +0000, Tamar Christina wrote: > For the C99 versions of copysign, expand_COPYSIGN has optimized expansions inplace. > One of the hooks there forces it to abs/neg. There is also code in place for if the target > prefers integer expansion over floating point one etc. I thought the simplify-rtx.cc canonicalization of copysign (x, negative) to (neg (abs ()) was disabled shortly after your change. > However the issue here is that IFNs at the moment only support direct expansion. That is, you need an optab to get the > rewriting done. So you have a catch 22, unlike the C99 versions which have a libcall fallback. For POPCOUNT I've introduced recently a way to provide custom expand_* function and decide there what optimizations to use, even when it otherwise is an integral unary optab ifn. Jakub