Current version

v1.10.4 (stable)

Navigation

Main page
Archived news
Downloads
Documentation
   Capture
   Compiling
   Processing
   Crashes
Features
Filters
Plugin SDK
Knowledge base
Contact info
Forum
 
Other projects
   Altirra

Search

Archives

01 Dec - 31 Dec 2013
01 Oct - 31 Oct 2013
01 Aug - 31 Aug 2013
01 May - 31 May 2013
01 Mar - 31 Mar 2013
01 Feb - 29 Feb 2013
01 Dec - 31 Dec 2012
01 Nov - 30 Nov 2012
01 Oct - 31 Oct 2012
01 Sep - 30 Sep 2012
01 Aug - 31 Aug 2012
01 June - 30 June 2012
01 May - 31 May 2012
01 Apr - 30 Apr 2012
01 Dec - 31 Dec 2011
01 Nov - 30 Nov 2011
01 Oct - 31 Oct 2011
01 Sep - 30 Sep 2011
01 Aug - 31 Aug 2011
01 Jul - 31 Jul 2011
01 June - 30 June 2011
01 May - 31 May 2011
01 Apr - 30 Apr 2011
01 Mar - 31 Mar 2011
01 Feb - 29 Feb 2011
01 Jan - 31 Jan 2011
01 Dec - 31 Dec 2010
01 Nov - 30 Nov 2010
01 Oct - 31 Oct 2010
01 Sep - 30 Sep 2010
01 Aug - 31 Aug 2010
01 Jul - 31 Jul 2010
01 June - 30 June 2010
01 May - 31 May 2010
01 Apr - 30 Apr 2010
01 Mar - 31 Mar 2010
01 Feb - 29 Feb 2010
01 Jan - 31 Jan 2010
01 Dec - 31 Dec 2009
01 Nov - 30 Nov 2009
01 Oct - 31 Oct 2009
01 Sep - 30 Sep 2009
01 Aug - 31 Aug 2009
01 Jul - 31 Jul 2009
01 June - 30 June 2009
01 May - 31 May 2009
01 Apr - 30 Apr 2009
01 Mar - 31 Mar 2009
01 Feb - 29 Feb 2009
01 Jan - 31 Jan 2009
01 Dec - 31 Dec 2008
01 Nov - 30 Nov 2008
01 Oct - 31 Oct 2008
01 Sep - 30 Sep 2008
01 Aug - 31 Aug 2008
01 Jul - 31 Jul 2008
01 June - 30 June 2008
01 May - 31 May 2008
01 Apr - 30 Apr 2008
01 Mar - 31 Mar 2008
01 Feb - 29 Feb 2008
01 Jan - 31 Jan 2008
01 Dec - 31 Dec 2007
01 Nov - 30 Nov 2007
01 Oct - 31 Oct 2007
01 Sep - 30 Sep 2007
01 Aug - 31 Aug 2007
01 Jul - 31 Jul 2007
01 June - 30 June 2007
01 May - 31 May 2007
01 Apr - 30 Apr 2007
01 Mar - 31 Mar 2007
01 Feb - 29 Feb 2007
01 Jan - 31 Jan 2007
01 Dec - 31 Dec 2006
01 Nov - 30 Nov 2006
01 Oct - 31 Oct 2006
01 Sep - 30 Sep 2006
01 Aug - 31 Aug 2006
01 Jul - 31 Jul 2006
01 June - 30 June 2006
01 May - 31 May 2006
01 Apr - 30 Apr 2006
01 Mar - 31 Mar 2006
01 Feb - 29 Feb 2006
01 Jan - 31 Jan 2006
01 Dec - 31 Dec 2005
01 Nov - 30 Nov 2005
01 Oct - 31 Oct 2005
01 Sep - 30 Sep 2005
01 Aug - 31 Aug 2005
01 Jul - 31 Jul 2005
01 June - 30 June 2005
01 May - 31 May 2005
01 Apr - 30 Apr 2005
01 Mar - 31 Mar 2005
01 Feb - 29 Feb 2005
01 Jan - 31 Jan 2005
01 Dec - 31 Dec 2004
01 Nov - 30 Nov 2004
01 Oct - 31 Oct 2004
01 Sep - 30 Sep 2004
01 Aug - 31 Aug 2004

Stuff

Powered by Pivot  
XML: RSS feed 
XML: Atom feed 

§ Intrinsics code generation in VC11 preview compiler

I now have the Visual Studio 11 developer preview installed in Windows 7, which makes stressing the new compiler much easier than with the Windows 8 DP in VirtualBox, which freezes for minutes at a time. The compiler version is fortunately the same: 17.00.40825.2. I happened to have a VC10 converted version of Altirra that built without problems after switching to the v110 toolset; VirtualDub required a VC8-to-VC11 conversion, which required stripping some quotes from the converted psa.props and fixing a runtime library setting mismatch. Both programs ran fine, so no big codegen problems.

A few things I've discovered about the new compiler:

1) SSE2 code generation is now the default.

This is confusing since neither the docs nor the project system UI have been updated, but if you don't specify any compiler switches or have enhanced instruction set usage set to Not Set in your project, the compiler will act as if /arch:SSE2 was set. You need to use /arch:IA32 to disable enhanced instruction set usage. (See MS response to bug 688736.)

2) Commutativity-based optimizations are now applied.

I wrote a while back that the compiler generates intrinsics exactly as you write them, so you can sometimes get extraneous moves unless you swap some parameters around. This appears to be fixed and both fold1() and fold2() generate the shorter output.

3) Intrinsics register allocation has improved.

The VC11 compiler does a better job on the SSE FIR routine example I posted earlier. It no longer generates the MOVSS orgy through temps at the top of the loop and also recognizes that zero is easily regenerated, the result being that it is able to hoist two of the four kernel vectors permanently into registers.

I browsed through the intrinsics list, and unfortunately it doesn't look like there are any new intrinsics in the existing instruction sets (still no min/max or round-to-int), but a least it looks like intrinsics code will generally run a bit faster with VC11.

Comments

Comments posted:


Microsoft is finally following in Intel's footsteps when it comes to compiler. Intel has the same SSE2 default for a while now. It only makes sense because for 64-bit code and platforms SSE2 is the minimum requirement.

Igor Levicki (link) - 24 09 11 - 17:39


That's true for x64, but not on x86. Windows 7's system requirements are still a 1GHz processor, so MS at least was still targeting non-SSE2 as of its release. Office's requirements are even lower (500MHz CPU).

I don't think it's a bad idea to target SSE2, but there are a couple of problems. First, the compiler doesn't emit any detection or warning code, so unless you hack some in, your program is going to simply crash on a lower CPU. Not a good experience. The Intel compiler can at generate multi-dispatch code to work around this whereas VC still can't. Second, up through VC10, /arch:SSE2 didn't speed up your code much unless you heavily used doubles. We'll see how effective the auto-vectorizer is on real code situations, but I'm guessing that it still won't actually make that much difference on many programs, not enough that you'd want to deliberately exclude non-SSE2 platforms.

Phaeron - 25 09 11 - 07:10


"Windows 7's system requirements are still a 1GHz processor, so MS at least was still targeting non-SSE2 as of its release."
Yea, until Win2000, the minimum instruction set requirement was just a 486. With WinXP, CX8 and a FPU was added as requirements, and with Vista a TSC requirement was added too, and the motherboard had to support ACPI, and it is still unchanged in Win7.

Yuhong Bao (link) - 29 09 11 - 17:45

Comment form


Please keep comments on-topic for this entry. If you have unrelated comments about VirtualDub, the forum is a better place to post them.
Name:  
Remember personal info?

Email (Optional):
Your email address is only revealed to the blog owner and is not shown to the public.
URL (Optional):
Comment: /

An authentication dialog may appear when you click Post Comment. Simply type in "post" as the user and "now" as the password. I have had to do this to stop automated comment spam.



Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.