public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Richard Biener <richard.guenther@gmail.com>
Cc: liuhongt <hongtao.liu@intel.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Michael Meissner <meissner@linux.ibm.com>,
	Jim Wilson <jimw@sifive.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	Andrew Waterman <andrew@sifive.com>,
	asolokha@gmx.com
Subject: Re: [PATCH 2/2] validate_subreg before call gen_lowpart to avoid ICE.
Date: Fri, 10 Sep 2021 08:30:10 -0500	[thread overview]
Message-ID: <20210910133010.GV1583@gate.crashing.org> (raw)
In-Reply-To: <CAFiYyc1PLHu0MNX4xaF88zz1ryeDrUnLnMmiL8VhYmSRUOL0jw@mail.gmail.com>

On Fri, Sep 10, 2021 at 03:15:56PM +0200, Richard Biener wrote:
> On Fri, Sep 10, 2021 at 2:58 PM liuhongt <hongtao.liu@intel.com> wrote:
> >        if (REG_P (target)
> > -         && TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (target), ext_mode))
> 
> ^^^
> 
> I wonder if herein lies the problem in that the HFmode "truncation" from SImode
> is considered noop?  Note the underlying target hook only looks at the mode
> precision and thus receives 16 and 32, and thus maybe that
> TRULY_NOOP_TRUNCATION_MODES_P query only makes sense for
> integer modes?  Though the documentation of the hook only talks about
> "conversion" of "values" ...

@deftypefn {Target Hook} bool TARGET_TRULY_NOOP_TRUNCATION (poly_uint64 @var{outprec}, poly_uint64 @var{inprec})
This hook returns true if it is safe to ``convert'' a value of
@var{inprec} bits to one of @var{outprec} bits (where @var{outprec} is
smaller than @var{inprec}) by merely operating on it as if it had only
@var{outprec} bits.  The default returns true unconditionally, which
is correct for most machines.  When @code{TARGET_TRULY_NOOP_TRUNCATION}
returns false, the machine description should provide a @code{trunc}
optab to specify the RTL that performs the required truncation.


@cindex @code{trunc@var{m}@var{n}2} instruction pattern
@item @samp{trunc@var{m}@var{n}2}
Truncate operand 1 (valid for mode @var{m}) to mode @var{n} and
store in operand 0 (which has mode @var{n}).  Both modes must be fixed
point or both floating point.


TRULY_NOOP_TRUNCATION does not make sense to ask if changing mode class.


Segher

  parent reply	other threads:[~2021-09-10 13:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 12:58 [PATCH 0/2] Revert r12-3277 since it caused regressions on many other targets liuhongt
2021-09-10 12:58 ` [PATCH 1/2] Revert "Get rid of all float-int special cases in validate_subreg." liuhongt
2021-09-10 13:05   ` Richard Biener
2021-09-10 12:58 ` [PATCH 2/2] validate_subreg before call gen_lowpart to avoid ICE liuhongt
2021-09-10 13:15   ` Richard Biener
2021-09-10 13:27     ` Hongtao Liu
2021-09-10 13:32       ` Richard Biener
2021-09-10 13:44         ` Hongtao Liu
2021-09-10 14:25           ` Hongtao Liu
2021-09-10 21:19             ` Segher Boessenkool
2021-09-11  0:29               ` Hongtao Liu
2021-09-11  1:04                 ` Hongtao Liu
2021-09-10 13:52         ` Hongtao Liu
2021-09-10 13:39       ` Hongtao Liu
2021-09-10 13:30     ` Segher Boessenkool [this message]
2021-09-10 13:58       ` Richard Biener
2021-09-10 16:24         ` Segher Boessenkool
2021-09-10 18:36           ` Richard Biener
2021-09-10 21:27             ` Segher Boessenkool
2021-09-11  8:25               ` Richard Biener
2021-09-11  9:51                 ` Hongtao Liu
2021-09-11 11:09                   ` Hongtao Liu
2021-09-13  6:10   ` Richard Biener
2021-09-13  6:32     ` Hongtao Liu
2021-09-13  9:15       ` Richard Biener
2021-09-13 11:14         ` Hongtao Liu
2021-09-13 11:44           ` Tobias Burnus
2021-09-13 11:45           ` Richard Biener

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=20210910133010.GV1583@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=andrew@sifive.com \
    --cc=asolokha@gmx.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=jimw@sifive.com \
    --cc=meissner@linux.ibm.com \
    --cc=richard.guenther@gmail.com \
    --cc=schwab@linux-m68k.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).