This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING PATCH] Extend mode-switching to support toggle
- From: Christian Bruel <christian dot bruel at st dot com>
- To: Joern Rennecke <joern dot rennecke at embecosm dot com>
- Cc: Steven Bosscher <stevenb dot gcc at gmail dot com>, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, Uros Bizjak <ubizjak at gmail dot com>, "jh at suse dot cz" <jh at suse dot cz>, "ebotcazou at libertysurf dot fr" <ebotcazou at libertysurf dot fr>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 15 Apr 2014 13:52:16 +0200
- Subject: Re: [PING PATCH] Extend mode-switching to support toggle
- Authentication-results: sourceware.org; auth=none
- References: <534CF9D7 dot 70605 at st dot com> <CAMqJFCqACoQEtjz_HM=SW1EH0-nrqYSrxLG4_ANja5XcS90_0g at mail dot gmail dot com>
On 04/15/2014 01:13 PM, Joern Rennecke wrote:
> On 15 April 2014 10:20, Christian Bruel <christian.bruel@st.com> wrote:
>> Hello,
>>
>> I guess it's for RTL maintainers. Also interested by mode-switching.c
>> last contributors (from past ChangeLog entries) comments,
>>
>> http://gcc.gnu.org/ml/gcc-patches/2014-04/msg00196.html
> This only helps if there are exactly two modes for an entity.
> An interface which extends EMIT_MODE_SET with a parameter for the known
> mode would be more versatile. I.e. if you need to manipulate a control register
> with an AND and OR to set a specific mode with no knowledge of the previous
> mode, having the known previous mode allows to use a single add or xor
> to make the desired switch. An unknown mode could be represented by no_mode
> or -1.
yes, I didn't have a 3 state (or more) toggling in mind. My
implementation only works for 2 states entities (flip on/off a bit).
More than that would require not using a XOR and should expose the
test/set_toggle_status machinery to a machine description part. This is
a limitation of my proposal, If this will be a missing extension for a
target, we will need to move the test/set toggle machinery out of the
machine independent part. Maybe overkill as of today.
I agree that extending the current EMIT_MODE_SET might be more flexible
than a new EMIT_TOGGLE. I was balancing between the two interfaces...
thanks for this point.
> While you are at it, you should also hookize the thing.
OK,
>
> FWIW, I have noted down some weaknesses/improvement opportunities of
> the mode switching pass in: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29349 .
> This also touches the fpchg issue
Thanks, I have also some example where this can be improved, hoping to
resurrect this problem one day.