-
-
Notifications
You must be signed in to change notification settings - Fork 428
[WIP] [2.0] A maths and hardware intrinsics library for Silk.NET and .NET 5 #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4aaf97f
First commit of the maths library
Perksey 8779c6a
Second commit of the maths library
Perksey f6db406
Wip of a rewrite, need to finalize apis first
Perksey ac6f88e
continued
Perksey 4731832
Merge branch 'master' into maths
Perksey 02366a4
Finalize API, add registers
Perksey ab401ae
Commit latest
Perksey 990fd2f
#ReadyToWork
Perksey 0869e1e
Refactor incorrect signature
Perksey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
330 changes: 330 additions & 0 deletions
330
src/Maths/Silk.NET.Intrinsics/Avx/AvxRegister.Double.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,330 @@ | ||
// This file is part of Silk.NET. | ||
// | ||
// You may modify and distribute Silk.NET under the terms | ||
// of the MIT license. See the LICENSE file for details. | ||
|
||
namespace Silk.NET.Intrinsics.Avx | ||
{ | ||
public partial struct AvxRegister : IRegister<double> | ||
{ | ||
public WorkUnit<double> LengthSquared(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Length(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Normalize2(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NormalizeApprox2(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Normalize3(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NormalizeApprox3(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Normalize4(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NormalizeApprox4(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Conjugate(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Inverse(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> DotProduct2(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> DotProduct3(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> DotProduct4(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Add(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Subtract(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Equal(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NotEqual(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Negate(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Lerp(WorkUnit<double> left, WorkUnit<double> right, WorkUnit<double> amount) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Slerp(WorkUnit<double> left, WorkUnit<double> right, WorkUnit<double> amount) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Concatenate(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Multiply(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Transform2(WorkUnit<double> value, WorkUnit<double> quaternion) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Transform3(WorkUnit<double> value, WorkUnit<double> quaternion) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Transform4(WorkUnit<double> value, WorkUnit<double> quaternion) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Abs(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> HorizontalAdd(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Shuffle(WorkUnit<double> value, byte control) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> X(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Y(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Z(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> W(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Sin(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> SinApprox(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Cos(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> CosApprox(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Tan(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> TanApprox(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public void SinCos(WorkUnit<double> vector, out WorkUnit<double> sin, out WorkUnit<double> cos) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Shuffle(WorkUnit<double> left, WorkUnit<double> right, byte control) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> MultiplyAddFused(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> MultiplyAddFast(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NegateMultiplyAddFused(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NegateMultiplyAddFast(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> MultiplySubtractFused(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> MultiplySubtractFast(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NegateMultiplySubtractFused(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> NegateMultiplySubtractFast(WorkUnit<double> x, WorkUnit<double> y, WorkUnit<double> z) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Divide(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Sqrt(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Max(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> Min(WorkUnit<double> vector) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> GreaterThan(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> LessThan(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> GreaterThanOrEqualTo(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public WorkUnit<double> LessThanOrEqualTo(WorkUnit<double> left, WorkUnit<double> right) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe void StoreScalar(WorkUnit<double> vector, double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe void StoreVector2(WorkUnit<double> vector, double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe void StoreVector3(WorkUnit<double> vector, double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe void StoreVector4(WorkUnit<double> vector, double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe WorkUnit<double> ToScalar(double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe WorkUnit<double> ToVector2(double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe WorkUnit<double> ToVector3(double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public unsafe WorkUnit<double> ToVector4(double* ptr) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "Register" mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is poorly chosen, but in the context of the intrinsics library a register is a class capable of performing mathematical operations for a given type using a SIMD register such as AVX or SSE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
IVector
or something would be a better name?Is
Avx
referring toVEX
encoded (128-bit or 256-bit) vectors or strictly 256-bit vectors? If the latter, it might also benefit from a clearer name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah VEX-encoded, but I don't want that leaking out to the user as I want this to be relatively easy to use and not try to introduce too many new concepts to the user - all the user needs to know is "fast maths ooh shiney"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it being VEX encoded an important detail? The operation is ultimately the same, just with better codegen under VEX.
It normally only gets interesting when the size changes, since that changes how much you are processing, etc.