From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id C16FE3858C2D for ; Mon, 27 Nov 2023 20:03:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C16FE3858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C16FE3858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701115406; cv=none; b=raWrnrAMKAjrWxBIM++ZfHsHHc15qvEbsUmPTlzLdQrMkDvsh8DAW+7dfashp1siPVomzQBZ5RVWi6S2TLDRhtDm7LrVCDtnAiO+8j3Pzr9KaHCoDBi+jA9WeA7IsFn81P26GAU/oKq5QZ3CFjzvYtKxSYeKgJwVdYtrgGcP+p4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701115406; c=relaxed/simple; bh=rPMovrYd6rju3EQDwo6ffeGGuKgFHczDZgDZo7zjlHE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ojlemKPX5s6jbEViuLrwdjqh+B7ZHXEbSCLYwwf7ihaoXQ7l/x0/lCksXCHY8JLB2ieLlJ/rCqkW7nr3+rGFMvnXgSVByNH0/rmFUMJdDRxqIuWipZjOFQQYsNPcyCJkH4q+Gg8JGzoijfFBB1hTqOnc0/pY/8dqNGWhqDkvNmQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 31E1B2F4; Mon, 27 Nov 2023 12:04:12 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D5D693F5A1; Mon, 27 Nov 2023 12:03:23 -0800 (PST) From: Richard Sandiford To: Joern Rennecke Mail-Followup-To: Joern Rennecke ,GCC Patches , jlaw@ventanamicro.com, richard.sandiford@arm.com Cc: GCC Patches , jlaw@ventanamicro.com Subject: Re: [RFA] New pass for sign/zero extension elimination References: Date: Mon, 27 Nov 2023 20:03:22 +0000 In-Reply-To: (Joern Rennecke's message of "Mon, 27 Nov 2023 17:57:17 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-16.5 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. 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. Thanks, Richard