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/uint3/uint3.numerics-binary.gen.cs
Normal file
100
Brutal.Numerics/Vector/uint3/uint3.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 uint3 : IBinaryNumber<uint3>
|
||||
{
|
||||
/// <summary>Determines if every component of a value is a power of two.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static bool IBinaryNumber<uint3>.IsPow2(uint3 value)
|
||||
{
|
||||
return uint.IsPow2(value.X) && uint.IsPow2(value.Y) && uint.IsPow2(value.Z);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 Log2(uint3 value)
|
||||
{
|
||||
return new uint3(uint.Log2(value.X), uint.Log2(value.Y), uint.Log2(value.Z));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 operator &(uint3 a, uint3 b)
|
||||
{
|
||||
return new(a.X & b.X, a.Y & b.Y, a.Z & b.Z);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 operator |(uint3 a, uint3 b)
|
||||
{
|
||||
return new(a.X | b.X, a.Y | b.Y, a.Z | b.Z);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 operator ^(uint3 a, uint3 b)
|
||||
{
|
||||
return new(a.X ^ b.X, a.Y ^ b.Y, a.Z ^ b.Z);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 operator ~(uint3 value)
|
||||
{
|
||||
return new(~value.X, ~value.Y, ~value.Z);
|
||||
}
|
||||
}
|
||||
|
||||
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
|
||||
public partial struct uint3
|
||||
{
|
||||
/// <summary>Determines which components of a value are powers of two.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool3 IsPow2(uint3 value)
|
||||
{
|
||||
return new bool3(uint.IsPow2(value.X), uint.IsPow2(value.Y), uint.IsPow2(value.Z));
|
||||
}
|
||||
}
|
||||
|
||||
// the good bits from IBinaryInteger - declared on IIntegerVector
|
||||
public partial struct uint3
|
||||
{
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.PopCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 PopCount(uint3 value)
|
||||
{
|
||||
return new uint3(uint.PopCount(value.X), uint.PopCount(value.Y), uint.PopCount(value.Z));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.LeadingZeroCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 LeadingZeroCount(uint3 value)
|
||||
{
|
||||
return new uint3(uint.LeadingZeroCount(value.X), uint.LeadingZeroCount(value.Y), uint.LeadingZeroCount(value.Z));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.TrailingZeroCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 TrailingZeroCount(uint3 value)
|
||||
{
|
||||
return new uint3(uint.TrailingZeroCount(value.X), uint.TrailingZeroCount(value.Y), uint.TrailingZeroCount(value.Z));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateLeft" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 RotateLeft(uint3 value, int rotateAmount)
|
||||
{
|
||||
return new uint3(uint.RotateLeft(value.X, rotateAmount), uint.RotateLeft(value.Y, rotateAmount), uint.RotateLeft(value.Z, rotateAmount));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateRight" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint3 RotateRight(uint3 value, int rotateAmount)
|
||||
{
|
||||
return new uint3(uint.RotateRight(value.X, rotateAmount), uint.RotateRight(value.Y, rotateAmount), uint.RotateRight(value.Z, rotateAmount));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue