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

Fix the handling of UInt128.DivideSlow on big endian platforms #71162

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

tannergooding
Copy link
Member

This resolves #71157

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost assigned tannergooding Jun 22, 2022
@tannergooding
Copy link
Member Author

/azp run runtime-community

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ghost
Copy link

ghost commented Jun 22, 2022

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

Issue Details

This resolves #71157

Author: tannergooding
Assignees: tannergooding
Labels:

area-System.Numerics

Milestone: -

uint* pLeft = stackalloc uint[Size / sizeof(uint)];
quotient.WriteLittleEndianUnsafe(new Span<byte>(pLeft, Size));

Unsafe.WriteUnaligned(ref *(byte*)(pLeft + 0), (uint)(quotient._lower >> 00));
Copy link
Member

@GrabYourPitchforks GrabYourPitchforks Jun 22, 2022

Choose a reason for hiding this comment

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

The WriteUnaligned part seems unnecessary? Just write directly to the uint pointer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah right. I had originally had a different type here and never fixed it. I can fix, but I'd prefer doing that in a follow up so this can make the snap.

@tannergooding
Copy link
Member Author

tannergooding commented Jun 22, 2022

runtime-community failure is unrelated. Failure is with ThreadPoolMinMaxThreadsEventTest and has been failing for a while now.

Logged #71173

@tannergooding tannergooding merged commit ccf1257 into dotnet:main Jun 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2022
@tannergooding tannergooding deleted the fix-71157 branch November 11, 2022 15:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UInt128 division broken on big-endian platforms
2 participants