From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id F25233858D1E for ; Sun, 4 Jun 2023 03:06:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F25233858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2562cc85d3dso2857329a91.1 for ; Sat, 03 Jun 2023 20:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685847985; x=1688439985; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WXa8yr49TVYRCYAna4uqwpnLpMITLGav8ggQzZTZYVM=; b=awoYgi9QkftPg2RPy2DaySiRbvcUfXrX5JVMUsRRdlPaIDm/IhmPGblYHmtTHmZMqC bAGiHYl4R+QtO37pgDE/TOHE9Ai5xGQ6IH5IBUo+rDRIz7Q9MJ2ALxlX0KyylFUnRTP+ OqFEjPGkrRi0pzGTkCqc5sFGnkWS30Ml4JufTks/hn76aMcDDeC012DEOqTxOhmcQRrY p5gd09vvQZF066yHcYpYjDDK8FxubvhrX0jliVZf+JhToEny+xh4CBMeSmTGB9XpuT4m b7btNUrFeZaJAM4qdQWXM5jnRAQM0tY+OFqmYvGqVjBsh7CImwoThbOnfRfsQKgCKGk2 9AoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685847985; x=1688439985; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WXa8yr49TVYRCYAna4uqwpnLpMITLGav8ggQzZTZYVM=; b=WyQH55JMQ8uI9nG/b2f1yiuSr/tcov4H4Awg/+twklCDBr4q62URKs0IKeXHLJucHE Vj0+aIH64YTXJ/O30p2ddyR9s9xs4YKFBeTj4SPIm/cP18PEVAOPm/HGXdDF8qEdk8Ms oXhG59t1ZdT1T0D98HQ7OtafsbSkzAD57hfHpE6p43UA3Rnnt3VLgyuXPLKN8PTni/Bc hoDYYP/ZIF23W3D564cnFUttKDLWos/pyiFwUlsaCUYAi9geMjql2cJGFmazc854TYLo 1s5AyS2hrbj9qhTnnZORQgTs8nce68vF8BvVh4/VApBWbKFJtzqFrkMDLPavLsO4BRa1 9rqg== X-Gm-Message-State: AC+VfDwymerm+5JJ9NHJfiRyUMwCYSU2/PosJQ18mwCBEt0fPBFNOWo1 k7TkaOMI6aW8F+lzChJ77dE= X-Google-Smtp-Source: ACHHUZ4s6DvGciCV5nzgKWQqanWQTHBtDmwSaZ5Z/a9CytalLMlvOZH0J9VHCvHa5knzr2gMTbSBOA== X-Received: by 2002:a17:90a:195b:b0:259:41a6:ec1c with SMTP id 27-20020a17090a195b00b0025941a6ec1cmr91415pjh.17.1685847984793; Sat, 03 Jun 2023 20:06:24 -0700 (PDT) Received: from ?IPV6:2607:fb90:469:b40a:c15c:6a92:5516:c5a5? ([2607:fb90:469:b40a:c15c:6a92:5516:c5a5]) by smtp.gmail.com with ESMTPSA id z9-20020a17090a014900b0024df400a9e6sm3639220pje.37.2023.06.03.20.06.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Jun 2023 20:06:24 -0700 (PDT) Message-ID: Date: Sat, 3 Jun 2023 21:06:22 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] xtensa: Optimize boolean evaluation or branching when EQ/NE to INT_MIN Content-Language: en-US To: Andrew Pinski , Takayuki 'January June' Suwa Cc: GCC Patches , Max Filippov 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.2 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 List-Id: On 6/3/23 17:03, Andrew Pinski via Gcc-patches wrote: > On Sat, Jun 3, 2023 at 3:53 PM Takayuki 'January June' Suwa via > Gcc-patches wrote: >> >> This patch optimizes both the boolean evaluation of and the branching of >> EQ/NE against INT_MIN (-2147483648), by taking advantage of the specifi- >> cation the ABS machine instruction on Xtensa returns INT_MIN iff INT_MIN, >> otherwise non-negative value. > > I wonder if this should be a generic expand improvement here. > You would definitely need to expand both ways and see if one is cost > more than the other. There's probably some targets where this would be beneficial. Especially those with branch-on-bit capabilities. Jeff