I suggest you ...

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.

1,031 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Georgii KalnytskyiGeorgii Kalnytskyi shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    36 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Jay LemmonJay Lemmon commented  ·   ·  Flag as inappropriate

        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!

      • Joshua A. SchaefferJoshua A. Schaeffer commented  ·   ·  Flag as inappropriate

        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 SpilmanTom Spilman commented  ·   ·  Flag as inappropriate

        We need SIMD! It would go a long way towards leveling the playing field between C# and C++.

      • codekaizencodekaizen commented  ·   ·  Flag as inappropriate

        @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.

      • AnonymousAnonymous commented  ·   ·  Flag as inappropriate

        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.

      • DrPizzaDrPizza commented  ·   ·  Flag as inappropriate

        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.

      • AndrewAndrew commented  ·   ·  Flag as inappropriate

        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 MarkovicIgor Markovic commented  ·   ·  Flag as inappropriate

        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 ÖjelundHenrik Öjelund commented  ·   ·  Flag as inappropriate

        We develop 3d cad software and the lack of SIMD intrinsic types is one the major drawback of C# compared to C++.

      • devdev commented  ·   ·  Flag as inappropriate

        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++.

      • AnonymousAnonymous commented  ·   ·  Flag as inappropriate

        Another vote for SIMD. I would find that extremely useful, as I like C# for games.

      • xoofxxoofx commented  ·   ·  Flag as inappropriate

        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 ThorneRichard Thorne commented  ·   ·  Flag as inappropriate

        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.

      • AnonymousAnonymous commented  ·   ·  Flag as inappropriate

        #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.

      ← Previous 1

      Feedback and Knowledge Base