[Mono-dev] mono.simd sugestions

crashfourit crashfourit at gmail.com
Wed Nov 19 13:23:36 EST 2008



It would be nice to have the vector* have a constructor that takes in only
one argument and fills all spots in the vector* with the same value. Like...
Vector4f vector = new Vector4f(1);

Second... I can really see someone doing this to use mono.simd in already
established code base.

[StructLayout( LayoutKind.Sequential, Pack = 0, Size = 16 )]
class Vector4 {

                /* 
                     some user defined vector methods.
                     ..........
               */

		private static explicit operator Vector4f(Vector4 v){
			unsafe {
				Vector4f* p = (Vector4f*) &v;
				return *p;
			}
		}
		
		private static explicit operator Vector4(Vector4f v){
			unsafe {
				Vector4* p = (Vector4*) &v;
				return *p;
			}
		}
}

Is it possible to accelerate these user defined operator overloads? Or do I
have to resort to C# style unions?
-- 
View this message in context: http://www.nabble.com/mono.simd-sugestions-tp20586082p20586082.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list