开发者

Mono.Simd Vector3 (floats) missing?

开发者 https://www.devze.com 2022-12-09 06:24 出处:网络
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?

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

精彩评论

暂无评论...
验证码 换一张
取 消