-march tag in GCC

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

-march tag in GCC

Earnie Boyd
I have a question concerning specifying -march tag in GCC.  Should GCC
pass the flag to the assembler process?  I know that it doesn't
currently, the question I have is, should it?

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -march tag in GCC

Fabian Greffrath
Am 30.11.2011 15:16, schrieb Earnie:
> I have a question concerning specifying -march tag in GCC.  Should GCC
> pass the flag to the assembler process?  I know that it doesn't
> currently, the question I have is, should it?

Hm, isn't it the purpose of the -march flag to tell the compiler into
what kind of assembler it should translate the instructions given in
the higher level source code?

  - Fabian

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -march tag in GCC

Tor Lillqvist
> Hm, isn't it the purpose of the -march flag to tell the compiler into
> what kind of assembler it should translate the instructions given in
> the higher level source code?

Yes and no. The fact that gcc produces assembler source code output
that needs to be compiled by a separate assembler pass is not that
relevant here. Even if gcc produced object code directly, of course an
-march switch would be needed, in the cases where gcc is configured to
target a family of several slightly different instruction sets.

Are you perhaps confusing with some switch selecting what assembler
*syntax* to produce, for architectures where there are several
alternative syntaxes of assembler, like the "Intel" vs. "AT&T" syntax
for x86 assembler.

--tml

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -march tag in GCC

Fabian Greffrath
Am 01.12.2011 09:20, schrieb Tor Lillqvist:
> Yes and no. The fact that gcc produces assembler source code output
> that needs to be compiled by a separate assembler pass is not that
> relevant here. Even if gcc produced object code directly, of course an
> -march switch would be needed, in the cases where gcc is configured to
> target a family of several slightly different instruction sets.

Yes, but if your code is already in assembler you actually tell the
CPU exactly which instructions to perform. There is no way for the
compiler to chose e.g. using cmov if you enable it via -march flag.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: -march tag in GCC

Earnie Boyd
Fabian Greffrath wrote:

> Am 01.12.2011 09:20, schrieb Tor Lillqvist:
>> Yes and no. The fact that gcc produces assembler source code output
>> that needs to be compiled by a separate assembler pass is not that
>> relevant here. Even if gcc produced object code directly, of course an
>> -march switch would be needed, in the cases where gcc is configured to
>> target a family of several slightly different instruction sets.
>
> Yes, but if your code is already in assembler you actually tell the
> CPU exactly which instructions to perform. There is no way for the
> compiler to chose e.g. using cmov if you enable it via -march flag.

I'm asking because of something like the following code.  If you ``gcc
-march=i386'' it will compile into an object.  If you ``gcc -march=i386
-Wa,-march=i386'' it will abort and not create the object.  My question
is still needing answered, is ``gcc -march=i386'' supposed to propagate
to the assembler compile phase?

void foo (void)
  { __asm__ ( "fninit" ) ;}

--
Earnie
-- https://sites.google.com/site/earnieboyd/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe