Conversation
nomeata
approved these changes
Mar 15, 2019
src/compile.ml
Outdated
| | "btst64" -> compile_kernel_as SR.UnboxedInt64 ( | ||
| let (set_b, get_b) = new_local64 env "b" | ||
| in set_b ^^ compile_const_64 1L ^^ get_b ^^ G.i (Binary (Wasm.Values.I64 I64Op.Shl)) ^^ | ||
| G.i (Binary (Wasm.Values.I64 I64Op.And))) |
Contributor
There was a problem hiding this comment.
At some point I think it would make sense to move the arguments to compile_kernel_as out of compile_exp (which is a pretty central function, and not great if it grows too big) and move them into functions in some appropriate module NumericOps. Same with probably much other code that is currently spread in the AST-related part of the file. But this is not a regression in this PR, so no need to do it here.
Contributor
Author
There was a problem hiding this comment.
Yes, I did some of these in (the latter part of) #245, ideally all of these operations should be one-liners. The moved kernels are UnboxedSmallWord-related, we can move the others too, as need arises.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AST-63 calls for these
btstWord*operations.AST-33 deals with primitive datatypes and their ops.
Do we need further:
bsetWord*,bclrWord*? They are not primitives in WASM, but are non-trivial to get right, esp. forWord8/16. Please comment here or in the AST.