public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christian Bruel <christian.bruel@st.com>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>,
	       Ramana Radhakrishnan	<Ramana.Radhakrishnan@arm.com>,
	       Sandra Loosemore <sandra@codesourcery.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       Richard Earnshaw	<Richard.Earnshaw@arm.com>,
	       "nickc@redhat.com" <nickc@redhat.com>
Subject: Re: [PATCH, ARM] attribute target (thumb,arm) [4/6] respin (5th)
Date: Mon, 01 Jun 2015 12:55:00 -0000	[thread overview]
Message-ID: <556C5639.4080203@st.com> (raw)
In-Reply-To: <556C530B.8000105@arm.com>



On 06/01/2015 02:41 PM, Kyrill Tkachov wrote:
>
> On 01/06/15 12:29, Christian Bruel wrote:
>> hi Kyrill
>>
>>
>> On 06/01/2015 12:39 PM, Kyrill Tkachov wrote:
>>> On 18/05/15 09:14, Christian Bruel wrote:
>>>> Hi,
>>> Hi Christian,
>>> A couple comments inline.
>>> Overall, the approach looks ok to me, though I think we'll have to
>>> generalise arm_valid_target_attribute_rec in the future if we want
>>> to allow other target attributes.
>>>
>> the other fpu target attributes will be part of another set of
>> developments, specific parsing strings will be added as they are
>> implemented.
>
> Ok, so you plan on working on fpu attributes as well?

I have a prototype for fpu=neon, it works locally but there are still a 
few corner cases and testing to sort out before sending a draft.

There are so many architectural variants to check that I might ask for 
help once it is a little bit more robust, and some might be similar with 
aarch64's simd.

>
>>
>>> +
>>> +/* Establish appropriate back-end context for processing the function
>>> +   FNDECL.  The argument might be NULL to indicate processing at top
>>> +   level, outside of any function scope.  */
>>> +static void
>>> +arm_set_current_function (tree fndecl)
>>> +{
>>> +  if (!fndecl || fndecl == arm_previous_fndecl)
>>> +    return;
>>> +
>>> +  tree old_tree = (arm_previous_fndecl
>>> +		   ? DECL_FUNCTION_SPECIFIC_TARGET (arm_previous_fndecl)
>>> +		   : NULL_TREE);
>>> +
>>> +  tree new_tree = DECL_FUNCTION_SPECIFIC_TARGET (fndecl);
>>> +
>>> +  arm_previous_fndecl = fndecl;
>>> +  if (old_tree == new_tree)
>>> +    ;
>>> +
>>> +  else if (new_tree)
>>> +    {
>>> +      cl_target_option_restore (&global_options,
>>> +				TREE_TARGET_OPTION (new_tree));
>>> +
>>> +      if (TREE_TARGET_GLOBALS (new_tree))
>>> +	restore_target_globals (TREE_TARGET_GLOBALS (new_tree));
>>> +      else
>>> +	TREE_TARGET_GLOBALS (new_tree)
>>> +	  = save_target_globals_default_opts ();
>>> +    }
>>> +
>>> +  else if (old_tree)
>>> +    {
>>> +      new_tree = target_option_current_node;
>>> +
>>> +      cl_target_option_restore (&global_options,
>>> +				TREE_TARGET_OPTION (new_tree));
>>> +      if (TREE_TARGET_GLOBALS (new_tree))
>>> +	restore_target_globals (TREE_TARGET_GLOBALS (new_tree));
>>> +      else if (new_tree == target_option_default_node)
>>> +	restore_target_globals (&default_target_globals);
>>> +      else
>>> +	TREE_TARGET_GLOBALS (new_tree)
>>> +	  = save_target_globals_default_opts ();
>>> +    }
>>> +
>>> +  arm_option_params_internal (&global_options);
>>>
>>>
>>> I thought the more common approach was to define TARGET_OPTION_RESTORE
>>> that was supposed to restore the backend state, including calling arm_option_params_internal?
>>> That way, cl_target_option_restore would do all that needs to be done to restore the backend.
>>>
>> TARGET_OPTION_RESTORE is fine to restore target-specific
>> information from struct cl_target_option. Other global states might as
>> well be expressed within set_current_function (e.g indeed I might use
>> TARGET_OPTION_RESTORE to switch arm_fpu_attr in the fpu neon attribute).
>> But IMHO arm_option_params_internal are fine to be called there since
>> the 2 params only depend from x_target_flags without the need of a new
>> macro.
>
> Ok, I see.
> The patch looks ok to me modulo the typo nits I pointed out, but I think Ramana
> should have the final say here as he's already started reviewing it and it adds quite
> a lot of functionality.

OK thanks, I'll wait for Ramana's final words.

Cheers

Christian

>
> Thanks,
> Kyrill
>
>>
>>
>

  reply	other threads:[~2015-06-01 12:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 14:25 [PATCH, ARM] attribute target (thumb,arm) [4/6] respin (4th) Christian Bruel
2015-05-06 23:04 ` Sandra Loosemore
2015-05-08  8:31   ` Ramana Radhakrishnan
2015-05-18  7:18     ` Christian Bruel
2015-05-18  8:16     ` [PATCH, ARM] attribute target (thumb,arm) [4/6] respin (5th) Christian Bruel
2015-06-01 10:39       ` Kyrill Tkachov
2015-06-01 11:30         ` Christian Bruel
2015-06-01 12:41           ` Kyrill Tkachov
2015-06-01 12:55             ` Christian Bruel [this message]
2015-06-08  9:26             ` Christian Bruel
2015-06-08  9:33               ` Ramana Radhakrishnan
2015-06-10  8:26                 ` [PATCH, ARM] (commited) attribute target (thumb,arm) [4/6] Christian Bruel
2015-06-15 10:15                   ` James Greenhalgh
2015-06-15 12:05                     ` Christian Bruel
2015-05-07  8:13 ` [PATCH, ARM] attribute target (thumb,arm) [4/6] respin (4th) Christian Bruel

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=556C5639.4080203@st.com \
    --to=christian.bruel@st.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=nickc@redhat.com \
    --cc=sandra@codesourcery.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).