brutal/Brutal.Numerics/Vector/ulong4/ulong4.numerics-binary.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

100 lines
3.9 KiB
C#

// <auto-generated /> - edit Vector.numerics-binary.tt to modify
#nullable enable
namespace Brutal.Numerics;
// IBinaryNumber
public partial struct ulong4 : IBinaryNumber<ulong4>
{
/// <summary>Determines if every component of a value is a power of two.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool IBinaryNumber<ulong4>.IsPow2(ulong4 value)
{
return ulong.IsPow2(value.X) && ulong.IsPow2(value.Y) && ulong.IsPow2(value.Z) && ulong.IsPow2(value.W);
}
/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 Log2(ulong4 value)
{
return new ulong4(ulong.Log2(value.X), ulong.Log2(value.Y), ulong.Log2(value.Z), ulong.Log2(value.W));
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 operator &(ulong4 a, ulong4 b)
{
return new(a.X & b.X, a.Y & b.Y, a.Z & b.Z, a.W & b.W);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 operator |(ulong4 a, ulong4 b)
{
return new(a.X | b.X, a.Y | b.Y, a.Z | b.Z, a.W | b.W);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 operator ^(ulong4 a, ulong4 b)
{
return new(a.X ^ b.X, a.Y ^ b.Y, a.Z ^ b.Z, a.W ^ b.W);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 operator ~(ulong4 value)
{
return new(~value.X, ~value.Y, ~value.Z, ~value.W);
}
}
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
public partial struct ulong4
{
/// <summary>Determines which components of a value are powers of two.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4 IsPow2(ulong4 value)
{
return new bool4(ulong.IsPow2(value.X), ulong.IsPow2(value.Y), ulong.IsPow2(value.Z), ulong.IsPow2(value.W));
}
}
// the good bits from IBinaryInteger - declared on IIntegerVector
public partial struct ulong4
{
/// <inheritdoc cref="IBinaryInteger{TSelf}.PopCount" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 PopCount(ulong4 value)
{
return new ulong4(ulong.PopCount(value.X), ulong.PopCount(value.Y), ulong.PopCount(value.Z), ulong.PopCount(value.W));
}
/// <inheritdoc cref="IBinaryInteger{TSelf}.LeadingZeroCount" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 LeadingZeroCount(ulong4 value)
{
return new ulong4(ulong.LeadingZeroCount(value.X), ulong.LeadingZeroCount(value.Y), ulong.LeadingZeroCount(value.Z), ulong.LeadingZeroCount(value.W));
}
/// <inheritdoc cref="IBinaryInteger{TSelf}.TrailingZeroCount" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 TrailingZeroCount(ulong4 value)
{
return new ulong4(ulong.TrailingZeroCount(value.X), ulong.TrailingZeroCount(value.Y), ulong.TrailingZeroCount(value.Z), ulong.TrailingZeroCount(value.W));
}
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateLeft" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 RotateLeft(ulong4 value, int rotateAmount)
{
return new ulong4(ulong.RotateLeft(value.X, rotateAmount), ulong.RotateLeft(value.Y, rotateAmount), ulong.RotateLeft(value.Z, rotateAmount), ulong.RotateLeft(value.W, rotateAmount));
}
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateRight" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong4 RotateRight(ulong4 value, int rotateAmount)
{
return new ulong4(ulong.RotateRight(value.X, rotateAmount), ulong.RotateRight(value.Y, rotateAmount), ulong.RotateRight(value.Z, rotateAmount), ulong.RotateRight(value.W, rotateAmount));
}
}