<br><font size=2 face="sans-serif">Very cool.</font>
<br><font size=2 face="sans-serif"><br>
Best regards<br>
Alan<br>
-------------------<br>
T.J. Watson Research Center, Hawthorne, NY<br>
1-914-784-7286<br>
alan_webb@us.ibm.com</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Eugen Leitl <eugen@leitl.org></b>
</font>
<br><font size=1 face="sans-serif">Sent by: opensim-dev-bounces@lists.berlios.de</font>
<p><font size=1 face="sans-serif">11/04/2008 08:37 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
opensim-dev@lists.berlios.de</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">opensim-dev@lists.berlios.de</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[Opensim-dev] FYI: Mono's SIMD Support:
Making Mono safe for Gaming</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2><br>
http://tirania.org/blog/archive/2008/Nov-03.html<br>
<br>
Mono's SIMD Support: Making Mono safe for Gaming<br>
<br>
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).<br>
<br>
I believe we are the first VM for managed code that provides an object-oriented
API to the underlying CPU SIMD instructions.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Vector4f Move (Vector4f [] pos, ref Vector4f delta)<br>
{<br>
for (int i = 0; i < pos.Length; i++)<br>
pos
[i] += delta;<br>
}<br>
<br>
<br>
Which in C# turns out to be a call into the method Vector4f.operator +
(Vector4f a, Vector4f b) that is implemented like this:<br>
<br>
Vector3f static operator + (Vector3f a, Vector3f b)<br>
{<br>
return new Vector3f (a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w);<br>
}<br>
<br>
<br>
The core of the operation is inlined in the `Move' method and it looks
like this:<br>
<br>
movups (%eax),%xmm0<br>
movups (%edi),%xmm1<br>
addps %xmm1,%xmm0<br>
movups %xmm0,(%eax)<br>
<br>
etc.<br>
<br>
-- <br>
Eugen* Leitl <a href="http://leitl.org">leitl</a>
http://leitl.org<br>
______________________________________________________________<br>
ICBM: 48.07100, 11.36820 http://www.ativel.com http://postbiota.org<br>
8B29F6BE: 099D 78BA 2FD3 B014 B08A 7779 75B0 2443 8B29 F6BE<br>
_______________________________________________<br>
Opensim-dev mailing list<br>
Opensim-dev@lists.berlios.de<br>
https://lists.berlios.de/mailman/listinfo/opensim-dev<br>
</font></tt>
<br>