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

motoko-base: Expose new bitops #2335

Merged
merged 52 commits into from
Feb 12, 2021
Merged

motoko-base: Expose new bitops #2335

merged 52 commits into from
Feb 12, 2021

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Feb 10, 2021

Bumps base:

Expose new bit operations on NatN and IntN

this goes along with #2326
(and should not be merged before). It adds new bit operations, wrapping
arithmetic and conversions to IntN and NatN.

Adds Char.fromNat32 so that users can migrate away from Char.fromWord32 already.

Uses wrapping operators on Word types. This avoids deprecation warnings in the upcoming
compiler version.

nomeata and others added 30 commits February 9, 2021 12:34
this extracts, off #2309, the refactoring of `value`, without any
user-visible changes.

This should make reviewing #2309 easier, and also pave the way to
deprecating the word type.

Because this is based off #2309, it includes some changes to the prims.
In particular, the `num_conv_t1_t2` family is now for trapping
conversions, and `num_warp_t1_2` is for wrapping (currently: to Word,
and between fixed types).
Builds on top of #2324, and is extracted from #2324.

Because this should be backwards-compatible, there is still the +>>
operator. Once `WordN` is removed, we only want and need the `>>`
operator (taking the signedness from the type). Until then, `

 * `>>` is unsigned on Nat and Word, and signed on Int.
 * `+>>` is always signed
Co-authored-by: Andreas Rossberg <[email protected]>
as it is slated for removal with WordN
and some knock-on effects for `charToWord32`
Co-authored-by: Claudio Russo <[email protected]>
Co-authored-by: Claudio Russo <[email protected]>
Commit b62a067 on origin/master has the same tree as
commit 3e5959a.
this tests  dfinity/motoko-base#217 against
#2326.

Before this can be merged, #2326 needs to be merged, then
dfinity/motoko-base#217 into `next-moc`, then
this updated to to point to `next-moc`.

But it can be approved already ;-)
@dfinity-ci
Copy link

This PR does not affect the produced WebAssembly code.

Base automatically changed from joachim/new-bit-ops to master February 12, 2021 13:50
@nomeata nomeata added the automerge-squash When ready, merge (using squash) label Feb 12, 2021
@mergify mergify bot merged commit 7e40d93 into master Feb 12, 2021
@mergify mergify bot deleted the joachim/new-bit-ops-base branch February 12, 2021 14:02
@mergify mergify bot removed the automerge-squash When ready, merge (using squash) label Feb 12, 2021
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.

3 participants