public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Andrew Stubbs <ams@codesourcery.com>
Cc: Dmitry Plotnikov <dplotnikov@ispras.ru>,
	 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	 "patches@linaro.org" <patches@linaro.org>,
	"dm@ispras.ru" <dm@ispras.ru>
Subject: Re: [PATCH][ARM] Add support for ADDW and SUBW instructions
Date: Wed, 15 Jun 2011 13:12:00 -0000	[thread overview]
Message-ID: <4DF8AE46.3090208@arm.com> (raw)
In-Reply-To: <4DECE4C0.6030008@codesourcery.com>

On 06/06/11 15:31, Andrew Stubbs wrote:
> On 06/06/11 15:26, Dmitry Plotnikov wrote:
>> On 06/06/2011 05:33 PM, Andrew Stubbs wrote:
>>> On 06/06/11 14:26, Dmitry Plotnikov wrote:
>>>> if (const_ok_for_arm (INTVAL (x))
>>>> - || const_ok_for_arm (~INTVAL (x)))
>>>> + || const_ok_for_arm (~INTVAL (x))
>>>> + || (TARGET_THUMB2&& outer == PLUS
>>>> + && (const_ok_for_op (INTVAL (x), outer))))
>>>
>>> Sorry, I should have noticed before ...
>>>
>>> This whole condition should be covered by a single call to
>>> const_ok_for_op. It already calls const_ok_for_arm internally.
>>>
>> This condition is not covered by const_ok_for_op, because "outer" can be
>> equal to other rtx codes, which are not covered in const_ok_for_op like
>> IF_THEN_ELSE or MULT (I have several ICEs with these codes). I don't
>> know how to fix this correctly - should I add all codes to
>> const_ok_for_op or maybe just replace default alternative from
>> gcc_unreachable() to "return 0;" ?
> 
> That sounds reasonable to me - I mean, the constant is indeed not ok for 
> those operations.
> 
> ... but I'm not a maintainer ....
> 
> Andrew
> 
> 


const_ok_for_op has grown beyond it's original intended use.  A quick
look at it shows that a change along the way you describe would first
require fixing the assumption that if the constant matches
const_ok_for_arm in an unmodified form that it is OK universally.  That
might be a good idea anyway, I'm not entirely sure that that's correct
for all possible use cases these days.

It's also likely that it needs extending to handle some of these cases
you describe.  Having an outer of IF_THEN_ELSE most likely means this is
used in the case

(set reg if_then_else(cond) (op_or_const) (const))

for which the rules would be the same as if const were used directly in
a SET.

But it's also equally likely that we don't calculate the costs of
IF_THEN_ELSE very accurately anyway.

R.

R.


      reply	other threads:[~2011-06-15 13:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 15:36 Andrew Stubbs
2011-04-20 15:56 ` Andrew Stubbs
2011-05-18 15:47 ` Andrew Stubbs
2011-06-02  8:07 ` Andrew Stubbs
2011-06-02  8:24 ` Ramana Radhakrishnan
2011-06-02  9:03   ` Andrew Stubbs
2011-06-02 10:37     ` Ramana Radhakrishnan
2011-06-16  9:41       ` Stubbs, Andrew
2011-08-26 12:04         ` Andrew Stubbs
2011-06-06 12:15     ` Dmitry Plotnikov
2011-06-06 12:41       ` Andrew Stubbs
2011-06-06 13:26         ` Dmitry Plotnikov
2011-06-06 13:33           ` Andrew Stubbs
2011-06-06 14:26             ` Dmitry Plotnikov
2011-06-06 14:31               ` Andrew Stubbs
2011-06-15 13:12                 ` Richard Earnshaw [this message]

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=4DF8AE46.3090208@arm.com \
    --to=rearnsha@arm.com \
    --cc=ams@codesourcery.com \
    --cc=dm@ispras.ru \
    --cc=dplotnikov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patches@linaro.org \
    --cc=ramana.radhakrishnan@linaro.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).