SSE3 instructions in F#
How do I parallelize my F# program using SSE3 instruction set? Does 开发者_开发技巧the F# compiler support it?
.Net doesn't talk to the hardware at that level. If you want explicit control over the instruction set used, you'll need to call out to a library written in a more appropriate language. C/C++ comes to mind.
I don't know anything about this, but:
Link
Probably not useful, but you can play with the internal fields on a delegate to make it call to arbitrary code: http://www.atrevido.net/blog/2005/01/28/Inline+X86+ASM+In+C.aspx
See the comments for more caveats and other approaches. The benefit of playing with a delegates target directly is (AFAIK) you won't get a managed-unmanaged transition as if you did GetDelegateForFunctionPointer or other interop approaches.
On the downside, this means you have to code it by hand and make sure the calling conventions line up and so on. It's probably fragile, and the delegate call overhead might make it not worth it.
精彩评论