public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Jiufu Guo <guojiufu@linux.ibm.com>
Cc: Jiufu Guo via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <richard.guenther@gmail.com>,
	Richard Biener <rguenther@suse.de>,
	dje.gcc@gmail.com, linkw@gcc.gnu.org, jeffreyalaw@gmail.com
Subject: Re: [PATCH] loading float member of parameter stored via int registers
Date: Fri, 30 Dec 2022 01:44:19 -0600	[thread overview]
Message-ID: <20221230074419.GE25951@gate.crashing.org> (raw)
In-Reply-To: <7epmc1eil4.fsf@pike.rch.stglabs.ibm.com>

Hi!

On Fri, Dec 30, 2022 at 10:22:31AM +0800, Jiufu Guo wrote:
> Considering the limitations of CSE, I try to find other places
> to handle this issue, and notice DSE can optimize below code:
> "[sfp:DI]=x:DI ; y:SI=[sfp:DI]" to "y:SI=x:DI#0".
> 
> So, I drafted a patch to update DSE to handle DI->DF/SF.
> The patch updates "extract_low_bits" to get mode change 
> with subreg.
> 
> diff --git a/gcc/expmed.cc b/gcc/expmed.cc
> index b12b0e000c2..5e36331082c 100644
> --- a/gcc/expmed.cc
> +++ b/gcc/expmed.cc
> @@ -2439,7 +2439,10 @@ extract_low_bits (machine_mode mode, machine_mode src_mode, rtx src)
>  
>    if (!targetm.modes_tieable_p (src_int_mode, src_mode))
>      return NULL_RTX;
> -  if (!targetm.modes_tieable_p (int_mode, mode))
> +  if (!targetm.modes_tieable_p (int_mode, mode)
> +      && !(known_le (GET_MODE_BITSIZE (mode), GET_MODE_BITSIZE (src_mode))
> +	   && GET_MODE_CLASS (mode) == MODE_FLOAT
> +	   && GET_MODE_CLASS (src_mode) == MODE_INT))
>      return NULL_RTX;
>  
>    src = gen_lowpart (src_int_mode, src);

Ah!  This simply shows rs6000_modes_tieable_p is decidedly non-optimal:
it does not allow tying a scalar float to anything else.  No such thing
is required, or good apparently.  I wonder why we have such restrictions
at all in rs6000; is it just unfortunate history, was it good at one
point in time?


Segher

  reply	other threads:[~2022-12-30  7:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  6:27 Jiufu Guo
2022-12-21  7:30 ` Richard Biener
2022-12-22  7:25   ` guojiufu
2022-12-22  7:54     ` Richard Biener
2022-12-22  9:02       ` Jiufu Guo
2022-12-22 11:28         ` Richard Biener
2022-12-22 18:40           ` Segher Boessenkool
2022-12-23 12:23             ` Jiufu Guo
2022-12-23 12:36         ` Jiufu Guo
2022-12-23 14:45           ` Segher Boessenkool
2022-12-23 16:20             ` Richard Biener
2022-12-23 16:52               ` Segher Boessenkool
2022-12-23 19:13                 ` Richard Biener
2022-12-23 19:52                   ` Segher Boessenkool
2022-12-27  3:03                     ` Jiufu Guo
2022-12-27 14:16                       ` Jiufu Guo
2022-12-30  2:22                         ` Jiufu Guo
2022-12-30  7:44                           ` Segher Boessenkool [this message]
2022-12-30  8:30                             ` Andrew Pinski
2023-01-03  3:28                               ` Jiufu Guo
2023-01-03  8:59                               ` Segher Boessenkool
2023-01-03  9:10                                 ` Hu, Lin1
2022-12-27  2:15             ` Jiufu Guo

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=20221230074419.GE25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guojiufu@linux.ibm.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=linkw@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.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).