Skip to content

Conversation

carlossanlop
Copy link
Contributor

@carlossanlop carlossanlop commented Aug 27, 2019

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

@carlossanlop carlossanlop added new-content Indicates PRs that contain new articles waiting-on-reviews Indicates PRs that cannot be merged because of the lack of reviews 🏁 Release: .NET Core 3.0 :checkered_flag: Release: .NET Core 3.0 labels Aug 27, 2019
@carlossanlop carlossanlop added this to the August 2019 milestone Aug 27, 2019
@carlossanlop carlossanlop self-assigned this Aug 27, 2019
@@ -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)
Copy link
Member

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?

Copy link
Contributor Author

@carlossanlop carlossanlop Aug 27, 2019

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@carlossanlop carlossanlop Aug 27, 2019

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.

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?

Copy link
Member

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.

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 />.

Copy link
Contributor

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.

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 only have experience with <br />. I'll use that. I'll make sure all the pre-existing similar summaries have the same fix.

Copy link
Contributor

Choose a reason for hiding this comment

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


## Remarks

The native signature does not exist. We provide this additional overload for completeness.
Copy link
Contributor

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?

Suggested change
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.

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 applied the change. @tannergooding @CarolEidt, if a customer that is familiar with these APIs going to understand remarks like this?

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.
@carlossanlop
Copy link
Contributor Author

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 &#160; entity is rendered correctly as a forced space.
@mairaw @rpetrusha

@rpetrusha
Copy link

If your intention was that the line after the <br/> should be indented because of the non-breaking spaces, @carlossanlop, that didn't work. Perhaps &nbsp?

@carlossanlop
Copy link
Contributor Author

@rpetrusha I tried using &nbsp; but Visual Studio marked that as an error, saying it's an unknown html entity. Let me try with one comment, wait for the build to finish, and see if it works.

__m128i _mm_add_epi8 (__m128i a, __m128i b)
PADDB xmm, xmm/m128
</summary>
<summary>__m128i _mm_add_epi8 (__m128i a, __m128i b)<br />&#160;&#160;&#160;&#160;PADDB xmm, xmm/m128</summary>
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'm going to test &nbsp; here, @rpetrusha.

Suggested change
<summary>__m128i _mm_add_epi8 (__m128i a, __m128i b)<br />&#160;&#160;&#160;&#160;PADDB xmm, xmm/m128</summary>
<summary>__m128i _mm_add_epi8 (__m128i a, __m128i b)<br />&nbsp;&nbsp;&nbsp;&nbsp;PADDB xmm, xmm/m128</summary>

Copy link
Contributor

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?

Copy link
Contributor

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.

carlossanlop and others added 2 commits August 30, 2019 11:27
M:System.Runtime.Intrinsics.X86.Sse2.Add
@carlossanlop
Copy link
Contributor Author

@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.
I even tried accessing one of the review.microsoft.com links, but once I'm there, I cannot navigate to the System.Runtime.Intrinsics namespace because it doesn't exist. Do you know what happened? Should I trigger a new build?

https://opbuildstorageprod.blob.core.windows.net/report/2019%5C9%5C3%5C500c749d-de78-3d4a-00e4-269d599bf9ec%5CPullRequest%5C201909032106139666-3095%5Cworkflow_report.html?sv=2016-05-31&sr=b&sig=VHOHTNpTZ%2Fkywovm6DpQfYIyCSJS9yOBydHPZ40tB94%3D&st=2019-09-03T21%3A47%3A17Z&se=2019-10-04T21%3A52%3A17Z&sp=r

@rpetrusha
Copy link

rpetrusha commented Sep 4, 2019

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.

Copy link

@CarolEidt CarolEidt left a 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?

@carlossanlop
Copy link
Contributor Author

carlossanlop commented Sep 4, 2019

Thanks @rpetrusha for the link.

@mairaw you were absolutely right, even &#160; is being ignored. I wanted to double check myself.

@CarolEidt @tannergooding since I cannot make Docs respect spacing, would you like me to use Maira's suggestion to add the prefix Instruction: at the beginning of every second line? For example:

__m128i _mm_add_epi8 (__m128i a,  __m128i b)
Instruction: PADDB xmm, xmm/m128

Or is this enough for you?:

__m128i _mm_add_epi8 (__m128i a,  __m128i b)
PADDB xmm, xmm/m128

@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 <param> or &#160;.

@CarolEidt
Copy link

Thanks @carlossanlop

I prefer the version without the Instruction: prefix. What do you think @tannergooding ?

@carlossanlop
Copy link
Contributor Author

@CarolEidt I'll use the option without "instruction". It's what we used to have before anyway.

@tannergooding
Copy link
Member

I agree, the version without Instruction is probably better.

@tannergooding
Copy link
Member

@carlossanlop, is this only part of the changes?

There are several xml files that are missing (such as AVX, FMA, SSE3, etc)

@carlossanlop
Copy link
Contributor Author

carlossanlop commented Sep 5, 2019

@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 <param> to existing comments. Since I didn't find any additional triple slash comments to port in the files you just mentioned, I am going to assume you mean I missed adding <param> to certain files. You're correct, I didn't catch them. I only modified files that had comments to be automatically ported, but I can submit another PR fixing those, so we can get the automatically ported comments merged first.

@carlossanlop
Copy link
Contributor Author

@mairaw @rpetrusha I addressed all the comments. If the build passes without warnings, I think we can get this merged.

@carlossanlop carlossanlop added verify-build-before-merge and removed waiting-on-reviews Indicates PRs that cannot be merged because of the lack of reviews labels Sep 5, 2019
@tannergooding
Copy link
Member

@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:

__m128 _mm_add_ps (__m128 a, __m128 b) ADDPS xmm, xmm/m128

into

__m128 _mm_add_ps (__m128 a, __m128 b)
ADDPS xmm, xmm/m128

@carlossanlop
Copy link
Contributor Author

@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:

__m128 _mm_add_ps (__m128 a, __m128 b) ADDPS xmm, xmm/m128

into

__m128 _mm_add_ps (__m128 a, __m128 b)
ADDPS xmm, xmm/m128

Yes, I'm taking care of them in a separate PR to enclose those instructions with param.

@carlossanlop
Copy link
Contributor Author

carlossanlop commented Sep 5, 2019

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.
@nevermind, I was able to cherry-pick my change to a new branch, without adding the files already being modified in this PR. Please take a look: #3125

Copy link

@rpetrusha rpetrusha left a 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?

@carlossanlop
Copy link
Contributor Author

@rpetrusha Yes, please merge it. Thanks!

@mairaw mairaw merged commit e4ae8e2 into dotnet:master Sep 6, 2019
@carlossanlop carlossanlop deleted the Intrinsics branch November 6, 2019 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏁 Release: .NET Core 3.0 :checkered_flag: Release: .NET Core 3.0 new-content Indicates PRs that contain new articles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants