* Re: [gentoo-user] -march=native
2010-06-30 0:54 [gentoo-user] -march=native Hasan SAHIN
@ 2010-06-29 22:00 ` Bill Longman
2010-06-29 22:01 ` Alex Schuster
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Bill Longman @ 2010-06-29 22:00 UTC (permalink / raw
To: gentoo-user
On 06/29/2010 05:54 PM, Hasan SAHIN wrote:
> Hello all,
>
> I am using Athlon64 X2 processor with the
> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>
> Can I use the -march=native option instead of that?
>
> P.S. : I am using x86 stable box.
Depends more on the version of gcc you're using. And you can also add
-msse on the X2. Supposedly there's a -march=k8-sse but in my experience
it was not good. Others may have different experience.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 0:54 [gentoo-user] -march=native Hasan SAHIN
2010-06-29 22:00 ` Bill Longman
@ 2010-06-29 22:01 ` Alex Schuster
2010-06-29 22:03 ` Bill Longman
2010-06-29 22:07 ` Paul Hartman
3 siblings, 0 replies; 13+ messages in thread
From: Alex Schuster @ 2010-06-29 22:01 UTC (permalink / raw
To: gentoo-user
Hasan SAHIN writes:
> I am using Athlon64 X2 processor with the
> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>
> Can I use the -march=native option instead of that?
Sure, as long as you are not using distcc, in which case the distcc
servers would compile according to _their_ native option.
Wonko
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 0:54 [gentoo-user] -march=native Hasan SAHIN
2010-06-29 22:00 ` Bill Longman
2010-06-29 22:01 ` Alex Schuster
@ 2010-06-29 22:03 ` Bill Longman
2010-06-30 1:08 ` Hasan SAHIN
2010-06-29 22:07 ` Paul Hartman
3 siblings, 1 reply; 13+ messages in thread
From: Bill Longman @ 2010-06-29 22:03 UTC (permalink / raw
To: gentoo-user
On 06/29/2010 05:54 PM, Hasan SAHIN wrote:
> Hello all,
>
> I am using Athlon64 X2 processor with the
> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>
> Can I use the -march=native option instead of that?
Sorry, Hasan, I dropped my "3"s.
-msse3 and -march=k8-sse3
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 0:54 [gentoo-user] -march=native Hasan SAHIN
` (2 preceding siblings ...)
2010-06-29 22:03 ` Bill Longman
@ 2010-06-29 22:07 ` Paul Hartman
2010-06-30 1:09 ` Beau Henderson
3 siblings, 1 reply; 13+ messages in thread
From: Paul Hartman @ 2010-06-29 22:07 UTC (permalink / raw
To: gentoo-user
2010/6/29 Hasan SAHIN <hasan.sahin@gmx.com>:
> Hello all,
>
> I am using Athlon64 X2 processor with the
> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>
> Can I use the -march=native option instead of that?
You can see which options -march=native would use by running this command:
gcc -Q --help=target -march=native
(thanks to Daniel Iliev for the tip)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 1:08 ` Hasan SAHIN
@ 2010-06-29 23:12 ` Bill Longman
0 siblings, 0 replies; 13+ messages in thread
From: Bill Longman @ 2010-06-29 23:12 UTC (permalink / raw
To: gentoo-user
On 06/29/2010 06:08 PM, Hasan SAHIN wrote:
> I have read the safe flags document and it says that :
>
> /GCC 4.2 introduces a new -march option, -march=*native*, which
> automatically detects the features your CPU supports and sets the
> options appropriately. If you have an Intel or AMD CPU and are using
>>=sys-devel/gcc-4.2.3, using -march=native is recommended. Do *not* use
> -march=native if you use distcc on nodes with different architectures as
> this may produce unusable code. /
>
> which I understood, I can use the -march=native option instead of
>
> CFLAGS="-march=k8-msse3 -O2 -pipe -fomit-frame-pointer"
>
> is it true?
Yes, -march=native is a good, simple way to optimize your compiles.
Here's what you should use on your Athlon64 X2, then:
CFLAGS="-march=native -O2 -pipe"
^ permalink raw reply [flat|nested] 13+ messages in thread
* [gentoo-user] -march=native
@ 2010-06-30 0:54 Hasan SAHIN
2010-06-29 22:00 ` Bill Longman
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Hasan SAHIN @ 2010-06-30 0:54 UTC (permalink / raw
To: gentoo-user
Hello all,
I am using Athlon64 X2 processor with the
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
Can I use the -march=native option instead of that?
P.S. : I am using x86 stable box.
Regards,
Hasan.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-29 22:03 ` Bill Longman
@ 2010-06-30 1:08 ` Hasan SAHIN
2010-06-29 23:12 ` Bill Longman
0 siblings, 1 reply; 13+ messages in thread
From: Hasan SAHIN @ 2010-06-30 1:08 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 990 bytes --]
29-06-2010 22:03, Bill Longman yazmış:
> On 06/29/2010 05:54 PM, Hasan SAHIN wrote:
>
>> Hello all,
>>
>> I am using Athlon64 X2 processor with the
>> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>>
>> Can I use the -march=native option instead of that?
>>
> Sorry, Hasan, I dropped my "3"s.
>
> -msse3 and -march=k8-sse3
>
Hi Bill,
I have read the safe flags document and it says that :
/GCC 4.2 introduces a new -march option, -march=*native*, which
automatically detects the features your CPU supports and sets the
options appropriately. If you have an Intel or AMD CPU and are using
>=sys-devel/gcc-4.2.3, using -march=native is recommended. Do *not* use
-march=native if you use distcc on nodes with different architectures as
this may produce unusable code. /
which I understood, I can use the -march=native option instead of
CFLAGS="-march=k8-msse3 -O2 -pipe -fomit-frame-pointer"
is it true?
Regards,
Hasan.
[-- Attachment #2: Type: text/html, Size: 1455 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-29 22:07 ` Paul Hartman
@ 2010-06-30 1:09 ` Beau Henderson
2010-06-30 1:54 ` Albert Hopkins
2010-06-30 14:30 ` Paul Hartman
0 siblings, 2 replies; 13+ messages in thread
From: Beau Henderson @ 2010-06-30 1:09 UTC (permalink / raw
To: gentoo-user
On 06/30/10 08:07, Paul Hartman wrote:
> 2010/6/29 Hasan SAHIN<hasan.sahin@gmx.com>:
>> Hello all,
>>
>> I am using Athlon64 X2 processor with the
>> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>>
>> Can I use the -march=native option instead of that?
>
> You can see which options -march=native would use by running this command:
>
> gcc -Q --help=target -march=native
>
> (thanks to Daniel Iliev for the tip)
>
Perhaps I'm missing something but running the above gives me the impression that -march=native
actually only configures the bare minimal install. I'm not seeing -mmmx or -msse3 enabled on my
k8-sse3 for instance ( amongst much else ).
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 1:09 ` Beau Henderson
@ 2010-06-30 1:54 ` Albert Hopkins
2010-06-30 14:26 ` Paul Hartman
2010-06-30 14:30 ` Paul Hartman
1 sibling, 1 reply; 13+ messages in thread
From: Albert Hopkins @ 2010-06-30 1:54 UTC (permalink / raw
To: gentoo-user
On Wed, 2010-06-30 at 11:09 +1000, Beau Henderson wrote:
> On 06/30/10 08:07, Paul Hartman wrote:
[...]
> > You can see which options -march=native would use by running this command:
> >
> > gcc -Q --help=target -march=native
> >
> > (thanks to Daniel Iliev for the tip)
> >
>
> Perhaps I'm missing something but running the above gives me the impression that -march=native
> actually only configures the bare minimal install. I'm not seeing -mmmx or -msse3 enabled on my
> k8-sse3 for instance ( amongst much else ).
>
-march sometimes implies a some things. E.g., anything above a pentium2
implies MMX. My hunch is that k8-sse3 implies... sse3.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 1:54 ` Albert Hopkins
@ 2010-06-30 14:26 ` Paul Hartman
0 siblings, 0 replies; 13+ messages in thread
From: Paul Hartman @ 2010-06-30 14:26 UTC (permalink / raw
To: gentoo-user
On Tue, Jun 29, 2010 at 8:54 PM, Albert Hopkins <marduk@letterboxes.org> wrote:
> On Wed, 2010-06-30 at 11:09 +1000, Beau Henderson wrote:
>> On 06/30/10 08:07, Paul Hartman wrote:
> [...]
>> > You can see which options -march=native would use by running this command:
>> >
>> > gcc -Q --help=target -march=native
>> >
>> > (thanks to Daniel Iliev for the tip)
>> >
>>
>> Perhaps I'm missing something but running the above gives me the impression that -march=native
>> actually only configures the bare minimal install. I'm not seeing -mmmx or -msse3 enabled on my
>> k8-sse3 for instance ( amongst much else ).
>>
>
> -march sometimes implies a some things. E.g., anything above a pentium2
> implies MMX. My hunch is that k8-sse3 implies... sse3.
See this page of the GCC documentation for some info about what is
enabled in the different arches:
http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/i386-and-x86_002d64-Options.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 1:09 ` Beau Henderson
2010-06-30 1:54 ` Albert Hopkins
@ 2010-06-30 14:30 ` Paul Hartman
2010-06-30 22:21 ` Beau Henderson
1 sibling, 1 reply; 13+ messages in thread
From: Paul Hartman @ 2010-06-30 14:30 UTC (permalink / raw
To: gentoo-user
On Tue, Jun 29, 2010 at 8:09 PM, Beau Henderson <beau@thehenderson.com> wrote:
> On 06/30/10 08:07, Paul Hartman wrote:
>>
>> 2010/6/29 Hasan SAHIN<hasan.sahin@gmx.com>:
>>>
>>> Hello all,
>>>
>>> I am using Athlon64 X2 processor with the
>>> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>>>
>>> Can I use the -march=native option instead of that?
>>
>> You can see which options -march=native would use by running this command:
>>
>> gcc -Q --help=target -march=native
>>
>> (thanks to Daniel Iliev for the tip)
>>
>
> Perhaps I'm missing something but running the above gives me the impression
> that -march=native actually only configures the bare minimal install. I'm
> not seeing -mmmx or -msse3 enabled on my k8-sse3 for instance ( amongst much
> else ).
What -march setting is it showing in that output? The MMX (etc) may be
enabled implicitly instead of explicitly.
It's also possible that the CPU detection is failing to identify your
CPU. In that case you could probably file a bug report about it.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 14:30 ` Paul Hartman
@ 2010-06-30 22:21 ` Beau Henderson
2010-07-04 17:52 ` James Cloos
0 siblings, 1 reply; 13+ messages in thread
From: Beau Henderson @ 2010-06-30 22:21 UTC (permalink / raw
To: gentoo-user
On 07/01/10 00:30, Paul Hartman wrote:
> On Tue, Jun 29, 2010 at 8:09 PM, Beau Henderson<beau@thehenderson.com> wrote:
>> On 06/30/10 08:07, Paul Hartman wrote:
>>>
>>> 2010/6/29 Hasan SAHIN<hasan.sahin@gmx.com>:
>>>>
>>>> Hello all,
>>>>
>>>> I am using Athlon64 X2 processor with the
>>>> CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" option.
>>>>
>>>> Can I use the -march=native option instead of that?
>>>
>>> You can see which options -march=native would use by running this command:
>>>
>>> gcc -Q --help=target -march=native
>>>
>>> (thanks to Daniel Iliev for the tip)
>>>
>>
>> Perhaps I'm missing something but running the above gives me the impression
>> that -march=native actually only configures the bare minimal install. I'm
>> not seeing -mmmx or -msse3 enabled on my k8-sse3 for instance ( amongst much
>> else ).
>
> What -march setting is it showing in that output? The MMX (etc) may be
> enabled implicitly instead of explicitly.
>
> It's also possible that the CPU detection is failing to identify your
> CPU. In that case you could probably file a bug report about it.
>
The correct -march is being displayed, I just can't make sense of the options showing as [disabled].
While the option may be implied by the -march settings, it just makes sense to me that the option
should show as enabled. Indeed, with my core2 machine the majority of the options do display as
enable as expected, just not with my k8-see3 @native.
I wonder if perhaps it might be possible to compile an application that uses all these functions and
then assess ( somehow ) the binaries afterwards to see if they were compiled in and working correctly ?
Here's what I'm seeing on my k8-sse3: http://pastebin.com/PfMiTnx5
And my core2: http://pastebin.com/7WerGwkX
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] -march=native
2010-06-30 22:21 ` Beau Henderson
@ 2010-07-04 17:52 ` James Cloos
0 siblings, 0 replies; 13+ messages in thread
From: James Cloos @ 2010-07-04 17:52 UTC (permalink / raw
To: gentoo-user
>>>>> "BH" == Beau Henderson <beau@thehenderson.com> writes:
BH> The correct -march is being displayed, I just can't make sense of the
BH> options showing as [disabled]. While the option may be implied by the
BH> -march settings, it just makes sense to me that the option should show
BH> as enabled. Indeed, with my core2 machine the majority of the options
BH> do display as enable as expected, just not with my k8-see3 @native.
FWIW, a tests on -march=amdfam10 on both gentoo and debian also show odd
enabled/disabled results, as do debian k8-sse3 and core2 boxen. The
fedora core2 box I have access to, however, shows reasonable enableds.
Odd.
-JimC
--
James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2010-07-04 17:53 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-30 0:54 [gentoo-user] -march=native Hasan SAHIN
2010-06-29 22:00 ` Bill Longman
2010-06-29 22:01 ` Alex Schuster
2010-06-29 22:03 ` Bill Longman
2010-06-30 1:08 ` Hasan SAHIN
2010-06-29 23:12 ` Bill Longman
2010-06-29 22:07 ` Paul Hartman
2010-06-30 1:09 ` Beau Henderson
2010-06-30 1:54 ` Albert Hopkins
2010-06-30 14:26 ` Paul Hartman
2010-06-30 14:30 ` Paul Hartman
2010-06-30 22:21 ` Beau Henderson
2010-07-04 17:52 ` James Cloos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox