From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 28DE03858C51 for ; Fri, 1 Jul 2022 22:57:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28DE03858C51 Received: by mail-pl1-x634.google.com with SMTP id d5so3614954plo.12 for ; Fri, 01 Jul 2022 15:57:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=0NwNzyynHFkPrPCVrwojPe8AvlxpIXUC9tFgYqe/958=; b=EGw3cZ7oLSXbqnWJVvzLNp+KYKm5PnESTQH7VVNQHM0ctNNR2yhkO1WobUnKz9u03E R7sGO/pNnG7CYQGnr19ek1SOOytru9NXNxkULMY4qw/9MU6PUeZ1nBShCQPhgNPx8WQT rcH2N8Jj+mSCLNXh4wq77ci1fyzih9LC+3jB4GxMgI1bross37Ai743QWV0IclWvQxq6 +i82F88YqW8/CmYdUreycH/UuY5w8r4cl7AZ2vAcEMW692y+pj11XC5C5qXhIpVneCDY 2R3FqdgTM+64D6ZKhnzH129MKKJOISzPPpiDkWUTxxR9de26x1e/5d8oo8qdfNNpiwyA l1dQ== X-Gm-Message-State: AJIora+lwY4bNU9mbUrRxE84Z9ikZq6gUtlSqtkMFp6qQ/ajyfO/FIH4 rjmzziVCK8zpOLOQLco61e780Xlry3g= X-Google-Smtp-Source: AGRyM1sV/o7UuEdhdzrVSxdRfvSLxB2Zk7Iv4Unas61kdaT0vb5UB3tejmGTvyxqKc6mzB6dT4kXvw== X-Received: by 2002:a17:90b:1c08:b0:1ec:ea57:14ba with SMTP id oc8-20020a17090b1c0800b001ecea5714bamr18812271pjb.17.1656716266685; Fri, 01 Jul 2022 15:57:46 -0700 (PDT) Received: from [192.168.0.23] (65-130-94-229.slkc.qwest.net. [65.130.94.229]) by smtp.gmail.com with ESMTPSA id m20-20020a170902c45400b0016a8010218bsm12307683plm.27.2022.07.01.15.57.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 15:57:46 -0700 (PDT) Message-ID: <938e600e-154f-048d-2ed8-e51d3c6a4f0f@gmail.com> Date: Fri, 1 Jul 2022 16:57:45 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR. Content-Language: en-US To: gcc-patches@gcc.gnu.org References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 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, 01 Jul 2022 22:57:49 -0000 On 6/17/2022 2:33 PM, Andrew Pinski via Gcc-patches wrote: > On Thu, Jun 16, 2022 at 3:59 AM Tamar Christina via Gcc-patches > wrote: >> Hi All, >> >> For IEEE 754 floating point formats we can replace a sequence of alternative >> +/- with fneg of a wider type followed by an fadd. This eliminated the need for >> using a permutation. This patch adds a math.pd rule to recognize and do this >> rewriting. > I don't think this is correct. You don't check the format of the > floating point to make sure this is valid (e.g. REAL_MODE_FORMAT's > signbit_rw/signbit_ro field). > Also would just be better if you do the xor in integer mode (using > signbit_rw field for the correct bit)? > And then making sure the target optimizes the xor to the neg > instruction when needed? Whether or not the xor trick is better or not would be highly target dependent.  That seems like it's better left for expansion to figure out since we have target costing information at that point. Jeff