march = native = ??

View: New views
4 Messages — Rating Filter:   Alert me  

march = native = ??

by muellste :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo

nach vorhergehender Diskussion die Frage: Wie kann man feststellen welche
Flags gcc für 'march=native' auswählt?
Bzw. wird überhaupt eine Auswahl aus den vorhandenen getroffen oder
schaltet 'native' eigene Optimierungen frei?

   mfg stephan



Re: march = native = ??

by Jan Riedel-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

muellste@... wrote:

> Hallo
>
> nach vorhergehender Diskussion die Frage: Wie kann man feststellen welche
> Flags gcc für 'march=native' auswählt?
> Bzw. wird überhaupt eine Auswahl aus den vorhandenen getroffen oder
> schaltet 'native' eigene Optimierungen frei?
>
>    mfg stephan
>
>

man gcc sagt folgendes:

native
This selects the CPU to tune for at compilation time by determining the
processor type of the compiling machine.  Using -mtune=native will
produce code optimized for the local machine under the constraints of
the selected instruction set.  Using -march=native will enable all
instruction subsets supported by the local machine (hence the result
might not run on different machines).

Gruss,
Jan


Re: march = native = ??

by Jan Riedel-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jan Riedel wrote:

> muellste@... wrote:
>> Hallo
>>
>> nach vorhergehender Diskussion die Frage: Wie kann man feststellen welche
>> Flags gcc für 'march=native' auswählt?
>> Bzw. wird überhaupt eine Auswahl aus den vorhandenen getroffen oder
>> schaltet 'native' eigene Optimierungen frei?
>>
>>    mfg stephan
>>
>>
>
> man gcc sagt folgendes:
>
> native
> This selects the CPU to tune for at compilation time by determining the
> processor type of the compiling machine.  Using -mtune=native will
> produce code optimized for the local machine under the constraints of
> the selected instruction set.  Using -march=native will enable all
> instruction subsets supported by the local machine (hence the result
> might not run on different machines).
>
> Gruss,
> Jan
>

und da steht auch noch:

Native Linux/GNU toolchains also support the value native, which selects
the best architecture option for the host processor.  -march=native has
no effect if GCC does not recognize the processor.

Keine Ahnung, ob gcc irgendeine Meldung bringt, wenn die CPU nicht
erkannt wird. Am besten mal ausprobieren.

Gruss,
Jan


Re: march = native = ??

by desastre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

muellste@... wrote:

> Hallo
>
> nach vorhergehender Diskussion die Frage: Wie kann man feststellen welche
> Flags gcc für 'march=native' auswählt?
> Bzw. wird überhaupt eine Auswahl aus den vorhandenen getroffen oder
> schaltet 'native' eigene Optimierungen frei?
>
>    mfg stephan
>
>
gcc -c -Q -march=native --help=optimizer

Du kannst das gleiche auch für die unterschiedlichen O level machen.



signature.asc (205 bytes) Download Attachment