Skip to content

Port System.Runtime.Intrinsics new docs #10155

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

Closed

Conversation

carlossanlop
Copy link
Contributor

@dotnet/area-system-runtime-intrinsics @directhex @gewarren PTAL

This comment was marked as outdated.

@@ -40,7 +40,7 @@
<Docs>
<param name="upper">To be added.</param>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<summary>__m128d _mm_cvtsi64_sd (__m128d a, __int64 b) VCVTUSI2SD xmm1, xmm2, r/m64 This intrinsic is only available on 64-bit processes</summary>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should "This intrinsic is only available on 64-bit processes" be in the remarks instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a lot of missing newlines or <para> separators in these as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tannergooding I don't see the comments in triple slash split by <para>.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're split by newline in the triple slash, which I don't think has been an issue with the other intrinsic docs; unless we manually fixed those all up in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a bug in the tool. I was expecting it to split new lines using <para>. I fixed it manually. Can you please take another look?

@dotnet-policy-service dotnet-policy-service bot added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 26, 2024
@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Aug 5, 2024
Copy link

Learn Build status updates of commit 91fc144:

✅ Validation status: passed

File Status Preview URL Details
xml/System.Runtime.Intrinsics.Arm/AdvSimd.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.Arm/AdvSimd+Arm64.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.Arm/Sve.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.Arm/SveMaskPattern.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.Arm/SvePrefetchType.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx10v1.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx10v1+V512.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx10v1+X64.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx512DQ.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx512F.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx512F+X64.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx512Vbmi.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Avx512Vbmi+VL.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/AvxVnni.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/FloatRoundingMode.xml ✅Succeeded View
xml/System.Runtime.Intrinsics.X86/Sse41.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector128.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector128`1.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector256.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector256`1.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector512.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector512`1.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector64.xml ✅Succeeded View
xml/System.Runtime.Intrinsics/Vector64`1.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@carlossanlop
Copy link
Contributor Author

@tannergooding @gewarren bad news: The compiler generated xmls do not preserve the type in generic types. For example:

https://github.com/dotnet/runtime/blob/50d6cad649aad2bfa4069268eddd16fd51ec5cf3/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs#L348-L353C44

        /// <summary>Converts a <see cref="Vector64{Single}" /> to a <see cref="Vector64{Int32}" /> using platform specific behavior on overflow.</summary>
        /// <param name="vector">The vector to convert.</param>
        /// <returns>The converted vector.</returns>
        [Intrinsic]
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static unsafe Vector64<int> ConvertToInt32Native(Vector64<float> vector)

When built, shows the following output under D:\runtime\artifacts\bin\coreclr\windows.x64.Release\IL\System.Private.CoreLib.xml:

        <member name="M:System.Runtime.Intrinsics.Vector128.ConvertToInt32Native(System.Runtime.Intrinsics.Vector128{System.Single})">
            <summary>Converts a <see cref="T:System.Runtime.Intrinsics.Vector128`1" /> to a <see cref="T:System.Runtime.Intrinsics.Vector128`1" /> platform specific behavior on overflow.</summary>
            <param name="vector">The vector to convert.</param>
            <returns>The converted vector.</returns>
        </member>

So our options are:

  • Live with it.
  • Fix them manually here (very labor intensive).
  • Find a way to indicate the <see crefs> in triple slash comments that will preserve the typed generic argument. I suspect it might be possible, because as you can see, the DocId preserved the typed generic argument, but the comments did not.

@tannergooding
Copy link
Member

Find a way to indicate the in triple slash comments that will preserve the typed generic argument. I suspect it might be possible, because as you can see, the DocId preserved the typed generic argument, but the comments did not.

If there's a preferred way to state it instead of <see cref="Vector64{Single}" /> then it should be possible to do a find/replace here to fix it up on the XML doc comment side.

Perhaps <see cref="Vector64{T}" /> of <see cref="Single" /> or similar would be sufficient?

@tannergooding
Copy link
Member

Would appreciate weigh-in from @gewarren on the preferred way for this to be "displayed" or otherwise surfaced for the docs page side of things, and then I can automate the replacement

For returns and similar, we do: Vector128<Int32>

Where the first links to the Vector128<T>

So if there were maybe something like <see cref="Vector64{T}" />&lt;<see cref="Single" />&gt;, but with something to have the first part show as just Vector64 and not as Vector64<T>

@gewarren
Copy link
Contributor

Would appreciate weigh-in from @gewarren on the preferred way for this to be "displayed" or otherwise surfaced for the docs page side of things, and then I can automate the replacement

My preference would just be use code tags or langword instead of see cref. E.g.:

Converts a <see langword="Vector64<Single>" /> to ...

@carlossanlop
Copy link
Contributor Author

and then I can automate the replacement

Thank you so much, @tannergooding. It's really frustrating that the intellisense xmls do not respect it when they're generated.

@gewarren
Copy link
Contributor

Closing in favor of #10275.

@gewarren gewarren closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants