mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
Start of SIMD support
This commit is contained in:
parent
73e260c1d5
commit
64b62c09be
30 changed files with 5846 additions and 5096 deletions
|
@ -309,6 +309,15 @@ namespace System
|
|||
|
||||
}
|
||||
|
||||
[AttributeUsage(.Struct)]
|
||||
public struct UnderlyingArrayAttribute : Attribute
|
||||
{
|
||||
public this(Type t, int size, bool isVector)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(.Field | .Method /*2*/)]
|
||||
public struct NoShowAttribute : Attribute
|
||||
{
|
||||
|
|
14
BeefLibs/corlib/src/Numerics/Bool4.bf
Normal file
14
BeefLibs/corlib/src/Numerics/Bool4.bf
Normal file
|
@ -0,0 +1,14 @@
|
|||
namespace System.Numerics
|
||||
{
|
||||
[UnderlyingArray(typeof(bool), 4, true)]
|
||||
struct bool4
|
||||
{
|
||||
public bool x;
|
||||
public bool y;
|
||||
public bool z;
|
||||
public bool w;
|
||||
|
||||
[Intrinsic("and")]
|
||||
public static extern bool4 operator&(bool4 lhs, bool4 rhs);
|
||||
}
|
||||
}
|
89
BeefLibs/corlib/src/Numerics/Float4.bf
Normal file
89
BeefLibs/corlib/src/Numerics/Float4.bf
Normal file
|
@ -0,0 +1,89 @@
|
|||
namespace System.Numerics
|
||||
{
|
||||
[UnderlyingArray(typeof(float), 4, true)]
|
||||
struct float4
|
||||
{
|
||||
public float x;
|
||||
public float y;
|
||||
public float z;
|
||||
public float w;
|
||||
|
||||
public this()
|
||||
{
|
||||
this = default;
|
||||
}
|
||||
|
||||
public this(float x, float y, float z, float w)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
public extern float4 wzyx { [Intrinsic("shuffle3210")] get; [Intrinsic("shuffle3210")] set; }
|
||||
|
||||
[Intrinsic("add")]
|
||||
public static extern float4 operator+(float4 lhs, float4 rhs);
|
||||
[Intrinsic("add"), Commutable]
|
||||
public static extern float4 operator+(float4 lhs, float rhs);
|
||||
[Intrinsic("add")]
|
||||
public static extern float4 operator++(float4 lhs);
|
||||
|
||||
[Intrinsic("sub")]
|
||||
public static extern float4 operator-(float4 lhs, float4 rhs);
|
||||
[Intrinsic("sub"), Commutable]
|
||||
public static extern float4 operator-(float4 lhs, float rhs);
|
||||
[Intrinsic("sub")]
|
||||
public static extern float4 operator--(float4 lhs);
|
||||
|
||||
[Intrinsic("mul")]
|
||||
public static extern float4 operator*(float4 lhs, float4 rhs);
|
||||
[Intrinsic("mul"), Commutable]
|
||||
public static extern float4 operator*(float4 lhs, float rhs);
|
||||
|
||||
[Intrinsic("div")]
|
||||
public static extern float4 operator/(float4 lhs, float4 rhs);
|
||||
[Intrinsic("div")]
|
||||
public static extern float4 operator/(float4 lhs, float rhs);
|
||||
[Intrinsic("div")]
|
||||
public static extern float4 operator/(float lhs, float4 rhs);
|
||||
|
||||
[Intrinsic("mod")]
|
||||
public static extern float4 operator%(float4 lhs, float4 rhs);
|
||||
[Intrinsic("mod")]
|
||||
public static extern float4 operator%(float4 lhs, float rhs);
|
||||
[Intrinsic("mod")]
|
||||
public static extern float4 operator%(float lhs, float4 rhs);
|
||||
|
||||
[Intrinsic("eq")]
|
||||
public static extern bool4 operator==(float4 lhs, float4 rhs);
|
||||
[Intrinsic("eq"), Commutable]
|
||||
public static extern bool4 operator==(float4 lhs, float rhs);
|
||||
|
||||
[Intrinsic("neq")]
|
||||
public static extern bool4 operator!=(float4 lhs, float4 rhs);
|
||||
[Intrinsic("neq"), Commutable]
|
||||
public static extern bool4 operator!=(float4 lhs, float rhs);
|
||||
|
||||
[Intrinsic("lt")]
|
||||
public static extern bool4 operator<(float4 lhs, float4 rhs);
|
||||
[Intrinsic("lt")]
|
||||
public static extern bool4 operator<(float4 lhs, float rhs);
|
||||
|
||||
[Intrinsic("lte")]
|
||||
public static extern bool4 operator<=(float4 lhs, float4 rhs);
|
||||
[Intrinsic("lte")]
|
||||
public static extern bool4 operator<=(float4 lhs, float rhs);
|
||||
|
||||
[Intrinsic("gt")]
|
||||
public static extern bool4 operator>(float4 lhs, float4 rhs);
|
||||
[Intrinsic("gt")]
|
||||
public static extern bool4 operator>(float4 lhs, float rhs);
|
||||
|
||||
[Intrinsic("gte")]
|
||||
public static extern bool4 operator>=(float4 lhs, float4 rhs);
|
||||
[Intrinsic("gte")]
|
||||
public static extern bool4 operator>=(float4 lhs, float rhs);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ namespace System
|
|||
[AlwaysInclude]
|
||||
struct SizedArray<T, CSize> where CSize : const int
|
||||
{
|
||||
T[CSize] mVal;
|
||||
protected T[CSize] mVal;
|
||||
|
||||
public int Count
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue