By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,745 Members | 1,873 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,745 IT Pros & Developers. It's quick & easy.

Code Generation and VC++ 8...

P: n/a
Recently I tried to use -G5 option on CL compiler (from Visual Studio
2005)... To my surprise, there is no processor specific optimizations
anymore! Is that correct?

Is so, why?

[]s
Fred
Mar 23 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Frederico Pissarra" <fr*******@vgainfo.com> wrote in message
news:ue****************@TK2MSFTNGP14.phx.gbl...
Recently I tried to use -G5 option on CL compiler (from Visual Studio
2005)... To my surprise, there is no processor specific optimizations
anymore! Is that correct?
Yes.
Is so, why?


They didn't actually do much of anything in the first place, so they were
eliminated.

Note that there is now /arch:sse{2}, which first appeared with VC7.1, and a
host of new floating-point code generation options which together have much
more performance impact than /G3{4,5,6} ever had.

-cd
Mar 23 '06 #2

P: n/a
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
escreveu na mensagem news:ea**************@TK2MSFTNGP14.phx.gbl...
"Frederico Pissarra" <fr*******@vgainfo.com> wrote in message
news:ue****************@TK2MSFTNGP14.phx.gbl...
Recently I tried to use -G5 option on CL compiler (from Visual Studio
2005)... To my surprise, there is no processor specific optimizations
anymore! Is that correct?


Yes.
Is so, why?


They didn't actually do much of anything in the first place, so they were
eliminated.

Note that there is now /arch:sse{2}, which first appeared with VC7.1, and
a host of new floating-point code generation options which together have
much more performance impact than /G3{4,5,6} ever had.

-cd


Hello, Carl!!

I never did a profound analysis of /G5 optimized generated code... I suppose
/G5 was created to do things like instruction pairing and so on... this is
made automatically in VC 8? What is the default platform? 386 or Pentium?

To use SSE the compiler must expect at least a Pentium 3 processor... SSE2,
Pentium 4!

What about AMD Athlon 64 processors?

Thanks....
Fred

PS: BTW... Probably you 'll notice some mispelled words and some expressions
not very common in english... this is because I'm brasillian and english is
not my native idiom...
So, please, forgive my poor english! :)
Mar 24 '06 #3

P: n/a
Frederico Pissarra wrote:
Hello, Carl!!

I never did a profound analysis of /G5 optimized generated code... I
suppose /G5 was created to do things like instruction pairing and so
on... this is made automatically in VC 8? What is the default
platform? 386 or Pentium?
The default is what used to be known as /GB - the "blended model".
Generally, the VC++ team tries to make each compiler release work well for
the "current" generation of CPUs when that versio nof VC++ is released. In
the case of VC8, it's tuned towards P4/AMD, but tends to avoid constructs
that perform really badly on older processors to avoid penalizing users with
older CPUs.

To use SSE the compiler must expect at least a Pentium 3 processor...
SSE2, Pentium 4!
Yes. Of course, that's a function of which CPU is used to run the code -
you can compile for SSE(2) on any machine that supports VC++, but if you
compiled for SSE(2), then the program will fail at runtime if you're not
runnig on a new enough CPU.

What about AMD Athlon 64 processors?
AMD64/EMT64 are fully supported by VC8, but it's a different compiler
executable rather than a command-line switch to specify 64 bit code
generation.

Thanks....
Fred

PS: BTW... Probably you 'll notice some mispelled words and some
expressions not very common in english... this is because I'm
brasillian and english is not my native idiom...
So, please, forgive my poor english! :)


Your English is just fine - no problems!

-cd
Mar 24 '06 #4

P: n/a

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
Frederico Pissarra wrote:
Hello, Carl!! What about AMD Athlon 64 processors?


AMD64/EMT64 are fully supported by VC8, but it's a different compiler
executable rather than a command-line switch to specify 64 bit code
generation.


Indeed. You have to create a new active solution platform it's called x64 as
opposed to win32.

Detail. Only the win32 VC compiler platform supports __asm statements. It
seems that creating own assemblycode has become more of a hobby that a
usefull activity since the compiler produces very efficient assembly code.

Mar 28 '06 #5

P: n/a
Egbert Nierop wrote:
"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospam > wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Frederico Pissarra wrote:
Hello, Carl!! What about AMD Athlon 64 processors?


AMD64/EMT64 are fully supported by VC8, but it's a different compiler
executable rather than a command-line switch to specify 64 bit code
generation.


Indeed. You have to create a new active solution platform it's called
x64 as opposed to win32.

Detail. Only the win32 VC compiler platform supports __asm
statements. It seems that creating own assemblycode has become more
of a hobby that a usefull activity since the compiler produces very
efficient assembly code.


....although there are lots of requests for support for __asm in the x64
compiler. who knows, we might see it some day (but not in Orcas, I'm sure).

-cd
Mar 28 '06 #6

P: n/a

"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospam > skrev i meddelandet
news:u2**************@tk2msftngp13.phx.gbl...
Egbert Nierop wrote:
"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospam > wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Frederico Pissarra wrote:
Hello, Carl!!
What about AMD Athlon 64 processors?

AMD64/EMT64 are fully supported by VC8, but it's a different
compiler
executable rather than a command-line switch to specify 64 bit
code
generation.


Indeed. You have to create a new active solution platform it's
called
x64 as opposed to win32.

Detail. Only the win32 VC compiler platform supports __asm
statements. It seems that creating own assemblycode has become more
of a hobby that a usefull activity since the compiler produces very
efficient assembly code.


...although there are lots of requests for support for __asm in the
x64 compiler.


Many of the requests are from people who haven't yet realized that
most of the "interesting" instructions are available as intrinsics.
These integrate very well with the optimizer.

Other mixed in inline assembler is very diffcult in x86 mode, because
- optimizing significantly better than the compiler is really, really
difficult
- the asm code disturbs the optimizer, potentialy reducing the quality
of the surrounding code

You can still write whole functions in assembler, and put them in .asm
files.

who knows, we might see it some day (but not in Orcas, I'm sure).


I doubt that there is enough real use for it. :-)
Bo Persson
Mar 28 '06 #7

P: n/a

"Bo Persson" <bo*@gmb.dk> skrev i meddelandet
news:48************@individual.net...

"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospam > skrev i
meddelandet news:u2**************@tk2msftngp13.phx.gbl...
Egbert Nierop wrote:
"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospam > wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Frederico Pissarra wrote:
> Hello, Carl!!

> What about AMD Athlon 64 processors?

AMD64/EMT64 are fully supported by VC8, but it's a different
compiler
executable rather than a command-line switch to specify 64 bit
code
generation.

Indeed. You have to create a new active solution platform it's
called
x64 as opposed to win32.

Detail. Only the win32 VC compiler platform supports __asm
statements. It seems that creating own assemblycode has become
more
of a hobby that a usefull activity since the compiler produces
very
efficient assembly code.
...although there are lots of requests for support for __asm in the
x64 compiler.


Many of the requests are from people who haven't yet realized that
most of the "interesting" instructions are available as intrinsics.
These integrate very well with the optimizer.

Other mixed in inline assembler is very diffcult in x86 mode,
because


Wrote x86 meaning x64, of course!
- optimizing significantly better than the compiler is really,
really difficult
- the asm code disturbs the optimizer, potentialy reducing the
quality of the surrounding code

You can still write whole functions in assembler, and put them in
.asm files.

who knows, we might see it some day (but not in Orcas, I'm sure).


I doubt that there is enough real use for it. :-)
Bo Persson

Mar 28 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.