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