Patchwork Add -mtune=ia support

login
register
mail settings
Submitter H.J. Lu
Date Dec. 24, 2013, 8:13 p.m.
Message ID <CAMe9rOp4vncbDi5hZ=ho+-zzn32qyYEUnf1=+351YA0zf25Wtw@mail.gmail.com>
Download mbox | patch
Permalink /patch/305055/
State New
Headers show

Comments

H.J. Lu - Dec. 24, 2013, 8:13 p.m.
On Fri, Dec 6, 2013 at 9:38 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Dec 6, 2013 at 2:44 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Fri, Dec 6, 2013 at 10:38 AM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Thu, Dec 5, 2013 at 10:05 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Thu, Dec 5, 2013 at 1:02 PM, Patrick Marlier
>>>> <patrick.marlier@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>>
>>>>> On 12/05/2013 07:22 PM, H.J. Lu wrote:
>>>>>>
>>>>>> We'd like to add a new -mtune=ia option for x86 to optimize for both
>>>>>> Haswell and Silvermont.  Currently, -mtune=ia is aliased to -mtune=slm.
>>>>>> We will improve it further for Haswell and Silvermont.  Later, we will
>>>>>> update it to future Intel processors.
>>>>>
>>>>>
>>>>> At first, 'ia' means to me Itanium, ie IA-64. I would personally prefer
>>>>> another name but maybe I am the only one to think that.
>>>>>
>>>>
>>>> "ia" stands for Intel Architecture.  It is the natural name for
>>>> this option.
>>>
>>> I think "ia" and the natural "aa" are too obfuscated.  Why didn't you
>>> chose simply "intel" here?  (will the next patch add -mtune=a as
>>> that's natural for "AMD"?)
>>
>> -mtune=intel indeed sounds better.
>>
>
> This is the patch I checked in.
>
> Thanks.
>
> --
> H.J.
> --
> 2013-12-06  H.J. Lu  <hongjiu.lu@intel.com>
>
>     * config.gcc: Change --with-cpu=ia to --with-cpu=intel.
>
>     * config/i386/i386.c (cpu_names): Replace "ia" with "intel".
>     (processor_alias_table): Likewise.
>     (ix86_option_override_internal): Likewise.
>     * config/i386/i386.h (target_cpu_default): Replace
>     TARGET_CPU_DEFAULT_ia with TARGET_CPU_DEFAULT_intel.
>
>     * doc/invoke.texi: Replace -mtune=ia with -mtune=intel.

> @@ -3632,8 +3632,8 @@ ix86_option_override_internal (bool main_args_p,
>    if (!strcmp (opts->x_ix86_arch_string, "generic"))
>      error ("generic CPU can be used only for %stune=%s %s",
>         prefix, suffix, sw);
> -  else if (!strcmp (ix86_arch_string, "ia"))
> -    error ("ia CPU can be used only for %stune=%s %s",
> +  else if (!strcmp (ix86_arch_string, "intel"))
> +    error ("intel CPU can be used only for %stune=%s %s",
>         prefix, suffix, sw);
>    else if (!strncmp (opts->x_ix86_arch_string, "generic", 7) || i == pta_size)
>      error ("bad value (%s) for %sarch=%s %s",

There is a typo.  I should check opts->x_ix86_arch_string, not
ix86_arch_string.  I am checking in this patch as obvious fix.

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3e9214a..8c756a6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2013-12-24   H.J. Lu  <hongjiu.lu@intel.com>
+
+    * config/i386/i386.c (ix86_option_override_internal): Check
+    opts->x_ix86_arch_string instead of ix86_arch_string.
+
 2013-12-24  Renlin Li  <Renlin.Li@arm.com>

     * config/arm/arm-protos.h (vfp_const_double_for_bits): Declare.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index ced6618..f5d9ce5 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3645,7 +3645,7 @@  ix86_option_override_internal (bool main_args_p,
   if (!strcmp (opts->x_ix86_arch_string, "generic"))
     error ("generic CPU can be used only for %stune=%s %s",
        prefix, suffix, sw);
-  else if (!strcmp (ix86_arch_string, "intel"))
+  else if (!strcmp (opts->x_ix86_arch_string, "intel"))
     error ("intel CPU can be used only for %stune=%s %s",
        prefix, suffix, sw);
   else if (!strncmp (opts->x_ix86_arch_string, "generic", 7) || i == pta_size)