All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@redhat.com>
To: Richard Henderson <rth@redhat.com>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>,
	Nigel Stephens <nigel@mips.com>,
	gcc-patches@gcc.gnu.org, linux-mips@linux-mips.org
Subject: Re: [patch] MIPS/gcc: Revert removal of DImode shifts for 32-bit targets
Date: Fri, 03 Sep 2004 08:05:15 +0100	[thread overview]
Message-ID: <87sm9zg7dg.fsf@redhat.com> (raw)
In-Reply-To: <20040903065331.GG20559@redhat.com> (Richard Henderson's message of "Thu, 2 Sep 2004 23:53:31 -0700")

Richard Henderson <rth@redhat.com> writes:
> On Tue, Aug 31, 2004 at 08:51:20PM +0100, Richard Sandiford wrote:
>> int TARGET_SHIFT_TRUNCATION_MASK (enum machine_mode MODE)
> ...
>>      Note that, unlike `SHIFT_COUNT_TRUNCATED', this function does
>>      _not_ apply to general shift rtxes; it applies only to instructions
>>      that are generated by the named shift patterns.
>
> I'm not particularly thrilled about this notion.  I'd much prefer a
> target hook that could replace SHIFT_COUNT_TRUNCATED.  How often are
> the named patterns going to differ from the rtxes anyway?

Well, the problem is that SHIFT_COUNT_TRUNCATED applies to all shift
rtxes, including those synthesised by things like combine.c:expand_
compound_operation().  I assume that's why SHIFT_COUNT_TRUNCATED is
documented as follows:

     A C expression that is nonzero if on this machine the number of bits
     actually used for the count of a shift operation is equal to the number
     of bits needed to represent the size of the object being shifted.  When
     this macro is nonzero, the compiler will assume that it is safe to omit
     a sign-extend, zero-extend, and certain bitwise `and' instructions that
     truncates the count of a shift operation.  On machines that have
     instructions that act on bit-fields at variable positions, which may
     include `bit test' instructions, a nonzero @code{SHIFT_COUNT_TRUNCATED}
     also enables deletion of truncations of the values that serve as
     arguments to bit-field instructions.

     If both types of instructions truncate the count (for shifts) and
     position (for bit-field operations), or if no variable-position bit-field
     instructions exist, you should define this macro.

     However, on some machines, such as the 80386 and the 680x0, truncation
     only applies to shift operations and not the (real or pretended)
     bit-field operations.  Define @code{SHIFT_COUNT_TRUNCATED} to be zero on
     such machines.  Instead, add patterns to the @file{md} file that include
     the implied truncation of the shift instructions.

I was deliberately trying to avoid this fuzziness with the new target hook.

E.g., if it ever becomes useful to know that ashlsi3 truncates on x86,
then it will be possible to use the new hook there too, even though the
requirements of S_C_T aren't met.

Richard

  reply	other threads:[~2004-09-03  7:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-19 15:35 [patch] MIPS/gcc: Revert removal of DImode shifts for 32-bit targets Maciej W. Rozycki
2004-07-19 16:59 ` Richard Sandiford
2004-07-19 17:32   ` [patch] MIPS/gcc: Revert removal of DImode shifts for 32-bittargets David Edelsohn
2004-07-19 17:33   ` [patch] MIPS/gcc: Revert removal of DImode shifts for 32-bit targets Maciej W. Rozycki
2004-07-19 17:37     ` Richard Sandiford
2004-07-19 21:38     ` Richard Henderson
2004-07-23 14:41       ` Maciej W. Rozycki
2004-07-23 20:27         ` Richard Henderson
2004-07-23 21:12           ` Ralf Baechle
2004-07-26 11:56             ` Maciej W. Rozycki
2004-08-02 20:03               ` Nigel Stephens
2004-08-03  5:30                 ` Richard Sandiford
2004-08-03  9:22                   ` Nigel Stephens
2004-08-03  9:36                     ` Richard Sandiford
2004-08-03  9:54                       ` Nigel Stephens
2004-08-04 19:57                         ` Maciej W. Rozycki
2004-08-04 20:37                           ` Nigel Stephens
2004-08-04 20:54                             ` Maciej W. Rozycki
2004-08-04 23:39                               ` Nigel Stephens
2004-08-07 19:01                           ` Richard Sandiford
2004-08-09 22:08                             ` Richard Henderson
2004-08-10  5:30                               ` Richard Sandiford
2004-08-10 23:20                                 ` Richard Henderson
2004-08-11  0:24                                   ` Andreas Schwab
2004-08-11  0:40                                   ` Paul Brook
2004-08-11  4:32                                     ` Richard Henderson
2004-08-31 19:51                                   ` Richard Sandiford
2004-09-03  6:53                                     ` Richard Henderson
2004-09-03  7:05                                       ` Richard Sandiford [this message]
2004-09-03  7:08                                         ` Richard Henderson
2004-09-03  7:11                                           ` Richard Sandiford
2004-09-03  7:20                                             ` Richard Henderson
2004-09-03  7:29                                               ` Richard Sandiford
2004-09-03 20:15                                                 ` Richard Henderson
2004-09-04  8:53                                                   ` Richard Sandiford
2004-09-05  0:03                                                     ` Richard Henderson

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=87sm9zg7dg.fsf@redhat.com \
    --to=rsandifo@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    --cc=nigel@mips.com \
    --cc=rth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.