[Opensim-dev] FYI: Mono's SIMD Support: Making Mono safe for Gaming
Dahlia Trimble
dahliatrimble at gmail.com
Fri Nov 7 00:11:32 UTC 2008
I looked through the mono SIMD api and I didn't see anything that would help
the meshing code. Probably the most expensive operations in meshing are
vector * quaternion and quaternion constructors. If these could be
implemented in the SIMD api somehow that would really help a lot. All I
really saw in there were operations on single float members which I don't
really use.
Then again meshing happens almost entirely at sim startup. It only happens
during normal operation if a prim is being rezzed or changed. I don't think
that sim *users* would see any benefits.
On Tue, Nov 4, 2008 at 6:37 AM, Eugen Leitl <eugen at leitl.org> wrote:
>
> http://tirania.org/blog/archive/2008/Nov-03.html
>
> Mono's SIMD Support: Making Mono safe for Gaming
>
> This week at the Microsoft PDC we introduced a new feature in the Mono
> virtual machine that we have been working on quietly and will appear in our
> upcoming Mono 2.2 release (due in early December).
>
> I believe we are the first VM for managed code that provides an
> object-oriented API to the underlying CPU SIMD instructions.
>
> In short, this means that developers will be able to use the types in the
> Mono.Simd library and have those mapped directly to efficient vector
> operations on the hardware that supports it.
>
> With Mono.Simd, the core of a vector operations like updating the
> coordinates on an existing vector like the following example will go from
> 40-60 CPU instructions into 4 or so SSE instructions.
>
> Vector4f Move (Vector4f [] pos, ref Vector4f delta)
> {
> for (int i = 0; i < pos.Length; i++)
> pos [i] += delta;
> }
>
>
> Which in C# turns out to be a call into the method Vector4f.operator +
> (Vector4f a, Vector4f b) that is implemented like this:
>
> Vector3f static operator + (Vector3f a, Vector3f b)
> {
> return new Vector3f (a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w);
> }
>
>
> The core of the operation is inlined in the `Move' method and it looks like
> this:
>
> movups (%eax),%xmm0
> movups (%edi),%xmm1
> addps %xmm1,%xmm0
> movups %xmm0,(%eax)
>
> etc.
>
> --
> Eugen* Leitl <a href="http://leitl.org">leitl</a> http://leitl.org
> ______________________________________________________________
> ICBM: 48.07100, 11.36820 http://www.ativel.com http://postbiota.org
> 8B29F6BE: 099D 78BA 2FD3 B014 B08A 7779 75B0 2443 8B29 F6BE
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20081106/a88cde4f/attachment-0001.html>
More information about the Opensim-dev
mailing list