Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API Proposal]: Arm64: FEAT_SVE: loads pt 2 #97831

Open
tannergooding opened this issue Feb 1, 2024 · 4 comments
Open

[API Proposal]: Arm64: FEAT_SVE: loads pt 2 #97831

tannergooding opened this issue Feb 1, 2024 · 4 comments
Labels
api-approved API was approved in API review, it can be implemented area-System.Runtime.Intrinsics

Comments

@tannergooding
Copy link
Member

tannergooding commented Feb 1, 2024

Continuing from #94006

namespace System.Runtime.Intrinsics.Arm

/// VectorT Summary
public abstract class Sve : AdvSimd /// Feature: FEAT_SVE  Category: loads
{
    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>) LoadVectorx2(Vector<T> mask, T* address); // LD2W or LD2D or LD2B or LD2H

    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>, Vector<T>) LoadVectorx3(Vector<T> mask, T* address); // LD3W or LD3D or LD3B or LD3H

    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>, Vector<T>, Vector<T>) LoadVectorx4(Vector<T> mask, T* address); // LD4W or LD4D or LD4B or LD4H

    /// T: byte, sbyte
    public static unsafe void Prefetch8Bit(Vector<T> mask, void* address, SvePrefetchType op); // PRFB

    /// T: short, ushort
    public static unsafe void Prefetch16Bit(Vector<T> mask, void* address, SvePrefetchType op); // PRFH

    /// T: int, uint
    public static unsafe void Prefetch32Bit(Vector<T> mask, void* address, SvePrefetchType op); // PRFW

    /// T: long, ulong
    public static unsafe void Prefetch64Bit(Vector<T> mask, void* address, SvePrefetchType op); // PRFD
}
@tannergooding tannergooding added area-System.Runtime.Intrinsics api-ready-for-review API is ready for review, it is NOT ready for implementation labels Feb 1, 2024
@ghost
Copy link

ghost commented Feb 1, 2024

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

Issue Details

Continuing from #94006

namespace System.Runtime.Intrinsics.Arm

/// VectorT Summary
public abstract class Sve : AdvSimd /// Feature: FEAT_SVE  Category: loads
{
    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>) LoadVectorx2(Vector<T> mask, const T *base); // LD2W or LD2D or LD2B or LD2H

    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>, Vector<T>) LoadVectorx3(Vector<T> mask, const T *base); // LD3W or LD3D or LD3B or LD3H

    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>, Vector<T>, Vector<T>) LoadVectorx4(Vector<T> mask, const T *base); // LD4W or LD4D or LD4B or LD4H

    public static unsafe void PrefetchBytes(Vector<byte> mask, const void *base, enum SvePrefetchType op); // PRFB

    public static unsafe void PrefetchInt16(Vector<ushort> mask, const void *base, enum SvePrefetchType op); // PRFH

    public static unsafe void PrefetchInt32(Vector<uint> mask, const void *base, enum SvePrefetchType op); // PRFW

    public static unsafe void PrefetchInt64(Vector<ulong> mask, const void *base, enum SvePrefetchType op); // PRFD
}
Author: tannergooding
Assignees: -
Labels:

area-System.Runtime.Intrinsics, api-ready-for-review

Milestone: -

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 1, 2024
@tannergooding tannergooding removed the untriaged New issue has not been triaged by the area owner label Feb 1, 2024
@bartonjs
Copy link
Member

bartonjs commented Feb 8, 2024

Video

  • LoadVectorx2 (et al) is now Load2xVector (et al)
    • There are already-checked-in, but not released, LoadVector128x2 and friends that should be updated to match this new pattern
  • SvePrefetchType op => [ConstantExpected] SvePrefetchType prefetchType
namespace System.Runtime.Intrinsics.Arm;

/// VectorT Summary
public abstract class Sve : AdvSimd /// Feature: FEAT_SVE  Category: loads
{
    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>) Load2xVector(Vector<T> mask, const T *address); // LD2W or LD2D or LD2B or LD2H

    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>, Vector<T>) Load3xVector(Vector<T> mask, const T *address); // LD3W or LD3D or LD3B or LD3H

    /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
    public static unsafe (Vector<T>, Vector<T>, Vector<T>, Vector<T>) Load4xVector(Vector<T> mask, const T *address); // LD4W or LD4D or LD4B or LD4H

    /// T: byte, sbyte
    public static unsafe void Prefetch8Bit(Vector<T> mask, void *address, [ConstantExpected] SvePrefetchType prefetchType); // PRFB

    /// T: short, ushort
    public static unsafe void Prefetch16Bit(Vector<T> mask, void *address, [ConstantExpected] SvePrefetchType prefetchType); // PRFH

    /// T: int, uint
    public static unsafe void Prefetch32Bit(Vector<T> mask, void *address, [ConstantExpected] SvePrefetchType prefetchType); // PRFW

    /// T: long, ulong
    public static unsafe void Prefetch64Bit(Vector<T> mask, void *address, [ConstantExpected] SvePrefetchType prefetchType); // PRFD
}

@bartonjs bartonjs added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Feb 8, 2024
@KennethHoff
Copy link

KennethHoff commented Feb 9, 2024

I realize this is approved, but while watching the video, I thought of this. Is there a reason this was not considered? This follows the naming convention of {num1}x{num2}, but maybe {num1} does not relate to 1

namespace System.Runtime.Intrinsics.Arm;

public abstract class Sve : AdvSimd
{
-    public static unsafe (Vector<T>, Vector<T>) Load2xVector(Vector<T> mask, const T *address);
+    public static unsafe (Vector<T>, Vector<T>) LoadVector1x2(Vector<T> mask, const T *address);

-    public static unsafe (Vector<T>, Vector<T>, Vector<T>) Load3xVector(Vector<T> mask, const T *address);
+    public static unsafe (Vector<T>, Vector<T>, Vector<T>) LoadVector1x3(Vector<T> mask, const T *address);

-    public static unsafe (Vector<T>, Vector<T>, Vector<T>, Vector<T>) Load4xVector(Vector<T> mask, const T *address)
+    public static unsafe (Vector<T>, Vector<T>, Vector<T>, Vector<T>) LoadVector1x4(Vector<T> mask, const T *address)
}

@tannergooding
Copy link
Member Author

tannergooding commented Feb 9, 2024

Vector1 is too confusing due to the existence of Vector2/3/4 (number of elements) and Vector64/128/256/512 (number of bits).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved API was approved in API review, it can be implemented area-System.Runtime.Intrinsics
Projects
None yet
Development

No branches or pull requests

3 participants