mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
210 lines
5.9 KiB
C#
210 lines
5.9 KiB
C#
// <auto-generated /> - edit Vector.pack.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
public partial struct int4
|
|
{
|
|
public static int4 Unpack(in sbyte4 vector, Func<sbyte, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Unpack(in byte4 vector, Func<byte, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Unpack(in short4 vector, Func<short, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Unpack(in ushort4 vector, Func<ushort, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Pack(in uint4 vector, Func<uint, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Pack(in float4 vector, Func<float, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Pack(in double4 vector, Func<double, int> elementConverter)
|
|
{
|
|
VectorPack.Pack(vector, out int4 result, elementConverter);
|
|
return result;
|
|
}
|
|
|
|
public static int4 Unpack(in sbyte4 vector, Unpack.Integer mode = Numerics.Unpack.Integer.Cast)
|
|
{
|
|
return Unpack(vector, PackUtils.SByte.ToInt(mode));
|
|
}
|
|
|
|
public static int4 Unpack(in byte4 vector, Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast)
|
|
{
|
|
return Unpack(vector, PackUtils.Byte.ToInt(mode));
|
|
}
|
|
|
|
public static int4 Unpack(in short4 vector, Unpack.Integer mode = Numerics.Unpack.Integer.Cast)
|
|
{
|
|
return Unpack(vector, PackUtils.Short.ToInt(mode));
|
|
}
|
|
|
|
public static int4 Unpack(in ushort4 vector, Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast)
|
|
{
|
|
return Unpack(vector, PackUtils.UShort.ToInt(mode));
|
|
}
|
|
|
|
public static int4 Pack(in uint4 vector, Pack.IntegerMixed mode = Numerics.Pack.IntegerMixed.Cast)
|
|
{
|
|
return Pack(vector, PackUtils.UInt.ToInt(mode));
|
|
}
|
|
|
|
public static int4 Pack(in float4 vector, Pack.Float mode = Numerics.Pack.Float.Truncate)
|
|
{
|
|
return Pack(vector, PackUtils.Float.ToInt(mode));
|
|
}
|
|
|
|
public static int4 Pack(in double4 vector, Pack.Float mode = Numerics.Pack.Float.Truncate)
|
|
{
|
|
return Pack(vector, PackUtils.Double.ToInt(mode));
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<sbyte4> source,
|
|
Span<int4> destination,
|
|
Func<sbyte, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<byte4> source,
|
|
Span<int4> destination,
|
|
Func<byte, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<short4> source,
|
|
Span<int4> destination,
|
|
Func<short, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<ushort4> source,
|
|
Span<int4> destination,
|
|
Func<ushort, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void PackSpan(
|
|
in ReadOnlySpan<uint4> source,
|
|
Span<int4> destination,
|
|
Func<uint, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void PackSpan(
|
|
in ReadOnlySpan<float4> source,
|
|
Span<int4> destination,
|
|
Func<float, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void PackSpan(
|
|
in ReadOnlySpan<double4> source,
|
|
Span<int4> destination,
|
|
Func<double, int> elementConverter
|
|
)
|
|
{
|
|
VectorPack.Pack(source, destination, elementConverter);
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<sbyte4> source,
|
|
Span<int4> destination,
|
|
Unpack.Integer mode = Numerics.Unpack.Integer.Cast
|
|
)
|
|
{
|
|
UnpackSpan(source, destination, PackUtils.SByte.ToInt(mode));
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<byte4> source,
|
|
Span<int4> destination,
|
|
Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast
|
|
)
|
|
{
|
|
UnpackSpan(source, destination, PackUtils.Byte.ToInt(mode));
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<short4> source,
|
|
Span<int4> destination,
|
|
Unpack.Integer mode = Numerics.Unpack.Integer.Cast
|
|
)
|
|
{
|
|
UnpackSpan(source, destination, PackUtils.Short.ToInt(mode));
|
|
}
|
|
|
|
public static void UnpackSpan(
|
|
in ReadOnlySpan<ushort4> source,
|
|
Span<int4> destination,
|
|
Unpack.IntegerMixed mode = Numerics.Unpack.IntegerMixed.Cast
|
|
)
|
|
{
|
|
UnpackSpan(source, destination, PackUtils.UShort.ToInt(mode));
|
|
}
|
|
|
|
public static void PackSpan(
|
|
in ReadOnlySpan<uint4> source,
|
|
Span<int4> destination,
|
|
Pack.IntegerMixed mode = Numerics.Pack.IntegerMixed.Cast
|
|
)
|
|
{
|
|
PackSpan(source, destination, PackUtils.UInt.ToInt(mode));
|
|
}
|
|
|
|
public static void PackSpan(
|
|
in ReadOnlySpan<float4> source,
|
|
Span<int4> destination,
|
|
Pack.Float mode = Numerics.Pack.Float.Truncate
|
|
)
|
|
{
|
|
PackSpan(source, destination, PackUtils.Float.ToInt(mode));
|
|
}
|
|
|
|
public static void PackSpan(
|
|
in ReadOnlySpan<double4> source,
|
|
Span<int4> destination,
|
|
Pack.Float mode = Numerics.Pack.Float.Truncate
|
|
)
|
|
{
|
|
PackSpan(source, destination, PackUtils.Double.ToInt(mode));
|
|
}
|
|
}
|