[Mono-dev] simd: more accelerated classes

crashfourit crashfourit at gmail.com
Tue Jan 13 15:40:16 EST 2009


I've done that. just that "fixed" and "unsafe" statements would have to be
used, Pushing the args on the stack and then taking them off to multiply
then putting them on the stack again for it to return can slows things down.


Alan McGovern-2 wrote:
> 
> I really doubt that kind of specific optimisation would ever make it into
> mono. Have you tried benchmarking the existing SIMD implementation and
> seeing what the raw performance of that is as compared to using the XNA
> structs with Mono.SIMD in the background? The difference shouldn't be that
> big. Something like this would be the implementation of the Xna struct:
> 
> struct XNAVector4f {
>     float X, Y, Z, W;
>     public XNAVector4f Multiply (XNAVector4f other)
>     {
>           Mono.Simd.Vector4f v1 = (Mono.Simd.Vector4f) &this;
>           Mono.Simd.Vector4f v2 = (Mono.Simd.Vector4f) &other;
>           return *((XNAVector4f *) &Mono.Simd.Vector4f.Multiply (v1, v2));
>     }
> }
> 
> Alan
> 
> On Tue, Jan 13, 2009 at 8:25 PM, crashfourit <crashfourit at gmail.com>
> wrote:
> 
>>
>>
>>
>> Rodrigo Kumpera wrote:
>> >
>> > On Tue, Jan 13, 2009 at 5:50 PM, crashfourit <crashfourit at gmail.com>
>> > wrote:
>> >
>> >>
>> >>
>> >>
>> >> crashfourit wrote:
>> >> >
>> >> > I was wondering what it would take to use simd to acclerate this
>> >> >
>> >> > Vector4f {
>> >> > public float X;
>> >> > public float Y;
>> >> > public float Z;
>> >> > public float W;
>> >> > //.......
>> >> > }
>> >> >
>> >> > instead of this
>> >> > Vector4f {
>> >> > internal float x;
>> >> > internal float y;
>> >> > internal float z;
>> >> > internal float w;
>> >> >
>> >> > public float X {get {return x;} set {x = value;}}
>> >> > public float Y {get {return y;} set {y = value;}}
>> >> > public float Z {get {return z;} set {z = value;}}
>> >> > public float W {get {return w;} set {w = value;}}
>> >> > //.......
>> >> > }
>> >> > Any sugestions?
>> >> >
>> >>
>> >>
>> >> Also, I was wondering is there any interest in accelerated versions of
>> >> high
>> >> level math constructs?
>> >>
>> >> Like, QuaternionF, QuaternionD, Matrix4f, Matrix4d, etc?
>> >> --
>> >
>> >
>> > I would love to see a library with such high level constructs that
>> exploit
>> > Mono.Simd. I would
>> > help with it for sure, but it shouldn't be bundled with mono.
>> >
>>
>> Why shouldn't it be bundled with mono? I'd at least like to have those
>> higher level math structs in the "Mono.Simd.Math" or "Mono.Math" name
>> space
>> or something similar, and and have the jit engine be more agressive when
>> inline methods in those classes. Or, have the jit engine act on those
>> classes in a similar way to the Vector* classes in the "Mono.Simd" name
>> space.
>>
>> On a side note, what do you think of the idea of the jit engine acting
>> more
>> aggressive to inline getters and setters than normal? I looked at the
>> inline
>> detection code, and realized this could be easily done.
>> --
>> View this message in context:
>> http://www.nabble.com/simd%3A-more-accelerated-classes-tp21442105p21443769.html
>> Sent from the Mono - Dev mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 

-- 
View this message in context: http://www.nabble.com/simd%3A-more-accelerated-classes-tp21442105p21443998.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list