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

Unsigned types improvements #3375

Merged

Conversation

WojciechMazur
Copy link
Contributor

  • Introduce small unsigned integer caching for unsigned types (UByte, UShort, UInt, ULong, USize)
  • Use caching for .toUnsigned conversions
  • Add intrinsic unsignedOf operation - ensures a given value would be directly wrapped into Op.Box instead of multiple method calls (2xOp.Module + 2xOp.Method + 2xOp.Calls) we now emit single Op.Box. It would be used to implement toUnsigned conversion
  • Implement toUnsigned operations as inlined extensions in Scala3. Keep the UnsignedRich* implicit classes in shared scala 2/3 sources, as they have lower priority, but allows to keep cross building source-compatiblity if importing each implicit class directly

@WojciechMazur WojciechMazur merged commit f88d789 into scala-native:main Jul 5, 2023
77 checks passed
@WojciechMazur WojciechMazur deleted the feature/unsigned-improvements branch July 5, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant