Heya, I'm trying to use Mono's SIMD to handle coordinates(X,Y,Z) in my project, but I only see support for Vector2 and Vector4 types. Has anyone run into this before, and are there any workarounds?
Thanks in adva开发者_如何学编程nce.
That's connected to the way the registers work. You can just use the Vector4f and set the W
part to 0, or 1 (depending on what you want to do with the vector) and everything will be ok.
http://tirania.org/blog/archive/2008/Nov-03.html explains:
On x86 processors these instructions use a new register bank (the XMM registers) and can be configured to work on 16 bytes at a time using a number of possible combinations:
* byte-level operations on 16 elements. * short-level operations on 8 elements. * single precision or integer-level operations on 4 elements. * double precision or long-integer operations on 2 elements.
精彩评论