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

Add support for Int128 in codegen and macros #11576

Conversation

BlobCodes
Copy link
Contributor

@BlobCodes BlobCodes commented Dec 12, 2021

This PR adds:

  • Ability to use U/Int128 in macros
  • MathInterpreter U/Int128 support (for ENUMs and compile-time interpreted generics)
  • U/Int128 LLVM inlining (probably improves performance?)

Things that still need to be addressed:

  • The macro to_i method always converts a string to a int64, and then casts it to a int32. integers greater than Int64::MAX return an error "(number) is not an integer", while integers greater than Int32::MAX but smaller than or equal Int64::MAX return an error "Invalid Int32: (number).
  • Crystal::Call#convert_numeric_argument does not seem to support int128, but I don't know what it is used for.

Probably requires #11551 to pass compiler specs on windows.

@oprypin

This comment has been minimized.

@watzon
Copy link
Contributor

watzon commented Jan 18, 2022

Seems like the only failing specs currently are in the interpreter due to a missing Syscall::GRND_NONBLOCK. Does this still seem related?

@straight-shoota straight-shoota added this to the 1.4.0 milestone Jan 28, 2022
@straight-shoota straight-shoota changed the title Add codegen int128 support Add support for Int128 in codegen and macros Jan 29, 2022
@straight-shoota straight-shoota merged commit 0e99a55 into crystal-lang:master Jan 29, 2022
@BlobCodes BlobCodes deleted the feature/codegen-int128-inline-support branch January 29, 2022 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants