[Mono-dev] simd: more accelerated classes

Alan McGovern alan.mcgovern at gmail.com
Tue Jan 13 15:32:01 EST 2009


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090113/47ac50be/attachment.html 


More information about the Mono-devel-list mailing list