public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Joern Rennecke <joern.rennecke@embecosm.com>,
	Jeff Law <jlaw@ventanamicro.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, richard.sandiford@arm.com
Subject: Re: [RFA] New pass for sign/zero extension elimination
Date: Thu, 30 Nov 2023 10:33:03 -0700	[thread overview]
Message-ID: <9882ea34-659c-4e48-9536-e97ed2bda2c4@gmail.com> (raw)
In-Reply-To: <CAMqJFCpfHXnEu5fXOAruU44H90ZcHkg9EDxxT9Cj4Y2DRksTcw@mail.gmail.com>



On 11/28/23 06:36, Joern Rennecke wrote:
> On Mon, 27 Nov 2023 at 20:18, Jeff Law <jlaw@ventanamicro.com> wrote:
>>
>>
>>
>> On 11/27/23 13:03, Richard Sandiford wrote:
>>> Joern Rennecke <joern.rennecke@embecosm.com> 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

  parent reply	other threads:[~2023-11-30 17:33 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 17:36 Joern Rennecke
2023-11-27 17:57 ` Joern Rennecke
2023-11-27 20:03   ` Richard Sandiford
2023-11-27 20:18     ` Jeff Law
2023-11-28 13:36       ` Joern Rennecke
2023-11-28 14:09         ` Joern Rennecke
2023-11-30 17:33         ` Jeff Law [this message]
2023-11-28 13:13     ` Joern Rennecke
2023-11-28  5:50 ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2023-11-29 17:37 Joern Rennecke
2023-11-29 19:13 ` Jivan Hakobyan
2023-11-30 15:37 ` Jeff Law
2023-11-27 18:19 Joern Rennecke
2023-11-28  5:51 ` Jeff Law
2023-11-20  0:47 Jeff Law
2023-11-20  1:22 ` Oleg Endo
2023-11-20  2:51   ` Jeff Law
2023-11-20  2:57     ` Oleg Endo
2023-11-20  2:23 ` Xi Ruoyao
2023-11-20  2:46   ` Jeff Law
2023-11-20  2:52   ` Jeff Law
2023-11-20  3:32     ` Xi Ruoyao
2023-11-20  3:48       ` Jeff Law
2023-11-20 18:26 ` Richard Sandiford
2023-11-22 17:59   ` Jeff Law
2023-11-27 20:15     ` Richard Sandiford
2023-11-20 18:56 ` Dimitar Dimitrov
2023-11-22 22:23   ` Jeff Law
2023-11-26 16:42     ` rep.dot.nop
2023-11-27 16:14       ` Jeff Law
2023-11-27 11:30 ` Andrew Stubbs
2023-11-27 16:16   ` Jeff Law
2023-12-01  1:08 ` Hans-Peter Nilsson
2023-12-01 15:09   ` Jeff Law
2023-12-01 16:17     ` Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9882ea34-659c-4e48-9536-e97ed2bda2c4@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jlaw@ventanamicro.com \
    --cc=joern.rennecke@embecosm.com \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).