From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 280473858D37 for ; Thu, 30 Nov 2023 17:33:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 280473858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 280473858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701365590; cv=none; b=Fso5D3DI7f4v81cx93KV9U+6ETbCvgxBJGh7COqHwBOZNkgAXcedGSFtjh3SWLZN47smMXB76j6WJKAh5BIbKQAsefshJbzOqXcGktOPt15NCPZ8xVKc+d2CunQO3eOYAQ75i6oT06pZzJS08FhVeNKHzIb/eWUOQYldtt+nrcw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701365590; c=relaxed/simple; bh=xt5DlhS/Eb62fBDeF9l59UYACpRNjNvXKXXx+pCJWcE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=mXzVkP8Xt7XuP0VYX1TxAbTFCXXxABMD6wNzpsgBnE3D30sMfgQue/vZgD74lwvBiGTH3ZsYWeGijns5JE04sFnLvEjNCV19DSwc7e+f9ClFAoZp75DP1RrHhafPZzH4lR6LCW8oKlQB0qunOQhZSyaJcUDgHUVm41KNh2AWXXc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1cfc9c4acb6so11715935ad.0 for ; Thu, 30 Nov 2023 09:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701365588; x=1701970388; darn=gcc.gnu.org; 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=sBsr057p0mWa+fyXDknmhrnfXctpN8P3IKtTb0zms8Y=; b=JpeWm8By93eq7baC7O1owGX1yYJv1RfKlZWhiFwmtFVn+ST+7gxhMrLPL4oxhwjM9+ a21IU6BjbL4oOF8ImigcJKjywgGihQPnsmrcD4hcoX8WlEjobYEYaYgYF4HLMvXQvVWy oSRY7rVDB4mR48neS9FBfLHHp90rx5+d+dMJwy4+EkCVZqs06nYWbytDUHVLSiD3A/wH sddFR7c4WuyzRm8fnUOsnHK+RFDJrh26Q3Ncg+gO5/u+GbSkmNDWpIE5Tr3DWijOZ3Rw NPEa6a23bZBgSKsRNyZWHyMETcVtR+oqM7ceSnboOpjP8PxrMm2jBrVoYDUrs+f95HRz +VMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701365588; x=1701970388; 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=sBsr057p0mWa+fyXDknmhrnfXctpN8P3IKtTb0zms8Y=; b=B+IhVj/oVXEG/s2rdWmhBsZSe+sh29T905xP1hq5IAP5BmpwoNIU2X3BR8Qty2CfLM pmDB2xq9u3KWQdhRNPp0KDVAjYXKoWIUZjiPz3rjvD3w2lSmmd4i7Bk4eewtveVFe7jK sgqyiA19zdvH2Zc1EBqzyWQ5zMklhj8dQ0T6DG+0GWtz28UFmKIAdSUPSi1FHiIRmArx TmK3MbYtksk/3le0qwpp17NneaFaXALm8ciODzERAbZmgv5p08pqur+6WKbOE7tChRvm fePk0bwfnWPrSr9Gxxw5KMNNasUCF1HH+6/t6ib3+tkpZ1qSnA97QG7KXMX2zPntIMen BeVg== X-Gm-Message-State: AOJu0YzvohuTOs+pilByc6SIIRiAP9NY6Un71OR3E0NMNAoDFJ1k7Sv8 okAVqD2rWpA6Vhb0D2HHhhI= X-Google-Smtp-Source: AGHT+IE6/cD81OTXRMGjDt7WKZJaW3ex+ommkFCJanQkmKd2Wowfqjz7vcDZaE6v/NBdhI4zshuTrw== X-Received: by 2002:a17:903:2444:b0:1cf:da41:729c with SMTP id l4-20020a170903244400b001cfda41729cmr15349705pls.56.1701365588006; Thu, 30 Nov 2023 09:33:08 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id iw19-20020a170903045300b001cfde4c84bcsm1657351plb.141.2023.11.30.09.33.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Nov 2023 09:33:07 -0800 (PST) Message-ID: <9882ea34-659c-4e48-9536-e97ed2bda2c4@gmail.com> Date: Thu, 30 Nov 2023 10:33:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFA] New pass for sign/zero extension elimination Content-Language: en-US To: Joern Rennecke , Jeff Law Cc: GCC Patches , richard.sandiford@arm.com References: <51510aa5-eb02-47a4-86c3-ecaa13ce26af@ventanamicro.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 11/28/23 06:36, Joern Rennecke wrote: > On Mon, 27 Nov 2023 at 20:18, Jeff Law wrote: >> >> >> >> On 11/27/23 13:03, Richard Sandiford wrote: >>> Joern Rennecke writes: >>>> On 11/20/23 11:26, Richard Sandiford wrote: >>>>>> + /* ?!? What is the point of this adjustment to DST_MASK? */ >>>>>> + if (code == PLUS || code == MINUS >>>>>> + || code == MULT || code == ASHIFT) >>>>>> + dst_mask >>>>>> + = dst_mask ? ((2ULL << floor_log2 (dst_mask)) - 1) : 0; >>>>> >>>>> Yeah, sympathise with the ?!? here :) >>>> Jeff Law: >>>>> Inherited. Like the other bit of magic I think I'll do a test with them >>>>> pulled out to see if I can make something undesirable trigger. >>>> >>>> This represents the carry effect. Even if the destination only cares about >>>> some high order bits, you have to consider all lower order bits of the inputs. >>>> >>>> For ASHIFT, you could refine this in the case of a constant shift count. >>> >>> Ah, right. Think it would be worth a comment. >> Definitely. Wouldn't SIGN_EXTEND have a similar problem? While we >> don't care about all the low bits, we do care about that MSB. > > Yes, if bits outside of the MODE_MASK of the input (i.e. higher bits) are > life in the output, than we want the high bit of the SIGN_EXTEND input live. So I had a hack in my tree to do this for a while, but it was early in the effort to test this across more targets. It wasn't clear at that point in the effort if it was correct or just working around bugs elsewhere. After we had everything working across the various targets I pulled it out without ill effects. It looks like you're handling it in your carry_backpropagate changes. Jeff