[Opensim-dev] FYI: Mono's SIMD Support: Making Mono safe for Gaming

Hurliman, John john.hurliman at intel.com
Tue Nov 4 21:17:48 UTC 2008


Yes, I'm going to look at putting this into OpenMetaverseTypes. For an easy transition I can use underlying data types in the current types (like Vector3), but in the medium term I think we should consider dropping things like Vector3 entirely. It's standard practice in gaming engines to only have a Vector4 type (fits properly in SIMD, PS3 vector processing, etc).

John

From: opensim-dev-bounces at lists.berlios.de [mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Frisby, Adam
Sent: Tuesday, November 04, 2008 6:19 AM
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] FYI: Mono's SIMD Support: Making Mono safe for Gaming

Hrrm, what does it take for us to implement this - can we get openmv to derive from the appropriate classes internally? Etc.

Adam Frisby
Executive Director
Deep Think Labs

p: +61 (0)8 6262-9464
m: +61 (0)410 615-247
e: adam at deepthink.com.au

From: opensim-dev-bounces at lists.berlios.de [mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Alan M Webb
Sent: Tuesday, 4 November 2008 11:02 PM
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] FYI: Mono's SIMD Support: Making Mono safe for Gaming


Very cool.

Best regards
Alan
-------------------
T.J. Watson Research Center, Hawthorne, NY
1-914-784-7286
alan_webb at us.ibm.com
Eugen Leitl <eugen at leitl.org>
Sent by: opensim-dev-bounces at lists.berlios.de

11/04/2008 08:37 AM
Please respond to
opensim-dev at lists.berlios.de


To

opensim-dev at lists.berlios.de

cc

Subject

[Opensim-dev] FYI: Mono's SIMD Support: Making Mono safe for Gaming








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/20081104/6de046d8/attachment-0001.html>


More information about the Opensim-dev mailing list