1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 09:27:59 +02:00

Start of SIMD support

This commit is contained in:
Brian Fiete 2020-08-23 05:42:42 -07:00
parent 73e260c1d5
commit 64b62c09be
30 changed files with 5846 additions and 5096 deletions

View 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);
}
}

View 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);
}
}