public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ajit Agarwal <aagarwa1@linux.ibm.com>
To: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	Peter Bergner <bergner@linux.ibm.com>,
	Jakub Jelinek <jakub@redhat.com>,
	Richard Biener <richard.guenther@gmail.com>
Subject: [PING] [PATCH v3 3/4] ree: Main functionality to Improve ree pass for rs6000 target
Date: Wed, 31 May 2023 11:02:28 +0530	[thread overview]
Message-ID: <e6fc3ff3-5ac1-514a-b572-497793e0b515@linux.ibm.com> (raw)
In-Reply-To: <94a44d12-d0e2-f825-c129-1ed1122ce234@linux.ibm.com>

Hello Jeff:

Please review Jeff.

Thanks & Regards
Ajit

On 12/05/23 4:48 pm, Ajit Agarwal via Gcc-patches wrote:
> Hello Jeff:
> 
> 
> On 29/04/23 3:40 am, Jeff Law wrote:
>>
>>
>> On 4/20/23 15:03, Ajit Agarwal wrote:
>>
>>>
>>> Currently I support AND with const1_rtx. This is what is equivalent to zero extension instruction in power instruction set. When you specify many other constants and Could you please specify what other constants needs to be supported and how to determine on the Input and output modes.
>> x AND <constant> will result in a zero-extended representation for a variety of constants, not just 1.  For example
>>
>> For example x AND 3, x AND 7, x AND 15, etc.
>>
>> If (const_int 1) is really that special here, then I've either completely misunderstood the intention of your patch or there's something quite special about the PPC port that I'm not aware of.
>>
> 
> Here is the patch to address above.
> 
> 	ree: Improve ree pass for rs6000 target
> 
> 	For rs6000 target we see redundant zero and sign
> 	extension and done to improve ree pass to eliminate
> 	such redundant zero and sign extension. Support of
> 	AND with extension with different constants other
> 	than 1.
> 
> 	2023-05-12  Ajit Kumar Agarwal  <aagarwa1@linux.ibm.com>
> 
> gcc/ChangeLog:
> 
> 	* ree.cc (rtx_is_zext_p): Add AND with varying contsants as
> 	extensions.
> ---
>  gcc/ree.cc | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/gcc/ree.cc b/gcc/ree.cc
> index 96fda1ac658..ddda5f194bb 100644
> --- a/gcc/ree.cc
> +++ b/gcc/ree.cc
> @@ -269,8 +269,11 @@ rtx_is_zext_p (rtx insn)
>        rtx set = XEXP (insn, 0);
>        if (REG_P (set))
>  	{
> -	   if (XEXP (insn, 1) == const1_rtx)
> -	     return true;
> +	  rtx src = XEXP (insn, 1);
> +
> +	  if (CONST_INT_P (src)
> +	      && IN_RANGE (exact_log2 (UINTVAL (src)), 0, 7))
> +	    return true;
>  	}
>        else
>  	return false;
> @@ -297,9 +300,11 @@ rtx_is_zext_p (rtx_insn *insn)
>  
>       if (REG_P (set) && GET_MODE (SET_DEST (body)) == GET_MODE (set))
>         {
> -	 if (GET_MODE_UNIT_SIZE (GET_MODE (SET_DEST (body)))
> -	     >= GET_MODE_UNIT_SIZE (GET_MODE (set)))
> -	   return true;
> +	  rtx src = XEXP (SET_SRC (body), 1);
> +
> +	  if (CONST_INT_P (src)
> +	      && IN_RANGE (exact_log2 (UINTVAL (src)), 0, 7))
> +	    return true;
>         }
>       else
>        return false;

      reply	other threads:[~2023-05-31  5:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19 18:00 Ajit Agarwal
2023-04-19 21:53 ` Jeff Law
2023-04-20 21:03   ` Ajit Agarwal
2023-04-20 21:18     ` Ajit Agarwal
2023-04-20 21:21     ` Ajit Agarwal
2023-04-28 22:10     ` Jeff Law
2023-05-12 11:18       ` Ajit Agarwal
2023-05-31  5:32         ` Ajit Agarwal [this message]

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=e6fc3ff3-5ac1-514a-b572-497793e0b515@linux.ibm.com \
    --to=aagarwa1@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=richard.guenther@gmail.com \
    --cc=segher@kernel.crashing.org \
    /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).