mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
100
Brutal.Numerics/Vector/sbyte2/sbyte2.numerics-binary.gen.cs
Normal file
100
Brutal.Numerics/Vector/sbyte2/sbyte2.numerics-binary.gen.cs
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
// <auto-generated /> - edit Vector.numerics-binary.tt to modify
|
||||
#nullable enable
|
||||
|
||||
namespace Brutal.Numerics;
|
||||
|
||||
// IBinaryNumber
|
||||
public partial struct sbyte2 : IBinaryNumber<sbyte2>
|
||||
{
|
||||
/// <summary>Determines if every component of a value is a power of two.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static bool IBinaryNumber<sbyte2>.IsPow2(sbyte2 value)
|
||||
{
|
||||
return sbyte.IsPow2(value.X) && sbyte.IsPow2(value.Y);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 Log2(sbyte2 value)
|
||||
{
|
||||
return new sbyte2(sbyte.Log2(value.X), sbyte.Log2(value.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 operator &(sbyte2 a, sbyte2 b)
|
||||
{
|
||||
return new((sbyte)(a.X & b.X), (sbyte)(a.Y & b.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 operator |(sbyte2 a, sbyte2 b)
|
||||
{
|
||||
return new((sbyte)(a.X | b.X), (sbyte)(a.Y | b.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 operator ^(sbyte2 a, sbyte2 b)
|
||||
{
|
||||
return new((sbyte)(a.X ^ b.X), (sbyte)(a.Y ^ b.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 operator ~(sbyte2 value)
|
||||
{
|
||||
return new((sbyte)(~value.X), (sbyte)(~value.Y));
|
||||
}
|
||||
}
|
||||
|
||||
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
|
||||
public partial struct sbyte2
|
||||
{
|
||||
/// <summary>Determines which components of a value are powers of two.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool2 IsPow2(sbyte2 value)
|
||||
{
|
||||
return new bool2(sbyte.IsPow2(value.X), sbyte.IsPow2(value.Y));
|
||||
}
|
||||
}
|
||||
|
||||
// the good bits from IBinaryInteger - declared on IIntegerVector
|
||||
public partial struct sbyte2
|
||||
{
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.PopCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 PopCount(sbyte2 value)
|
||||
{
|
||||
return new sbyte2(sbyte.PopCount(value.X), sbyte.PopCount(value.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.LeadingZeroCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 LeadingZeroCount(sbyte2 value)
|
||||
{
|
||||
return new sbyte2(sbyte.LeadingZeroCount(value.X), sbyte.LeadingZeroCount(value.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.TrailingZeroCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 TrailingZeroCount(sbyte2 value)
|
||||
{
|
||||
return new sbyte2(sbyte.TrailingZeroCount(value.X), sbyte.TrailingZeroCount(value.Y));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateLeft" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 RotateLeft(sbyte2 value, int rotateAmount)
|
||||
{
|
||||
return new sbyte2(sbyte.RotateLeft(value.X, rotateAmount), sbyte.RotateLeft(value.Y, rotateAmount));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateRight" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static sbyte2 RotateRight(sbyte2 value, int rotateAmount)
|
||||
{
|
||||
return new sbyte2(sbyte.RotateRight(value.X, rotateAmount), sbyte.RotateRight(value.Y, rotateAmount));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue