All the pieces are there.
All the pieces are there.
Of course the JITer will not perform the same level of optimizations as the fullblown code generator, but then you can just call that if you like.
The new JIT engine does support SIMD [1]. And C# can generate SIMD code using various libraries (I think MS has one, and I know Mono does).
And various people have shown how to do fullblown x86 assembly code generation and execution from within C#, but it's fragile.
[1] http://blogs.msdn.com/b/dotnet/archive/2014/04/07/the-jit-fi...
float[] floats = new float[1000];
float factor = 1.01f;
int index = 0;
while (index < 1000)
{
floats[index++] *= factor;
}
...becomes...00007ff8`80a804a9 488d549010 lea rdx,[rax+rdx*4+10h]
00007ff8`80a804ae c4e17a1002 vmovss xmm0,dword ptr [rdx]
00007ff8`80a804b3 c4e17a590524000000 vmulss xmm0,xmm0,dword ptr [00007ff8`80a804e0]
00007ff8`80a804bc c4e17a1102 vmovss dword ptr [rdx],xmm0
This is in VS 2013, compiled with DEBUG off, prefer x86 off, and 'any cpu' as the target.
- Use the new RyuJIT
- Make use of 64 bits CPU
- Use the vector and matrix classes from System.Numerics