[Mono-list] Mono.Simd - Flow Control (?)

Rodrigo Kumpera kumpera at gmail.com
Mon Sep 16 19:26:36 UTC 2013


You can cast between vector types for free.


On Mon, Sep 16, 2013 at 3:21 PM, Nigel Delaney <nigel.delaney at outlook.com>wrote:

> Hi,****
>
> ** **
>
> Thanks for the response, it’s always great to hear from the person who
> wrote the code in question (and this really does look like a great
> namespace to, thanks).  Unfortunately, I am still not sure how to implement
> your idea.  I gather I can do the wide compare with this method:****
>
> ** **
>
> public unsafe static Vector2d CompareLessThan (this Vector2d v1, Vector2d
> v2)****
>
> ** **
>
> However, I am still not sure how I can extract the byte mask.  I gather
> from the source code:  ****
>
> ** **
>
>
> https://github.com/mono/mono/blob/0f2995e95e98e082c7c7039e17175cf2c6a00034/mcs/class/Mono.Simd/Mono.Simd/VectorOperations.cs
> ****
>
> That the ExtractByteMask method is only available for Vector16sb and
> Vector16b and not any of the other vector types.  Does this mean I would
> have to cast to one of these types in order to run this method?  I am not
> sure what the consequences of this would be.  I think (?) that from the
> machines perspective these SSE vector objects are all just 16 bytes that
> get loaded into the XMM registers, so I don’t know if this cast would have
> any overhead, put am worried it wouldn’t be any more efficient than just
> unpacking the values and comparing them separately.  Any thoughts on
> whether I could extract a byte mask directly from the vector2d, or if the
> cast would be expected to be faster than just unpacking the Vector2d values
> and comparing them separately?****
>
> ** **
>
> Thanks again for the help,****
>
> Nigel****
>
> ** **
>
> ** **
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130916/a04a677f/attachment.html>


More information about the Mono-list mailing list