From: "H.J. Lu" <hjl.tools@gmail.com>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant
Date: Thu, 28 Jul 2011 03:11:00 -0000 [thread overview]
Message-ID: <CAMe9rOpHJU8xQf19jNOK6V7hT3jN8kPQTQCLMNtDLR2PBJV_2g@mail.gmail.com> (raw)
In-Reply-To: <4E307432.80501@gnu.org>
On Wed, Jul 27, 2011 at 1:25 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 07/27/2011 07:29 PM, H.J. Lu wrote:
>>
>> If IRNORE_ADDRESS_WRAP_AROUND is TRUE, we
>> + also permute the conversion and addition of a constant. It is used to
>> + optimize cases where overflow of base + constant offset won't happen
>> or
>> + its behavior is implementation-defined for a given target. */
>
> Regarding correctness: you're converting a SImode operation to DImode by
> "pushing in" the zero_extend operation. What makes you think that base +
> constant offset won't overflow in any case?
>
> And also: what are you gaining by allowing the wrap around? I don't need to
> know what ignore_address_wrap_around does, I need to know _why_ it is
> necessary.
>
We have
(zero_extend:DI (plus:SI (FOO:SI) (const_int Y)))
I want to convert it to
(plus:DI (zero_extend:DI (FOO:SI)) (const_int Y))
There is no zero-extend on (const_int Y). if FOO == 0xfffffffc and Y = 8,
(zero_extend:DI (plus:SI (FOO:SI) (const_int Y)))
gives 0x4 and
(plus:DI (zero_extend:DI (FOO:SI)) (const_int Y))
gives 0x100000004. If (plus:SI (FOO:SI) (const_int Y)) won't overflow
or its behavior is implementation-defined, the conversion is safe. If
it isn't the case, we should just drop it.
--
H.J.
next prev parent reply other threads:[~2011-07-27 23:00 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 14:30 H.J. Lu
2011-07-09 21:22 ` H.J. Lu
2011-07-09 21:23 ` Paolo Bonzini
2011-07-09 21:41 ` H.J. Lu
2011-07-10 17:04 ` Paolo Bonzini
2011-07-10 21:16 ` H.J. Lu
2011-07-11 0:48 ` H.J. Lu
2011-07-11 1:14 ` H.J. Lu
2011-07-11 6:49 ` H.J. Lu
2011-07-11 11:09 ` Paolo Bonzini
2011-07-11 15:58 ` H.J. Lu
2011-07-11 16:57 ` H.J. Lu
2011-07-11 17:26 ` H.J. Lu
2011-07-13 16:24 ` Paolo Bonzini
2011-07-13 16:52 ` H.J. Lu
2011-07-13 16:55 ` Paolo Bonzini
2011-07-13 16:58 ` Paolo Bonzini
2011-07-13 18:42 ` H.J. Lu
2011-07-25 10:34 ` Paolo Bonzini
2011-07-27 18:18 ` H.J. Lu
2011-07-27 22:41 ` Paolo Bonzini
2011-07-28 3:11 ` H.J. Lu [this message]
2011-07-28 7:59 ` Paolo Bonzini
2014-05-29 4:52 ` Andrew Pinski
2014-05-29 16:13 ` H.J. Lu
2014-05-29 16:23 ` pinskia
2014-05-29 17:09 ` H.J. Lu
2014-05-29 17:20 ` pinskia
2014-05-30 7:18 ` Paolo Bonzini
2011-07-28 10:24 Uros Bizjak
2011-07-28 10:27 ` Paolo Bonzini
2011-07-29 13:29 ` H.J. Lu
2011-07-28 18:23 ` Uros Bizjak
2011-07-29 9:32 ` Paolo Bonzini
2011-07-29 9:37 ` Paolo Bonzini
2011-07-30 0:47 ` H.J. Lu
2011-07-30 16:35 ` Paolo Bonzini
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=CAMe9rOpHJU8xQf19jNOK6V7hT3jN8kPQTQCLMNtDLR2PBJV_2g@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=bonzini@gnu.org \
--cc=gcc-patches@gcc.gnu.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).