View Full Version : Microsoft releases free optimizing C++ compiler
stickboy
18th April 2004, 04:04
http://msdn.microsoft.com/visualc/vctoolkit2003/
The same compiler that ships in VC.net 2003... for free!(Snagged from Ars Technica (http://episteme.arstechnica.com/eve/ubb.x?a=tpc&s=50009562&f=6330927813&m=873007383631&r=360001583631))
After downloading the Windows platform SDK (http://www.microsoft.com/msdownload/platformsdk/sdkupdate/default.htm) and adjusting the includes/lib environment variables, it seems to work fine at compiling AviSynth plug-ins. (When invoking cl.exe, don't forget the /LD switch to output a DLL, and keep in mind that the switches are case-sensitive.)
Richard Berg
18th April 2004, 07:41
Nice! (posted to the front page)
avih
18th April 2004, 10:18
these are indeed interesting news. you might want to follow this (http://forums.mozillazine.org/viewtopic.php?t=69874) mozillazine thread for a discussion. it seems to be missing midl.exe (i think it can somehow be downloaded).
are they trying o fight mingw/cygwin?
Wilbert
18th April 2004, 13:34
Nice! Did anyone of you tried to compile AviSynth itself with this?
stickboy
18th April 2004, 19:34
Not yet... AFAICT there is no make utility included, and AviSynth also needs the VS6sp5 Processor Pack (but for that, I guess one can get the necessary files from masm32 (http://www.masm32.com/)?).
Kurosu
19th April 2004, 02:50
it seems to work fine at compiling AviSynth plug-ins
Just what I needed.
From "Optimization.doc":
If you are sure you are building code for a computer that has SSE2 support, e.g. Pentium 4 or AMD Athlon machine, you can use the /arch:SSE2 option. This produces code that will not run on other chips, but is much faster, especially for routines with a lot of floating point arithmetic.
Since when Athlon (except 64) have SSE2 support, and since when SSE2 is for floating point operations !? Given /arch:SSE exists, I feel there quite some nonsense in this document...
Sigmatador
19th April 2004, 22:32
does anyone have done a benchmark versus the intel compiler 8 ?
does it work with vc6sp5 ? (i don't want to use vc.net2k3 ^^)
stickboy
20th April 2004, 00:46
Originally posted by Sigmatador
does it work with vc6sp5 ? (i don't want to use vc.net2k3 ^^)If you had vc.net2k3, you'd already have the compiler :)
(Edit: Oh, right, you might have the non-optimizing version of the compiler. Oops.)
Anyhow, it works fine with VC6sp5; you just need to change the include/lib/bin directory settings and maybe adjust some of the compiler flags.
Sigmatador
22nd April 2004, 01:08
Originally posted by stickboy
If you had vc.net2k3, you'd already have the compiler :)
(Edit: Oh, right, you might have the non-optimizing version of the compiler. Oops.)
Anyhow, it works fine with VC6sp5; you just need to change the include/lib/bin directory settings and maybe adjust some of the compiler flags.
yes, i *have* it, but i still dont like it.
anyway, the version of the vc.net2k3 seems to be lesser than the one in this vctoolkit2k3.
and yes it worked fine with the good old msvc6, but i still want to test versus ICL8 ^^;
E-Male
24th April 2004, 00:27
could someone please post the comamndline i have to use to make this compiler create myplugin.dll from myplugin.cpp?
thx
stickboy
24th April 2004, 01:58
At a minimum, all you really need is:
cl.exe /LD myplugin.cpp(assuming you have your include/lib environment variables set correctly.)
You probably will want to use some of the optimization flags too (/Ox is probably a good starting point).
E-Male
24th April 2004, 02:03
thx
E-Male
24th April 2004, 07:22
i hope you don't mind my noobish questions here
but i get a bunch of errors when i try to compile the "invert" sample plug-in
i copied the whole list (just removed the path to shorten it a bit)
maybe someone can tell me what i missed
----------------------------
x:\..\WinNT.h(3874) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
x:\..\WinNT.h(3874) : error C2501: '_EXCEPTION_POINTERS::PCONTEXT' : missing storage-class or type specifiers
x:\..\WinNT.h(3874) : error C2501: '_EXCEPTION_POINTERS::ContextRecord' : missing storage-class or type specifiers
x:\..\WinNT.h(8260) : error C2065: 'PCONTEXT' : undeclared identifier
x:\..\WinNT.h(8261) : error C2146: syntax error : missing ')' before identifier 'ContextRecord'
x:\..\WinNT.h(8261) : warning C4229: anachronism used : modifiers on data are ignored
x:\..\WinNT.h(8261) : error C2182: 'RtlCaptureContext' : illegal use of type 'void'
x:\..\WinNT.h(8261) : error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed
x:\..\WinNT.h(8261) : error C2059: syntax error : ')'
x:\..\WinBase.h(747) : error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'
x:\..\WinBase.h(747) : error C2378: 'PCONTEXT' : redefinition; symbol cannot be overloaded with a typedef
x:\..\WinBase.h(747) : error C2501: 'LPCONTEXT' : missing storage-class or type specifiers
x:\..\WinBase.h(2904) : error C2061: syntax error : identifier 'LPCONTEXT'
x:\..\WinBase.h(2912) : error C2143: syntax error : missing ',' before '*'
----------------------------
stickboy
24th April 2004, 09:52
If you mean the Invert sample code from avisynth.org (http://www.avisynth.org/index.php?page=BensAviSynthDocs), then you need to modify the #include lines to:
#include "windows.h" // add this
#include "avisynth.h"Also, you'll need to rename your entry point from AvisynthPluginInit to AvisynthPluginInit2.
(I'll add these corrections to the avisynth.org page right now.)
E-Male
25th April 2004, 12:11
added that line, now it works
i also found the needed change to make the old example work with avisynth 2.5 (just adding a "2")
E-Male
25th April 2004, 15:50
txh again, i managed to compile my first usefull plug-in with it
it allows adding integers to the r, g & b value of each pixel
so you can for example give the picture a more "cold" look
i'm sure such a plug-in already exists, but for educational purpose it was really helpfull
i'll post it in an own thread after some improvement and code clean up
Sigmatador
28th April 2004, 14:13
I've done a quick benchmark CL vs ICL vs GCC on a MD5 hash bruteforce.
CL 13.10.3052 /Ox /O2
ICL 8.0.040 /O3 /Qipo /Qunroll /QxK
GCC 3.3.1 -march=athlon-xp -O3 -ffast-math -malign-double -funroll-loops -pipe -fomit-frame-pointer -msse -mfpmath=sse,387
(if you know better optarg...)
ICL : ~8.6millions hashes/sec
GCC: ~8.3millions hashes/sec
CL : ~6.4millions hashes/sec
m$ rulez :D
edit: some errors.
dandragonrage
29th April 2004, 06:58
-ffast-math is a little unfair.
Here are my CFLAGS: "-O3 -march=athlon-xp -mcpu=athlon-xp -mmmx -m3dnow -msse -fomit-frame-pointer -funroll-loops -fforce-addr -frerun-loop-opt -falign-functions=16 -falign-jumps=16 -falign-loops=16 -falign-labels=1 -finline-functions -pipe -mfpmath=sse,387 -fprefetch-loop-arrays -fmove-all-movables -ftracer -momit-leaf-frame-pointer"
If you wonder why I have march, mcpu, mmx, m3dnow and msse and all of the other redundant stuff, that is because some CFLAGS are stripped for some packages under Gentoo. march may be stripped but not mcpu, for example.
Edit to note that VS.net uses the same exact compiler. I have personally used it and can tell you that everything there is included. Also, from that page: "Microsoft C/C++ Optimizing Compiler and Linker. These are the same compiler and linker that ship with Visual Studio .NET 2003 Professional!"
Prettz
3rd May 2004, 20:05
Originally posted by Kurosu
Since when Athlon (except 64) have SSE2 support, and since when SSE2 is for floating point operations !? Given /arch:SSE exists, I feel there quite some nonsense in this document...
SSE and SSE2 have always been about floating point operations. SSE introduces the XMM registers and 32-bit floating point instructions to operate on them. SSE2 introduces 64-bit floating point instructions to operate on the XMM registers, as well as a ton of MMX-like integer instructions to operate on them.
Kurosu
3rd May 2004, 22:13
Originally posted by Prettz
SSE and SSE2 have always been about floating point operations. SSE introduces the XMM registers and 32-bit floating point instructions to operate on them. SSE2 introduces 64-bit floating point instructions to operate on the XMM registers, as well as a ton of MMX-like integer instructions to operate on them.
True enough: I have never seen SSE2 code used for something else than integers, so I didn't know that 64-bits floating point instructions were added. I'm wrong on that one, as integer part of SSE2 is probably not the main use of the whole SSE2 instruction set.
But in the way it is written, I think it's false: non-64bits Athlons don't have SSE2. Not all Athlons have SSE (in fact, the float part of SSE, as the MMX part of 3DNow! is much alike iSSE).
So, in spite of it being irrelevant to the thread, I'm wondering what they are talking about, though I suspect they meant iSSE code.
@Sigmatador
I think -O7 is the highest hidden switch for optimization, although I don't know what it does. I'm siding with dandragonrage for the mcpu/march switches. The mmmx/m3dnow/msse switches never gave me any speed increase on a P4 Willamette and and Athlon Barton.
In addition, /O2 and /Ox seemed redundant to me for cl.exe. I'd suggest /Ox /Og /Ob2 /Oi /Ot /Oy /GT /G6 (or /G7, depends on your CPU) /Zp16
Sigmatador
4th May 2004, 13:55
thx, i'll try these switchs :cool: , but i doubt that cl (even 2k3) will beat gcc and icl :D
Sigmatador
30th June 2004, 22:13
Visual Studio 2005 Public Beta 1
http://lab.msdn.microsoft.com/vs2005/
http://lab.msdn.microsoft.com/express/
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.