-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Automatically port System.Runtime.Intrinsics.X86 triple slash comments #3095
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
Conversation
@@ -3642,7 +3652,10 @@ | |||
</Parameters> | |||
<Docs> | |||
<param name="value">To be added.</param> | |||
<summary>To be added.</summary> | |||
<summary> | |||
__m256i _mm256_cvtepu8_epi16 (__m128i a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this render as two separate lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, but if you look at other pre-existing summaries in this file, they have the exact same format: an endline at the beginning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, Docs doesn't seem to respect the endline in the middle. Take Avx.ConvertToVector256Int32 for example:
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.intrinsics.x86.avx.converttovector256int32?view=netcore-3.0#System_Runtime_Intrinsics_X86_Avx_ConvertToVector256Int32_System_Runtime_Intrinsics_Vector256_System_Single__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I was assuming you were talking about lines 3655 and 3656, but the problem applies for both cases I mentioned above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's unfortunate; is there a way to ensure that the newline is retained?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking for this case in particular. Ideally it would render as two separate lines; since the native instruction (second line) and the C++ intrinsic (first line) should be differentiated here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two things to try:
- Add two spaces in first line, before the line break.
- If that doesn't work, use an HTML tag, either
<br/>
or<p />
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need <para> tags to render as two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have experience with <br />
. I'll use that. I'll make sure all the pre-existing similar summaries have the same fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did an example here: ea2cac4
|
||
## Remarks | ||
|
||
The native signature does not exist. We provide this additional overload for completeness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion to remove we from the sentence. If accepted, should be applied everywhere.
Also, will customers know what this means?
The native signature does not exist. We provide this additional overload for completeness. | |
The native signature doesn't exist. This additional overload is provided for completeness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied the change. @tannergooding @CarolEidt, if a customer that is familiar with these APIs going to understand remarks like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe they will. The point is that, while most of these map to "native" C++ intrinsics, some do not. For example, these take an address (pointer), since the instruction supports an in-memory operand. The C++ intrinsics don't provide those as distinct overloads.
…to remarks or exception, depending on each case.
8bc5d6b
to
a63a0f5
Compare
Alright I got all the summaries and remarks fixed. This was... fun. Can you please take a look? I'd like to wait for the build to finish to ensure the |
If your intention was that the line after the |
@rpetrusha I tried using |
__m128i _mm_add_epi8 (__m128i a, __m128i b) | ||
PADDB xmm, xmm/m128 | ||
</summary> | ||
<summary>__m128i _mm_add_epi8 (__m128i a, __m128i b)<br />    PADDB xmm, xmm/m128</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to test
here, @rpetrusha.
<summary>__m128i _mm_add_epi8 (__m128i a, __m128i b)<br />    PADDB xmm, xmm/m128</summary> | |
<summary>__m128i _mm_add_epi8 (__m128i a, __m128i b)<br /> PADDB xmm, xmm/m128</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces will be ignored. Can we say instead Instruction: on the beginning of the 2nd line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd use <para>
instead of <br>
tags to make sure this will render as expected in VS. We'd have to test how
tags would be converted in the IntelliSense files and in VS.
M:System.Runtime.Intrinsics.X86.Sse2.Add
@mairaw @rpetrusha although the build passed without warnings from the files I edited in this PR, there was no preview hyperlink for any of them. |
Here is a link to the System.Runtime.Intrinsics.X86 namespace. All of the types included in the PR are accessible from it. I suspect that the difficulty you're having is with the version selector, @carlossanlop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable. I only looked at a sampling of the output at docs.microsoft.com, but it looks good to me.
Can you help me understand how this works? Are these now being auto-generated from the triple-slash comments in the code, and somehow the tool doing that has been adapted to insert the appropriate spaces and para
elements?
Thanks @rpetrusha for the link. @mairaw you were absolutely right, even @CarolEidt @tannergooding since I cannot make Docs respect spacing, would you like me to use Maira's suggestion to add the prefix
Or is this enough for you?:
@CarolEidt to answer your question: I ported the triple slash comments with my tool, then used a bunch of regular expressions in Visual Studio to substitute all the summaries in bulk and include |
Thanks @carlossanlop I prefer the version without the |
@CarolEidt I'll use the option without "instruction". It's what we used to have before anyway. |
I agree, the version without Instruction is probably better. |
@carlossanlop, is this only part of the changes? There are several xml files that are missing (such as AVX, FMA, SSE3, etc) |
@tannergooding I am not sure if you mean that I missed to port triple slash comments or if I missed adding |
@mairaw @rpetrusha I addressed all the comments. If the build passes without warnings, I think we can get this merged. |
@carlossanlop, I meant that there are 5 files being modified in this PR; but more like 24 files that contain the intrinsic documentation. The other 19 files don't have some of the fixes being made in this PR; such as breaking up:
into
|
Yes, I'm taking care of them in a separate PR to enclose those instructions with param. |
I have the PR ready for the rest of the files, @tannergooding, but that branch's parent is this one (I wanted to avoid duplicating changes when I bulk replaced with regex). So I'll wait for this PR to get merged, rebase that new branch to master, and then submit the new PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, I think. If you're satisfied with it, is it ready to merge, @carlossanlop?
@rpetrusha Yes, please merge it. Thanks! |
This documentation is special. As discussed internally with @tannergooding and @CarolEidt , we want to port this documentation as is.
It will be useful for people already familiar with the instructions themselves or with the C++ intrinsics.
Here is the link to the System.Runtime.Intrinsics namespace documentation in our private build: https://review.docs.microsoft.com/en-us/dotnet/api/system.runtime.intrinsics.x86?view=netcore-3.0&branch=pr-en-us-3095