Re: SSE - more specifically fast vector support

d3x0r <[email protected]>
Newsgroups gmane.comp.gnome.mono.general
Message-ID <[email protected]>
d3x0r wrote
> [Acceleration (AccelMode.SSE1)]
> public void Mult ( float scalar, out Vector4f r )
> {
> /* actually this method was slower under mono; this is also fast under MS
> */
>      r.x = scalar * x; r.y = scalar * y; r.z = scalar * z; r.w = scalar *
> w;
> }

I guess 'out' parameters aren't passed by reference.  Changing out to ref... 

[Acceleration (AccelMode.SSE1)]
public void Mult ( float scalar, ref Vector4f r )
{
     r.x = scalar * x; r.y = scalar * y; r.z = scalar * z; r.w = scalar * w;
}

results in an increasd performance

operator mult = 17357
out mult = 10863
del = 62.5%

-----------
But; that means I can't use a math function to initialize a thing without
always creating a new one and copying that result  (out).

Vector4f v1, v2;

v1.Mult( 3.0f, out v2 ); // is valid because ti makes sure all members of v2
are initialized...
v1.Mult( 3.0f, ref v2 ); // is less-than valid because it may not be that
all members of v2 are initialized...


ref and out are the same performance under MS.




--
View this message in context: http://mono.1490590.n4.nabble.com/SSE-more-specifically-fast-vector-support-tp4666751p4666752.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.