Conversation
| end | ||
|
|
||
| private def to_u64_info(base, whitespace, underscore, prefix, strict) | ||
| private def to_u128_info(base, whitespace, underscore, prefix, strict) |
There was a problem hiding this comment.
I'm concerned about all to_i calls having to go through 128bit mathematics: it probably slows down the conversion process on processors without 128bit maths support (i.e. most of them).
I think it's a good idea to duplicate this method, and have both to_u64_info and to_u128_info. This can probably be done quite easily without extra boilerplate with macros.
If only we had a benchmark suite :)
There was a problem hiding this comment.
Yes, I agree. Also two test are failed because I extend to_u64_info method to support 128 bit integer and now they works incorrect with 64 bit.
I will fix it.
| when :u128 | ||
| # TODO: implement String#to_u128 and use it | ||
| @last = int128(node.value.to_u64) | ||
| @last = int128(node.value.to_u128) |
|
Related to #5545 |
|
@omotorin Thank you for this! Some things:
|
|
@omotorin Are you willing to continue? |
|
Closing stale PR. Int128 support is tracked in #8373 |
I found some bugs in implementation of int128. It related with LLVMConstInt that works only with 64 bit integer and 128 bit will always cut to 64 bit. Also I've implemented to_int128/to_uint128 that needed to correct works codegen for 128 bit integer