Skip to content

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Dec 26, 2024

No description provided.

@dotnet-policy-service
Copy link
Contributor

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

@EgorBo

This comment was marked as resolved.

Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
Debug.Assert(value <= 99);

Unsafe.CopyBlockUnaligned(
Copy link
Member

Choose a reason for hiding this comment

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

This is basically just doing span.CopyTo, right?

Is the codegen significantly different if we switch to the safe version? Should we log an issue if there's some places that can't be constant folded down here?

Copy link
Member Author

@EgorBo EgorBo Dec 27, 2024

Choose a reason for hiding this comment

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

@tannergooding yep, that was my initial intent, but looks like for that we need to change too many methods from TChar* to Span in Number.Formatting. My initial attempt to do so had a terrible perf impact so I decided to file a general clean up first.

Should we log an issue

I guess we can specifically for this, but it all part of the general issue #94941

Copy link
Member

@tannergooding tannergooding Dec 27, 2024

Choose a reason for hiding this comment

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

The suggestion of logging an issue was mainly for the consideration of if Span.CopyTo was slower than Unsafe.CopyBlockUnaligned, no need for an issue to track the switch to using Span in general I don't think

Is it worth doing new Span(ptr, length).CopyTo(dest, length) in the meantime which should get us slightly better and then we can track the switch to use span everywhere separately?

return false;
}

private static ulong ExtractFractionAndBiasedExponent(double value, out int exponent)
Copy link
Member

Choose a reason for hiding this comment

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

This was all just dead code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep!

@EgorBo EgorBo merged commit 4020e05 into dotnet:main Jan 10, 2025
139 checks passed
@EgorBo EgorBo deleted the cleanup-number-formatting branch January 10, 2025 19:30
grendello added a commit to grendello/runtime that referenced this pull request Jan 13, 2025
* main:
  JIT: Model GT_RETURN kills with contained operand (dotnet#111230)
  Update dependencies from https://github.com/dotnet/runtime-assets build 20250110.2 (dotnet#111290)
  [NativeAOT/ARM64] Generate frames compatible with Apple compact unwinding (dotnet#107766)
  Cleanup unused JIT stubs in vm (dotnet#111237)
  Ensure that Shuffle is marked as HW_Flag_CanBenefitFromConstantProp (dotnet#111303)
  Fix CMP0173 policy warning with cmake 3.31 (dotnet#110522)
  [RISC-V] Fix HostActivation.Tests unknown-rid (dotnet#110687)
  Fix accidentally duplicated global-build-step.yml in runtime-official.yml (dotnet#111302)
  JIT: run extra SPMI queries for arrays (dotnet#111293)
  Split the Runtime Shared Framework project and combine legs in the official build (dotnet#111136)
  Do not ignore `MemoryMarshal.TryWrite` result (dotnet#108661)
  Update dependencies from https://github.com/dotnet/emsdk build 20250109.1 (dotnet#111263)
  Clean up in Number.Formatting.cs (dotnet#110955)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2025
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.

3 participants