From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id 16A153858D28 for ; Thu, 6 Apr 2023 15:06:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16A153858D28 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-x102e.google.com with SMTP id mp3-20020a17090b190300b0023fcc8ce113so43121909pjb.4 for ; Thu, 06 Apr 2023 08:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680793578; x=1683385578; 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=mpEIj9RFJsqZw2qbYchuagVBx3YUu4VuYTMeFAGtTsY=; b=qB0wvyz03tp5Sk4PCIFidurGOUvZFoXoRh7545kRVheg5+5r3KvDbLZTUl5GE/5LUJ rN16fKm8x+a3lhW2l8/PTnJCT8PldouhP3TV0cgpMJiGorNSSFRh5hbsPTIialnBXi50 qSN1VQbHO7uoaYoZcvUi0UG7nUy7FqtAir198llOVXBNXs93OsrRqr9cII2ZLf5N+D4F drFE5C8aXay7Jinpq2gspwe9n0nTZY2T5ZDFJTzpCfajESQNoPnlfuWmXuXajmbKXg6H dUf/jdwaCcJgphU4/di7r1gHqT8lZKeXYLDoVL/Akh8toLFrvJeNsEfbVEYctnzuYa25 ZWWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680793578; x=1683385578; 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=mpEIj9RFJsqZw2qbYchuagVBx3YUu4VuYTMeFAGtTsY=; b=yPDVwg/vlt6Ct01DuPN5c2LKXqsIEuXr7/mcahSUWbB0g/BhTQYFEu3U6rJI5r1AAx GJsflPS6iF7jgsQsGGUFpTVaKoRomeN6zuNDYjz1LMgwznCenGhovoXSqIJ3ArqTB0eD WVtvWvtZ3iAeCtw+lr5Bq/aa5Jl08IPhopruPhvsdOZJ5uH4UYZjOjjG1BcD6ehnjBpt HiH1/pPE2w00DoUJ03tg7CY+z6hNaZDahkaNiJMNivYiKhoYh19vhX78+adC3himTBaE ShWYbAq9qQx9dVXNeEpJItzq1Y9aC0eX40ObpwkQNiHxqwGNyemZZeNV+vV5+jMjQAqX jD6g== X-Gm-Message-State: AAQBX9eZWMnLfrDTSk2/npjhgCJ54K5+lvJ8vcXiQzX7P0Ok1XM1gqBw DNtuOXVssvne0Y4TWskuQ14= X-Google-Smtp-Source: AKy350ZBfNBwe3k5nG3dA364j16g4wxY/RJE1TtQ9S0KmMb0nJjisvAL8mmFVf8fIvNZMwUPVH9glQ== X-Received: by 2002:a17:90b:1649:b0:23f:dd27:169e with SMTP id il9-20020a17090b164900b0023fdd27169emr11395353pjb.17.1680793577803; Thu, 06 Apr 2023 08:06:17 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id e1-20020a17090a818100b00233df90227fsm3250490pjn.18.2023.04.06.08.06.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Apr 2023 08:06:17 -0700 (PDT) Message-ID: Date: Thu, 6 Apr 2023 09:06:16 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] combine: Fix simplify_comparison AND handling for WORD_REGISTER_OPERATIONS targets [PR109040] Content-Language: en-US To: Jakub Jelinek , Eric Botcazou Cc: Richard Biener , Richard Sandiford , gcc-patches@gcc.gnu.org References: <612b6215-8bc3-1174-a475-4315176bfe1c@gmail.com> <2876279.e9J7NaK4W3@fomalhaut> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 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 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 4/6/23 04:31, Jakub Jelinek wrote: > > If we want to fix it in the combiner, I think the fix would be following. > The optimization is about > (and:SI (subreg:SI (reg:HI xxx) 0) (const_int 0x84c)) > and IMHO we can only optimize it into > (subreg:SI (and:HI (reg:HI xxx) (const_int 0x84c)) 0) > if we know that the upper bits of the REG are zeros. But in WORD_REGISTER_OPERATIONS, that inner AND variant operates on a full word. So I think they're equivalent. But maybe I'm getting myself confused again. > > Now, this patch fixes the PR, but certainly generates worse (but correct) > code than the dse.cc patch. So perhaps we want both of them? I think the dse patch has value independently of this discussion, though I think it's more of a gcc-14 thing. > > As before, I unfortunately can't test it on riscv-linux (could perhaps try > that on sparc-solaris on GCC Farm which is another WORD_REGISTER_OPERATIONS > target, but last my bootstrap attempt there failed miserably because of the > Don't bootstrap at midnight issue in cp/Make-lang.in; I'll post a patch > for that once I test it). I can spin it here when the time comes. jeff