Skip to content

[Arm64] "Move" Intrinsics #35037

Description

@tannergooding
namespace System.Runtime.Intrinsics.Arm
{
    public abstract class AdvSimd
    {
        /// <summary>
        /// Duplicate general-purpose register to vector
        /// For each element result[elem] = value
        /// Corresponds to vector forms of DUP and VDUP
        /// </summary>
        Vector64<byte>    DuplicateToVector64(byte value);
        Vector64<short>   DuplicateToVector64(short value);
        Vector64<int>     DuplicateToVector64(int value);
        Vector64<sbyte>   DuplicateToVector64(sbyte value);
        Vector64<ushort>  DuplicateToVector64(ushort value);
        Vector64<uint>    DuplicateToVector64(uint value);

        Vector128<byte>   DuplicateToVector128(byte value);
        Vector128<short>  DuplicateToVector128(short value);
        Vector128<int>    DuplicateToVector128(int value);
        Vector128<sbyte>  DuplicateToVector128(sbyte value);
        Vector128<ushort> DuplicateToVector128(ushort value);
        Vector128<uint>   DuplicateToVector128(uint value);

        /// <summary>
        /// Duplicate vector element to vector
        /// For each element result[elem] = value[index]
        /// Corresponds to vector forms of DUP and VDUP
        /// </summary>
        Vector64<byte>    DuplicateSelectedScalarToVector64(Vector64<byte> value,     byte index);
        Vector64<short>   DuplicateSelectedScalarToVector64(Vector64<short> value,    byte index);
        Vector64<int>     DuplicateSelectedScalarToVector64(Vector64<int> value,      byte index);
        Vector64<float>   DuplicateSelectedScalarToVector64(Vector64<float> value,    byte index);
        Vector64<sbyte>   DuplicateSelectedScalarToVector64(Vector64<sbyte> value,    byte index);
        Vector64<ushort>  DuplicateSelectedScalarToVector64(Vector64<ushort> value,   byte index);
        Vector64<uint>    DuplicateSelectedScalarToVector64(Vector64<uint> value,     byte index);

        Vector64<byte>    DuplicateSelectedScalarToVector64(Vector128<byte> value,     byte index);
        Vector64<short>   DuplicateSelectedScalarToVector64(Vector128<short> value,    byte index);
        Vector64<int>     DuplicateSelectedScalarToVector64(Vector128<int> value,      byte index);
        Vector64<float>   DuplicateSelectedScalarToVector64(Vector128<float> value,    byte index);
        Vector64<sbyte>   DuplicateSelectedScalarToVector64(Vector128<sbyte> value,    byte index);
        Vector64<ushort>  DuplicateSelectedScalarToVector64(Vector128<ushort> value,   byte index);
        Vector64<uint>    DuplicateSelectedScalarToVector64(Vector128<uint> value,     byte index);

        Vector128<byte>   DuplicateSelectedScalarToVector128(Vector64<byte> value,    byte index);
        Vector128<short>  DuplicateSelectedScalarToVector128(Vector64<short> value,   byte index);
        Vector128<int>    DuplicateSelectedScalarToVector128(Vector64<int> value,     byte index);
        Vector128<float>  DuplicateSelectedScalarToVector128(Vector64<float> value,   byte index);
        Vector128<sbyte>  DuplicateSelectedScalarToVector128(Vector64<sbyte> value,   byte index);
        Vector128<ushort> DuplicateSelectedScalarToVector128(Vector64<ushort> value,  byte index);
        Vector128<uint>   DuplicateSelectedScalarToVector128(Vector64<uint> value,    byte index);

        Vector128<byte>   DuplicateSelectedScalarToVector128(Vector128<byte> value,   byte index);
        Vector128<double> DuplicateSelectedScalarToVector128(Vector128<double> value, byte index);
        Vector128<short>  DuplicateSelectedScalarToVector128(Vector128<short> value,  byte index);
        Vector128<int>    DuplicateSelectedScalarToVector128(Vector128<int> value,    byte index);
        Vector128<long>   DuplicateSelectedScalarToVector128(Vector128<long> value,   byte index);
        Vector128<float>  DuplicateSelectedScalarToVector128(Vector128<float> value,  byte index);
        Vector128<sbyte>  DuplicateSelectedScalarToVector128(Vector128<sbyte> value,  byte index);
        Vector128<ushort> DuplicateSelectedScalarToVector128(Vector128<ushort> value, byte index);
        Vector128<uint>   DuplicateSelectedScalarToVector128(Vector128<uint> value,   byte index);
        Vector128<ulong>  DuplicateSelectedScalarToVector128(Vector128<ulong> value,  byte index);

        public abstract class Arm64
        {
            /// <summary>
            /// Duplicate general-purpose register to vector
            /// For each element result[elem] = value
            /// Corresponds to vector forms of DUP
            /// </summary>
            Vector128<long>   DuplicateToVector64(long value);
            Vector128<ulong>  DuplicateToVector64(ulong value);

            /// <summary>
            /// Insert vector element from another vector element
            /// result[resultIndex] = value[valueIndex]
            /// Corresponds to vector forms of INS
            /// </summary>
            Vector128<byte>   InsertSelectedScalar(Vector128<byte> result,   byte resultIndex, Vector64<byte> value,    byte valueIndex);
            Vector128<short>  InsertSelectedScalar(Vector128<short> result,  byte resultIndex, Vector64<short> value,   byte valueIndex);
            Vector128<int>    InsertSelectedScalar(Vector128<int> result,    byte resultIndex, Vector64<int> value,     byte valueIndex);
            Vector128<float>  InsertSelectedScalar(Vector128<float> result,  byte resultIndex, Vector64<float> value,   byte valueIndex);
            Vector128<sbyte>  InsertSelectedScalar(Vector128<sbyte> result,  byte resultIndex, Vector64<sbyte> value,   byte valueIndex);
            Vector128<ushort> InsertSelectedScalar(Vector128<ushort> result, byte resultIndex, Vector64<ushort> value,  byte valueIndex);
            Vector128<uint>   InsertSelectedScalar(Vector128<uint> result,   byte resultIndex, Vector64<uint> value,    byte valueIndex);

            Vector128<byte>   InsertSelectedScalar(Vector128<byte> result,   byte resultIndex, Vector128<byte> value,   byte valueIndex);
            Vector128<double> InsertSelectedScalar(Vector128<double> result, byte resultIndex, Vector128<double> value, byte valueIndex);
            Vector128<short>  InsertSelectedScalar(Vector128<short> result,  byte resultIndex, Vector128<short> value,  byte valueIndex);
            Vector128<int>    InsertSelectedScalar(Vector128<int> result,    byte resultIndex, Vector128<int> value,    byte valueIndex);
            Vector128<long>   InsertSelectedScalar(Vector128<long> result,   byte resultIndex, Vector128<long> value,   byte valueIndex);
            Vector128<float>  InsertSelectedScalar(Vector128<float> result,  byte resultIndex, Vector128<float> value,  byte valueIndex);
            Vector128<sbyte>  InsertSelectedScalar(Vector128<sbyte> result,  byte resultIndex, Vector128<sbyte> value,  byte valueIndex);
            Vector128<ushort> InsertSelectedScalar(Vector128<ushort> result, byte resultIndex, Vector128<ushort> value, byte valueIndex);
            Vector128<uint>   InsertSelectedScalar(Vector128<uint> result,   byte resultIndex, Vector128<uint> value,   byte valueIndex);
            Vector128<ulong>  InsertSelectedScalar(Vector128<ulong> result,  byte resultIndex, Vector128<ulong> value,  byte valueIndex);
        }
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions