From: Paolo Bonzini <bonzini@gnu.org>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: Richard Henderson <rth@redhat.com>,
Richard Guenther <rguenther@suse.de>,
gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][RFC] Bit CCP and pointer alignment propagation
Date: Fri, 30 Jul 2010 18:06:00 -0000 [thread overview]
Message-ID: <4C53119B.8080001@gnu.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1007301637020.13327@digraph.polyomino.org.uk>
On 07/30/2010 06:41 PM, Joseph S. Myers wrote:
> On Fri, 30 Jul 2010, Richard Henderson wrote:
>
>> On 07/30/2010 06:15 AM, Richard Guenther wrote:
>>> I think we can have negative shift counts (at least the constant folding
>>> code suggests so), this is why I have the code as-is.
>>
>> VAX has them; I can't recall any other target that does.
>>
>> Almost all truncate the shift count at some bit position
>> (sometimes at the largest supported shift count, e.g.
>> truncate to 6 bits even for a 32-bit shift because there
>> exists a 64-bit shift; TARGET_SHIFT_TRUNCATION_MASK will
>> tell you about this).
>
> ARM NEON vector shifts can have negative shift counts (and also truncate).
> The VSHL (register) instruction takes its shift counts from the least
> significant byte of each element of the second vector, sign-extended (so
> right shifts are represented by shift counts whose low byte is negative).
>
> Obviously that is a description of the instruction semantics, not of RTL
> or GIMPLE.
Yes, that's the crux. If you wanted to access it you could with an
intrinsic, not with << and >>. If it is better for us (e.g. simpler or
less code), we should define our intermediate representation to disallow
negative shifts. It will make GIMPLE and RTL slightly worse for VAX,
and slightly better for everything else. Targets that care about
negative shifts can use a builtin or unspec respectively.
For the case at hand of course it's not too contorted to allow negative
shifts, so all this is theoretical.
Paolo
next prev parent reply other threads:[~2010-07-30 17:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-30 12:06 Richard Guenther
2010-07-30 12:39 ` Paolo Bonzini
2010-07-30 12:54 ` Paolo Bonzini
2010-07-30 13:02 ` Richard Guenther
2010-07-30 13:16 ` Paolo Bonzini
2010-07-30 13:29 ` Richard Guenther
2010-07-30 13:38 ` Paolo Bonzini
2010-07-30 13:45 ` Richard Guenther
2010-07-30 14:24 ` Paolo Bonzini
2010-07-30 14:51 ` Richard Guenther
2010-07-30 16:23 ` Richard Henderson
2010-07-30 16:38 ` Richard Guenther
2010-07-30 16:49 ` Joseph S. Myers
2010-07-30 18:06 ` Paolo Bonzini [this message]
2010-07-30 13:36 ` Michael Matz
2010-07-30 13:39 ` Richard Guenther
2010-07-30 14:26 ` Michael Matz
2010-08-04 7:43 Jay Foad
2010-08-04 8:18 ` Richard Guenther
2010-08-04 13:05 Jay Foad
2010-08-04 13:11 ` Richard Guenther
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=4C53119B.8080001@gnu.org \
--to=bonzini@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=rguenther@suse.de \
--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 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).