diff mbox

[i386] Add -march=native support for VIA nano CPUs

Message ID 1464559768.9217.68.camel@magic.fr
State New
Headers show

Commit Message

J. Mayer May 29, 2016, 10:09 p.m. UTC
Hello,

On Sun, 2016-05-29 at 21:12 +0200, Uros Bizjak wrote:
> Hello!
> 
> > 
> > When trying to compile using -march=native on a VIA nano CPU, gcc
> > selects "-march=core2" "-mtune=i386" then is unable to compile, as
> > this
> > creates a conflicts between 32 bits and 64 bits compilation modes,
> > as
> > show by the following test:
> [...]
> 
> > 
> > --- gcc/config/i386/driver-i386.c.origÂÂ2015-02-02
> > 05:20:49.000000000
> > +0100
> > +++ gcc/config/i386/driver-i386.cÂÂÂÂÂÂÂ2015-08-23
> > 01:11:03.000000000
> > +0200
> > @@ -601,15 +601,20 @@
> > ÂÂÂÂÂÂÂÂÂÂswitch (family)
> > ÂÂÂÂÂÂÂÂÂÂÂÂ{
> > ÂÂÂÂÂÂÂÂÂÂÂÂcase 6:
> > -ÂÂÂÂÂÂÂÂÂÂÂÂÂif (model > 9)
> The patch was corrupted by your mailer. But - can you please open a
> bugreport, and refer reposted patch to this bugreport? This way, the
> problem (and the patch) won't get forgotten.
> 
> Uros.
> 

Sorry for that, might be because of UTF-8 encoding.
I already opened a bug many monthes ago, ID 67310:
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310>
I just updated the patch against current git repository, the only
difference between previous versions are diff offsets.

Jocelyn

---

              if (has_3dnow)
@@ -664,6 +669,8 @@ const char *host_detect_local_cpu (int argc, const
char **argv)
              /* We have no idea.  */
              processor = PROCESSOR_GENERIC;
            }
+       } else {
+         processor = PROCESSOR_GENERIC;
        }
     }
   else
@@ -894,7 +901,12 @@ const char *host_detect_local_cpu (int argc, const
char **argv)
       if (arch)
        {
          if (has_ssse3)
-           cpu = "core2";
+           {
+             if (vendor == signature_CENTAUR_ebx)
+               cpu = "x86-64";
+             else
+               cpu = "core2";
+           }
          else if (has_sse3)
            {
              if (has_longmode)

Comments

Uros Bizjak May 31, 2016, 11:38 a.m. UTC | #1
On Mon, May 30, 2016 at 12:09 AM, J. Mayer <l_indien@magic.fr> wrote:
> Hello,
>
> On Sun, 2016-05-29 at 21:12 +0200, Uros Bizjak wrote:
>> Hello!
>>
>> >
>> > When trying to compile using -march=native on a VIA nano CPU, gcc
>> > selects "-march=core2" "-mtune=i386" then is unable to compile, as
>> > this
>> > creates a conflicts between 32 bits and 64 bits compilation modes,
>> > as
>> > show by the following test:
>> [...]
>>
>> >
>> > --- gcc/config/i386/driver-i386.c.origÂÂ2015-02-02
>> > 05:20:49.000000000
>> > +0100
>> > +++ gcc/config/i386/driver-i386.cÂÂÂÂÂÂÂ2015-08-23
>> > 01:11:03.000000000
>> > +0200
>> > @@ -601,15 +601,20 @@
>> > ÂÂÂÂÂÂÂÂÂÂswitch (family)
>> > ÂÂÂÂÂÂÂÂÂÂÂÂ{
>> > ÂÂÂÂÂÂÂÂÂÂÂÂcase 6:
>> > -ÂÂÂÂÂÂÂÂÂÂÂÂÂif (model > 9)
>> The patch was corrupted by your mailer. But - can you please open a
>> bugreport, and refer reposted patch to this bugreport? This way, the
>> problem (and the patch) won't get forgotten.
>>
>> Uros.
>>
>
> Sorry for that, might be because of UTF-8 encoding.
> I already opened a bug many monthes ago, ID 67310:
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310>
> I just updated the patch against current git repository, the only
> difference between previous versions are diff offsets.

Can you please test the patch that is attached to the bugreport?

Thanks,
Uros.
J. Mayer May 31, 2016, 11:46 a.m. UTC | #2
On Tue, 2016-05-31 at 13:38 +0200, Uros Bizjak wrote:
> On Mon, May 30, 2016 at 12:09 AM, J. Mayer <l_indien@magic.fr> wrote:
> > 
> > Hello,
> > 
> > On Sun, 2016-05-29 at 21:12 +0200, Uros Bizjak wrote:
> > > 
> > > Hello!
> > > 
> > > > 
> > > > 
> > > > When trying to compile using -march=native on a VIA nano CPU,
> > > > gcc
> > > > selects "-march=core2" "-mtune=i386" then is unable to compile,
> > > > as
> > > > this
> > > > creates a conflicts between 32 bits and 64 bits compilation
> > > > modes,
> > > > as
> > > > show by the following test:
> > > [...]
> > > 
> > > > 
> > > > 
> > > > --- gcc/config/i386/driver-i386.c.origÂÂ2015-02-02
> > > > 05:20:49.000000000
> > > > +0100
> > > > +++ gcc/config/i386/driver-i386.cÂÂÂÂÂÂÂ2015-08-23
> > > > 01:11:03.000000000
> > > > +0200
> > > > @@ -601,15 +601,20 @@
> > > > ÂÂÂÂÂÂÂÂÂÂswitch (family)
> > > > ÂÂÂÂÂÂÂÂÂÂÂÂ{
> > > > ÂÂÂÂÂÂÂÂÂÂÂÂcase 6:
> > > > -ÂÂÂÂÂÂÂÂÂÂÂÂÂif (model > 9)
> > > The patch was corrupted by your mailer. But - can you please open
> > > a
> > > bugreport, and refer reposted patch to this bugreport? This way,
> > > the
> > > problem (and the patch) won't get forgotten.
> > > 
> > > Uros.
> > > 
> > Sorry for that, might be because of UTF-8 encoding.
> > I already opened a bug many monthes ago, ID 67310:
> > <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67310>
> > I just updated the patch against current git repository, the only
> > difference between previous versions are diff offsets.
> Can you please test the patch that is attached to the bugreport?
> 
> Thanks,
> Uros.

Yes, I've seen your patch and downloaded it, I'm now recompiling gcc
from patched git repository; I'll be busy in the hours to come, but
I'll make the test as soon as I can.

Jocelyn
diff mbox

Patch

diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-
i386.c
index b121466..662709e 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -642,15 +642,20 @@  const char *host_detect_local_cpu (int argc,
const char **argv)
          switch (family)
            {
            case 6:
-             if (model > 9)
-               /* Use the default detection procedure.  */
+             if (has_longmode)
                processor = PROCESSOR_GENERIC;
-             else if (model == 9)
-               cpu = "c3-2";
-             else if (model >= 6)
-               cpu = "c3";
              else
-               processor = PROCESSOR_GENERIC;
+               {
+                 if (model > 9)
+                   /* Use the default detection procedure.  */
+                   processor = PROCESSOR_GENERIC;
+                 else if (model == 9)
+                   cpu = "c3-2";
+                 else if (model >= 6)
+                   cpu = "c3";
+                 else
+                   processor = PROCESSOR_GENERIC;
+               }
              break;
            case 5: