mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08: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/long4/long4.numerics-binary.gen.cs
Normal file
100
Brutal.Numerics/Vector/long4/long4.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 long4 : IBinaryNumber<long4>
|
||||
{
|
||||
/// <summary>Determines if every component of a value is a power of two.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
static bool IBinaryNumber<long4>.IsPow2(long4 value)
|
||||
{
|
||||
return long.IsPow2(value.X) && long.IsPow2(value.Y) && long.IsPow2(value.Z) && long.IsPow2(value.W);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 Log2(long4 value)
|
||||
{
|
||||
return new long4(long.Log2(value.X), long.Log2(value.Y), long.Log2(value.Z), long.Log2(value.W));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 operator &(long4 a, long4 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 long4 operator |(long4 a, long4 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 long4 operator ^(long4 a, long4 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 long4 operator ~(long4 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 long4
|
||||
{
|
||||
/// <summary>Determines which components of a value are powers of two.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool4 IsPow2(long4 value)
|
||||
{
|
||||
return new bool4(long.IsPow2(value.X), long.IsPow2(value.Y), long.IsPow2(value.Z), long.IsPow2(value.W));
|
||||
}
|
||||
}
|
||||
|
||||
// the good bits from IBinaryInteger - declared on IIntegerVector
|
||||
public partial struct long4
|
||||
{
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.PopCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 PopCount(long4 value)
|
||||
{
|
||||
return new long4(long.PopCount(value.X), long.PopCount(value.Y), long.PopCount(value.Z), long.PopCount(value.W));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.LeadingZeroCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 LeadingZeroCount(long4 value)
|
||||
{
|
||||
return new long4(long.LeadingZeroCount(value.X), long.LeadingZeroCount(value.Y), long.LeadingZeroCount(value.Z), long.LeadingZeroCount(value.W));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.TrailingZeroCount" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 TrailingZeroCount(long4 value)
|
||||
{
|
||||
return new long4(long.TrailingZeroCount(value.X), long.TrailingZeroCount(value.Y), long.TrailingZeroCount(value.Z), long.TrailingZeroCount(value.W));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateLeft" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 RotateLeft(long4 value, int rotateAmount)
|
||||
{
|
||||
return new long4(long.RotateLeft(value.X, rotateAmount), long.RotateLeft(value.Y, rotateAmount), long.RotateLeft(value.Z, rotateAmount), long.RotateLeft(value.W, rotateAmount));
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IBinaryInteger{TSelf}.RotateRight" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static long4 RotateRight(long4 value, int rotateAmount)
|
||||
{
|
||||
return new long4(long.RotateRight(value.X, rotateAmount), long.RotateRight(value.Y, rotateAmount), long.RotateRight(value.Z, rotateAmount), long.RotateRight(value.W, rotateAmount));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue