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

Add min and max vector intrinsics and codegen infrastructure

This commit is contained in:
MineGame159 2023-04-02 15:07:15 +02:00
parent 7dad948f20
commit bf36bf4b95
5 changed files with 205 additions and 1 deletions

View file

@ -27,6 +27,12 @@ namespace System.Numerics
public extern float4 wzyx { [Intrinsic("shuffle3210")] get; [Intrinsic("shuffle3210")] set; }
[Intrinsic("min")]
public static extern float4 min(float4 lhs, float4 rhs);
[Intrinsic("max")]
public static extern float4 max(float4 lhs, float4 rhs);
[Intrinsic("add")]
public static extern float4 operator+(float4 lhs, float4 rhs);
[Intrinsic("add"), Commutable]

View file

@ -4,6 +4,11 @@ namespace System.Numerics.X86
{
public static bool IsSupported => Runtime.Features.SSE;
[Inline]
public static v128 min_ps(v128 a, v128 b) => (.) float4.min((.) a, (.) b);
[Inline]
public static v128 max_ps(v128 a, v128 b) => (.) float4.max((.) a, (.) b);
[Inline]
public static v128 add_ss(v128 a, v128 b)
{