Code Generation and VC++ 8...

  • Thread starter Thread starter Frederico Pissarra
  • Start date Start date
F

Frederico Pissarra

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
 
Frederico Pissarra said:
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
 
Carl Daniel said:
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! :)
 
Frederico said:
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
 
Carl Daniel said:
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.
 
Egbert said:
"Carl Daniel [VC++ MVP]"
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
 
"Carl Daniel [VC++ MVP]"
Egbert said:
"Carl Daniel [VC++ MVP]"
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
 
Bo Persson said:
"Carl Daniel [VC++ MVP]"
Egbert said:
"Carl Daniel [VC++ MVP]"
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!
 
Back
Top