C# and SIMD
It would be great if C# compiler and .Net JIT compiler could utilize SIMD instructions of current and future processors. The projects that require heavy calculations (MathDotNet.Numerics for example) would greatly benefit from this feature.
36 comments
-
Jay Lemmon commented
I do a lot of linear algebra work in C#, and I can wrangle the JITer to give me near optimal x87 with loop unrolling and things like that. SIMD is the only reason I have left to do anything in C++. Please don't make me go back to it!
-
sinand99
commented
we NEED SIMD!! now!!!
-
Tom Spilman
commented
There is another vote on the Connect site:
https://connect.microsoft.com/VisualStudio/feedback/details/778895/add-builtin-simd-support-for-net
-
Joshua A. Schaeffer commented
Just because the JITter won't optimize for the sake of startup speed, doesn't mean NGEN can't be tasked with the ability to hyper-optimize .NET modules with SIMD and who knows what else.
-
Tom Spilman
commented
We need SIMD! It would go a long way towards leveling the playing field between C# and C++.
-
codekaizen
commented
@DrPizza - do you have a link? I remember decompiling JVM jitted bytecode in 2007 and it had already been using the XMM registers then. I'm guessing they've improved it even more and I'd love details.
-
jyoti
commented
code preview of custom feedback from
-
Anonymous
commented
With the direction that the industry is taking ,this should be considered high priority IMO. NEON could ooze a lot of performance out of the low power ARM chips we are seeing now; I hope MS is serious about the whole The whole Fast and Fluid mantra they are pushing.
-
DrPizza commented
In August, HotSpot added SIMD autovectorization of Java bytecode. HotSpot already has profiling and recompilation of hot spots (hence the name...). The Java JIT machinery was always ahead of .NET's and is leaving it ever further behind.
-
Andrew
commented
I develop games in C# .NET as its far more productive then C++ for smaller teams. I plan doing so for Windows 8 Metro as well. Auto vectorization or something like Mono.Simd would be very useful.
-
Igor Markovic
commented
I'm creating performance sensitive application which use popcount extensively.
I need to check if cpu supports sse 4.2 and use popcount directly (or use software implementation if not available).
Will this feature be available and when?
Is there any time estimate or should I use unmanaged c++ instead? -
Henrik Öjelund
commented
We develop 3d cad software and the lack of SIMD intrinsic types is one the major drawback of C# compared to C++.
-
dev
commented
In response to Carol Eidt as a game developer, I mostly work with vector2, vector3, matrix 4x4 and quaternions. In these use cases, SIMD intrinsics are the most important by far. This is one area where c# falls short of c++.
-
codekaizen
commented
Is anyone pushing for this going to BUILD 2012?
-
Anonymous
commented
Automatic vectorization would be amazing.
-
Anonymous
commented
Another vote for SIMD. I would find that extremely useful, as I like C# for games.
-
xoofx
commented
Along a much more improved JIT or NGen tools to generate highly optimized code, this feature is absolutely crucial. Please make float4, float2...etc HLSL like intrinsics available in C#
-
Richard Thorne
commented
Thanks for the insight Carol :) I think for the third case maybe a new application configuration value for enabling/disabling "heavier" JIT optimisations may be appropriate, that way server apps and games can enable it but lighter weight applications can have it off by default and not see any change in boot time.
-
Anonymous
commented
In additional SIMD support, C# could also use better support for x64 hardware capabilities. See
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2643778-support-int128-on-64-bit-platform -
Anonymous
commented
#2 seems to be the bridge between #1 (useful for specialized geometric math in 3D) and #3 (where the coder is unaware that his task involves vectors of arbitrary length). As #1 will be used by the math savvy and #3 by them and all others, I see no additional value in #2. However, I value any solution you choose.