john-h-k / MathSharp

A vector and matrix library written in C# using hardware intrinsics
MIT License
695 stars 49 forks source link

[PROPOSAL] Add VectorX structs mirroring the System.Numerics Vectors #56

Open ghost opened 5 years ago

ghost commented 5 years ago

Numerics Vectors only support floats, we could re-create them for Doubles, ints and longs (and possibly other types?). This would allow users to take advantage of vector instructions without having to do loads and saves themselves.

john-h-k commented 5 years ago

This seems a good idea, but I would keep explicit loads and stores because they have a cost

ghost commented 5 years ago

Agreed, the JIT probably optimizes this away with the built-in types but we can't count on it doing the same thing in this case (especially since we'd be explicitly calling the SSE/AVX Load/Store functions).

john-h-k commented 5 years ago

I can/will/might do these, but they would just be a storage type, with proper ctors, ToString/GetHashCode/IEquatable<T>. No maths on them