mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 12:38:24 +01:00
54 lines
2 KiB
C#
54 lines
2 KiB
C#
// <auto-generated /> - edit Vector.numerics-binary.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
// IBinaryNumber
|
|
public partial struct double2 : IBinaryNumber<double2>
|
|
{
|
|
/// <summary>Determines if every component of a value is a power of two.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool IBinaryNumber<double2>.IsPow2(double2 value)
|
|
{
|
|
return double.IsPow2(value.X) && double.IsPow2(value.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double2 IBitwiseOperators<double2, double2, double2>.operator &(double2 a, double2 b)
|
|
{
|
|
return Unsafe.BitCast<long2, double2>(Unsafe.BitCast<double2, long2>(a) & Unsafe.BitCast<double2, long2>(b));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double2 IBitwiseOperators<double2, double2, double2>.operator |(double2 a, double2 b)
|
|
{
|
|
return Unsafe.BitCast<long2, double2>(Unsafe.BitCast<double2, long2>(a) | Unsafe.BitCast<double2, long2>(b));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double2 IBitwiseOperators<double2, double2, double2>.operator ^(double2 a, double2 b)
|
|
{
|
|
return Unsafe.BitCast<long2, double2>(Unsafe.BitCast<double2, long2>(a) ^ Unsafe.BitCast<double2, long2>(b));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static double2 IBitwiseOperators<double2, double2, double2>.operator ~(double2 value)
|
|
{
|
|
return Unsafe.BitCast<long2, double2>(~Unsafe.BitCast<double2, long2>(value));
|
|
}
|
|
}
|
|
|
|
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
|
|
public partial struct double2
|
|
{
|
|
/// <summary>Determines which components of a value are powers of two.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsPow2(double2 value)
|
|
{
|
|
return new bool2(double.IsPow2(value.X), double.IsPow2(value.Y));
|
|
}
|
|
}
|