-
Notifications
You must be signed in to change notification settings - Fork 451
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
arithmetic: Add Ctz function #7
Conversation
First OCaml code ever written so this needs proper review. I've tested the functionality but I am not sure if this is actually a good patch. |
@@ -50,7 +52,14 @@ struct | |||
| Abs -> Int.abs | |||
| Not -> Int.lognot | |||
| Clz -> fun i -> i (* TODO *) | |||
| Ctz -> fun i -> i (* TODO *) | |||
| Ctz -> fun i -> | |||
if Int.to_int i == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
is physical equality in OCaml, you want =
. Also, could say i = Int.zero
instead, which is shorter.
This is cool. Is there a way we can write a test for ctz while adding this code? |
@sunfishcode I was hoping (myself soon or others if they go first) to add an "assert" |
@eminemix can you please join the WebAssembly Community Group? I can't find your name in the list. This is required for significant contributions to WebAssembly. |
Sent v2. @sunfishcode, @lukewagner @jfbastien |
Thanks for the patch. Please let me know when you have joined the Community Group, and I will merge your PR. |
Signed-off-by: Valentin Ilie <valentin.ilie@intel.com>
This PR cannot be merged due to the issue pointed out by jfbastien. This implementation may appear as part of other PRs where the author complies with the repo guidelines. |
Merge with function-references
Add a references section with useful links
Includes changes for bulk memory instructions and memory abbreviations. See WebAssembly/memory64#5 and WebAssembly/memory64#6.
Signed-off-by: Valentin Ilie valentin.ilie@intel.com