From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id A3E273858C2D for ; Mon, 27 Nov 2023 20:18:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A3E273858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A3E273858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701116313; cv=none; b=rnieLZBt5C8Ov0JLCW3g7SKb76rDRA+QSU1NB52BoZzN42iJwlYqodbgH8DvSPcJVmEYZ1eGyGxfK2xgGSy3TF/CRqPIv9+cMJr4XqqmHYA6RBIcdssaH+aKn1ZYuzabV7uZUdra+D+eNUDx8Uc/7Rt1hOZbLQJBBG4LQ6udE/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701116313; c=relaxed/simple; bh=84AoF/eUH9Zo8axUYRWvX+8wV4rcX47HsE4pJe3eYPU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=s6dpoF1qVjj54cqBt+sJQpXERnsCmeIsoxiEBbZ1vfDig5ImqoSsVaI8To6ZdbSLwr63DnxqQbwl5DfW92Q2nS2QGYOJP1JeZFUeS/9C34tIxH9uWcF+5zm1RuubW3yVVjQUHCkty3J/L6IU0hu0h+HcR7e5Xn8tN1A9AjDzM0s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cfaaa79766so25933275ad.3 for ; Mon, 27 Nov 2023 12:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1701116309; x=1701721109; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=3UH3tPHETiujo8aHPTA6t1WqQD0sBAHWLNGmo0Pa0no=; b=bce8Z0UEnL9IkwKkmZdwW4kWbXXqFlpLLEVev4kB07R5yB/B+5QfMmgzOuEgvtoZf1 joV9678i8HSffOIky2HfKEKfCHMW5+k4qfeQITJJYxQZ75wRhOiHc3djGMyhA8N2H07V rTHbE/eipazzcV/TzlMVPMtKzNM1tic5/y/vXVCT1RPoyqLImrsjp1hy6T52RsOcpJ2m tadlfFb0ZdYp/NyCZMi7/EBeYFF55+N8l+wFlqntHODoTye+xYOto9RZ1BUCm7ijr7Lj ypX7m7aVUOQOMffI/rlGNhyNObhZNpGmP55v3uin6gM19r2GbbAQlzenOpebhcDdDBWq ie3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701116309; x=1701721109; h=content-transfer-encoding:in-reply-to:from:references: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=3UH3tPHETiujo8aHPTA6t1WqQD0sBAHWLNGmo0Pa0no=; b=oMYrQvZPv+SiDI0kUIhnhVu1OSzjnVFPgmWf4iQt8Whyx0/E8gT9lp0qcDBe3giluu wXe8xgVD6TaUQj+O41pDF6iIjfNu4mTkCJ1cFD+EyR7giiGI/s5ABjApX0MBVjbMOkQf KluScEH2/3QjmeS0JAxz+H76ItQVeMVfwXmgnvU3nE+KcF0eWSyHet4tpCCwnbrhYl1D IqmGNyqAWa7OprWk/2Qg/rPpCTuwnx24dJBmO0zd0T8xcSyfRSD/wecKfrAQBNkpCSgw /C89KY7wzMMdLwLc0gKMbpqa+Zqz4lCYNfVKyziIpg+wT7U7OeVTf8KxiigWI1/kPtfn +0DQ== X-Gm-Message-State: AOJu0Yzt1yaU7bVjJj3O3qjMswwv5Os/tkLfxOWVhv5SnvLX3wkBzPcp kA/U3qqpkcNl7UMrpmxAemS9Gg== X-Google-Smtp-Source: AGHT+IHq9EvnyEeJKILiG/FLe8Fo42hbBE3V8Qi37KZdgbZMA6ROjTBozV86Qawogs5rwwTS/TmAkw== X-Received: by 2002:a17:902:ced0:b0:1cc:ae1a:b0b8 with SMTP id d16-20020a170902ced000b001ccae1ab0b8mr17244683plg.44.1701116309490; Mon, 27 Nov 2023 12:18:29 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id 13-20020a170902e9cd00b001cfca7b8ec4sm2771030plk.101.2023.11.27.12.18.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 12:18:29 -0800 (PST) Message-ID: <51510aa5-eb02-47a4-86c3-ecaa13ce26af@ventanamicro.com> Date: Mon, 27 Nov 2023 13:18:23 -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 , GCC Patches , richard.sandiford@arm.com References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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/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. > > But I wonder whether we should centralise all this code-specific > information into a single place. I.e. rather than having one switch to > say "PLUS is OK" or "AND is OK", and then having code-specific handling > elsewhere, we could enumerate how to handle a code. Yea. That's where I was starting to go with the code which indicates we can't necessarily narrow a shift count. ie, what are the properties of the opcodes and how do they translate into the bits we need clear from LIVENOW (for sets) and the bits we need to make live (for uses). Jeff