From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id D206E385AC11 for ; Tue, 28 Nov 2023 14:09:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D206E385AC11 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D206E385AC11 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1032 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701180586; cv=none; b=I7zFk6G1YhJpzV8PtFZxe1wlY5mkoK312NWeMnWqAxaflBQkKYcGmG38AvObmVLEEXlmQg+YKrOOfXikdwKrU5lcHUZkNCSji3LUWxl9it7ZzUXkCkdmO6/T0zKXKI3zRpnlMRY2/UVEhhdUX69UPtBhXjrttbq4qJzGCf8lTuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701180586; c=relaxed/simple; bh=6Wa0T9wfDAdw+lD5j2aO5d0tEvrts0VpZGByc8SRovE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=tXP+cxyT+xyoOpZQ03l0DLTUV+ljFZkPLGikUH1XQu5TJNVXpXqh/Y6sEcgsDWsZeoNqpKGHigv5nKBi1baBMVVIrDfsvjZLiNVnlh+ZhhlZCCDbkXC4EcdR1HS3n4GeBKVuj1przTsWI3RL3RMywf03NsUGN5b4JbtfxwoWiEM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-285abb82925so2218151a91.3 for ; Tue, 28 Nov 2023 06:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1701180584; x=1701785384; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oQ7K4JXF5fGLw3kqry2km+btIJxBdC2iuBwG/lnrckU=; b=RiHcPfm4iz2V5RHN/4zopa15oLH4ubmMzQEs98zV1cWKmEM52ICvSD99erEDgNYm+B EX4Z6Rxh+bI/NbKUQEsoCe82zGCjoCdE4DOYUzrpwpk2DD/5PePzioCZT9crKf6gmVTe 1qWw1lwSFXcXPicPlKNud3DDwsk5SoNLnp3bWtIBP9CvcmCwJcCih4kamog7QXpKsWvE TW4ggw08lV2liqboG+x11EE7GXwbjb2OKr6MJPPuwLhUvEjRplFRU0MFZGDEHo8HUc08 7qF4/V7E463Jftx3PwntJnmgAofZUL6jFAahDEDTf+AWcoiUfPDcnceojKhclPu6/ktX 3XqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701180584; x=1701785384; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oQ7K4JXF5fGLw3kqry2km+btIJxBdC2iuBwG/lnrckU=; b=DAWTvjS9XM3DMGSVtPoWx0rZLsPXjO+4UwTsqzWGcAlH6Ds8AwaVm5PbbC1f6zqV/9 8gb2D32eqdEnATZmgKCYZ2Fz+PhIoYS0ygkCh31fnWS5thy1v5M3EfheopVTghdI7YlR 6zk/X1frBmPg2FoIdHgCDCiKlkBd4w+7zu4j8PRgDeFxDbiEnQFXQFrfohb6K/R0UJrF mkeNwiGSNjBe2Y4zFs2REjD077so6WrPRE/keYuhgbpylxCmGUF9Tny7dcjmJORko/X/ DWwpbs8TQBxD4C9u7itakjHUh9/26DexLAB/mhNC6JxB9IZ2HzRlxaMF0IyHBuF6oVlL 3/Qg== X-Gm-Message-State: AOJu0Yy5VMvu51aezdsi9iv1Y2oWwDQf5rLXyRFPAF+t0C4+tJQqxSy3 3ydS8qxkH1t9NI1afmVzpd6m+Bdsu6ozspL1faFNkQ== X-Google-Smtp-Source: AGHT+IFp/NSxBDIzghW1FURcnJmE1Zbn/Did8JMIEXEfiPaaWVHDlRE5CZSQmodx6fx/aicjvzf12z1OpKzEvHA0B00= X-Received: by 2002:a17:90b:8d6:b0:285:8aa4:2ed8 with SMTP id ds22-20020a17090b08d600b002858aa42ed8mr13160535pjb.15.1701180583748; Tue, 28 Nov 2023 06:09:43 -0800 (PST) MIME-Version: 1.0 References: <51510aa5-eb02-47a4-86c3-ecaa13ce26af@ventanamicro.com> In-Reply-To: From: Joern Rennecke Date: Tue, 28 Nov 2023 14:09:32 +0000 Message-ID: Subject: Re: [RFA] New pass for sign/zero extension elimination To: Jeff Law Cc: GCC Patches , richard.sandiford@arm.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.6 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 Tue, 28 Nov 2023 at 13:36, Joern Rennecke wrote: > For the saturating truncation operations, we have the high-to-low propagation, > but no low-to-high propagation, so that would be something separate to model. P.S.: For unsigned saturating truncation, the propagation from higher to lower bits only happens for bits that are truncated off. e.g. if we truncate a 64 bit value to a 32 bit value, and only the lower 16 bit of the result are live, we got an output live mask 0x000000000000ffff implying an input live mask: 0xffffffff0000ffff For signed saturating truncation, we got an extra corner case. For the same data widths as above, the value 0xffffffff80000000 truncates to: 0x80000000 but 0x0000000080000000 truncates to: 0x7fffffff so the top bit that is included in the truncated mode propagates to all the lower bits (irrespective if it itself is live in the output), so it is live in the input if any bit is live in the output - just like all the truncated-off bits.