This commit is contained in:
Rian Drake 2026-10-15 14:09:11 +13:00
commit b578433e37

View file

@ -0,0 +1,54 @@
// <auto-generated /> - edit Vector.numerics-binary.tt to modify
#nullable enable
namespace Brutal.Numerics;
// IBinaryNumber
public partial struct float2 : IBinaryNumber<float2>
{
/// <summary>Determines if every component of a value is a power of two.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool IBinaryNumber<float2>.IsPow2(float2 value)
{
return float.IsPow2(value.X) && float.IsPow2(value.Y);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static float2 IBitwiseOperators<float2, float2, float2>.operator &(float2 a, float2 b)
{
return Unsafe.BitCast<int2, float2>(Unsafe.BitCast<float2, int2>(a) & Unsafe.BitCast<float2, int2>(b));
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static float2 IBitwiseOperators<float2, float2, float2>.operator |(float2 a, float2 b)
{
return Unsafe.BitCast<int2, float2>(Unsafe.BitCast<float2, int2>(a) | Unsafe.BitCast<float2, int2>(b));
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static float2 IBitwiseOperators<float2, float2, float2>.operator ^(float2 a, float2 b)
{
return Unsafe.BitCast<int2, float2>(Unsafe.BitCast<float2, int2>(a) ^ Unsafe.BitCast<float2, int2>(b));
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static float2 IBitwiseOperators<float2, float2, float2>.operator ~(float2 value)
{
return Unsafe.BitCast<int2, float2>(~Unsafe.BitCast<float2, int2>(value));
}
}
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
public partial struct float2
{
/// <summary>Determines which components of a value are powers of two.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 IsPow2(float2 value)
{
return new bool2(float.IsPow2(value.X), float.IsPow2(value.Y));
}
}