public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	       "charles.baylis@linaro.org" <charles.baylis@linaro.org>
Subject: Re: [AArch64] fix big.LITTLE spec rewriting
Date: Thu, 23 Jan 2014 16:45:00 -0000	[thread overview]
Message-ID: <20140123164539.GB24337@arm.com> (raw)
In-Reply-To: <1390301284-24844-1-git-send-email-james.greenhalgh@arm.com>

*ping*

On Tue, Jan 21, 2014 at 10:48:04AM +0000, James Greenhalgh wrote:
> 
> Hi,
> 
> As Charles Baylis pointed out here:
> 
> http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00921.html
> 
> The way that we rewrite command lines for big.LITTLE systems
> causes bugs where more than one source file is to be used.
> The problem fundamentally is that -mcpu never makes it to
> the second cc1 invocation.
> 
> This patch changes the spec command we use and updates
> aarch64-common.c to handle that fact. I confess that the specs
> stuff all looks like magic to me, but this approach seems to
> make sense. In English, I think I am saying:
> 
> "If you find an mcpu= followed by some name, rewrite that to be
>  -mcpu followed by the results of passing all other -mcpu values
>  we find through aarch64_rewrite_mcpu"
> 
> I've regression tested this patch on aarch64-none-elf with no
> issues and checked combinations of zero or more -mcpu values with
> one or more source files, and things seem to work as expected.
> 
> OK?
> 
> Thanks,
> James
> 
> ---
> 2014-01-21  James Greenhalgh  <james.greenhalgh@arm.com>
> 
> 	* common/config/aarch64/aarch64-common.c
> 	(aarch64_rewrite_mcpu): Handle multiple names.
> 	* config/aarch64/aarch64.h
> 	(BIG_LITTLE_SPEC): Do not discard mcpu switches.
> 

> diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
> index 6107007..e44b40a 100644
> --- a/gcc/common/config/aarch64/aarch64-common.c
> +++ b/gcc/common/config/aarch64/aarch64-common.c
> @@ -110,13 +110,15 @@ aarch64_rewrite_selected_cpu (const char *name)
>  
>  /* Called by the driver to rewrite a name passed to the -mcpu
>     argument in preparation to be passed to the assembler.  The
> -   name will be in ARGV[0], ARGC should always be 1.  */
> +   names passed from the commend line will be in ARGV, we want
> +   to use the right-most argument, which should be in
> +   ARGV[ARGC - 1].  ARGC should always be greater than 0.  */
>  
>  const char *
>  aarch64_rewrite_mcpu (int argc, const char **argv)
>  {
> -  gcc_assert (argc == 1);
> -  return aarch64_rewrite_selected_cpu (argv[0]);
> +  gcc_assert (argc);
> +  return aarch64_rewrite_selected_cpu (argv[argc - 1]);
>  }
>  
>  #undef AARCH64_CPU_NAME_LENGTH
> diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
> index a08dee0..13c424c 100644
> --- a/gcc/config/aarch64/aarch64.h
> +++ b/gcc/config/aarch64/aarch64.h
> @@ -857,7 +857,7 @@ extern enum aarch64_code_model aarch64_cmodel;
>    (BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (mode) - 1 - n : n)
>  
>  #define BIG_LITTLE_SPEC \
> -   " %{mcpu=*:%<mcpu=* -mcpu=%:rewrite_mcpu(%{mcpu=*:%*})}"
> +   " %{mcpu=*:-mcpu=%:rewrite_mcpu(%{mcpu=*:%*})}"
>  
>  extern const char *aarch64_rewrite_mcpu (int argc, const char **argv);
>  #define BIG_LITTLE_CPU_SPEC_FUNCTIONS \

  reply	other threads:[~2014-01-23 16:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 10:40 [Patch ARM] Add big.LITTLE tuning options James Greenhalgh
2013-12-17 10:41 ` [ARM 1/5 big.LITTLE] Add driver support for rewriting -mcpu names James Greenhalgh
2013-12-17 11:53   ` Richard Earnshaw
2014-01-15 20:36     ` Charles Baylis
2014-01-16 14:26       ` James Greenhalgh
2014-01-16 14:57         ` Charles Baylis
2014-01-21 10:48       ` [AArch64] fix big.LITTLE spec rewriting James Greenhalgh
2014-01-23 16:45         ` James Greenhalgh [this message]
2014-01-24 16:59         ` Marcus Shawcroft
2014-01-21 10:52       ` [ARM] " James Greenhalgh
2014-01-23 16:45         ` James Greenhalgh
2014-01-27 14:59         ` Ramana Radhakrishnan
2013-12-17 10:41 ` [ARM 2/5 big.LITTLE] Allow tuning parameters without unique tuning targets James Greenhalgh
2013-12-17 11:59   ` Richard Earnshaw
2013-12-17 10:41 ` [ARM 4/5 big.LITTLE] Add support for -mcpu=cortex-a57 James Greenhalgh
2013-12-17 12:07   ` Richard Earnshaw
2013-12-17 10:41 ` [ARM 5/5 big.LITTLE] Add support for -mcpu=cortex-a57.cortex-a53 James Greenhalgh
2013-12-17 12:08   ` Richard Earnshaw
2013-12-17 10:41 ` [ARM 3/5 big.LITTLE] Add support for -mcpu=cortex-a15.cortex-a7 James Greenhalgh
2013-12-17 12:01   ` Richard Earnshaw

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=20140123164539.GB24337@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=charles.baylis@linaro.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).