Skip to content

Implement support for rotate. #149

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

Merged
merged 2 commits into from
Mar 8, 2016
Merged

Conversation

mbodart
Copy link

@mbodart mbodart commented Oct 22, 2015

Of the integer operations listed in FutureFeatures.md, it seems that bswap and the rotates fall into the camp of popcnt, clz and ctz, in that they are directly supported by current architectures.

This change implements i32 and i64 bswap, rol and ror, along with test cases.

I just noticed a minor name difference, where FutureFeatures.md uses rotl and rotr,
while I used rol and ror. I have no strong preference either way.

Of course, we need agreement as to whether this support is desired.
I'm about to raise this as an issue, and am submitting this PR in support.

@jfbastien
Copy link
Member

(Confirming that @mbodart is part of the CG, representing Intel).

@qwertie
Copy link

qwertie commented Oct 23, 2015

+1 from me... I always wanted a VM with the same basic abilities as my own CPU.

@sunfishcode
Copy link
Member

The corresponding design PR is now merged: WebAssembly/design#462. This PR lgtm, though it just needs a merge conflict resolution.

@mbodart
Copy link
Author

mbodart commented Mar 3, 2016

Just updated ... should be good to go.

Thanks!

@sunfishcode
Copy link
Member

lgtm. thanks!

@ghost
Copy link

ghost commented Mar 3, 2016

@mbodart Could you try git fetch upstream git checkout master git merge upstream/master git checkout bswaprotate git rebase master to clear up the patch. Perhaps also git rebase -i master and squash it into one patch.

@mbodart
Copy link
Author

mbodart commented Mar 3, 2016

Sorry, I'm a relative newbie wrt git, and was just following a pattern in the Pro Git book.
For my education, how is the patch messed up?
Do I need to ensure my fork's master branch has been merged with upstream (and pushed?)
prior to pushing a topic branch update?

Following your instructions, the "git rebase master" needs the same conflict resolution as
my recent update. Will that be problematic?

Please advise, thanks.

@ghost
Copy link

ghost commented Mar 3, 2016

@mbodart I'm no git expert, but the patch mbodart@863f4d4 does not look clean. Github seems to think it's ok to merge, so perhaps it is and @sunfishcode gave it lgtm just as I was posting.

My understand is the conflicts need to be resolved, edit the file, then git add <file> git rebase --continue. When done recheck the patch. Sorry if this is all just noise.

@mbodart
Copy link
Author

mbodart commented Mar 3, 2016

I resolved the conflicts when merging with my local bswaprotate branch.
Perhaps the confusion here is that I left the "Conflicts" file list in the commit message.
I did so just as a reminder that there were conflicts in the merge, albeit resolved.

Thanks for being diligent, but I think we're all set.

@kripken
Copy link
Member

kripken commented Mar 3, 2016

I still see a merge commit in the 3 commits here. It would be nicer to avoid that. You should be able to just do git rebase upstream/master (assuming this repo is called "upstream" in your git remotes) to fix that, and then just push it to your branch (you'll need git push -f [..], a force-push, since the rebase will mean they can't be fast-forwarded).

@mbodart
Copy link
Author

mbodart commented Mar 4, 2016

One more try, hope this works.
I sync'd my fork's master with the spec, then rebased bswaprotate off of my local master.
This seems to have eliminated the merge commit, though there are still two commits.

@kripken
Copy link
Member

kripken commented Mar 4, 2016

If we also want to squash those two commits, rebase -i upstream/master and then putting "s" for squash for the second commit, should do it. But I'm not sure if people prefer it squashed or if there is useful history in the separation.

@rossberg
Copy link
Member

rossberg commented Mar 4, 2016

LGTM, but please make sure to update the description, since this patch no longer contains byteswap.

@sunfishcode sunfishcode changed the title Implement support for byteswap and rotate. Implement support for rotate. Mar 4, 2016
rossberg added a commit that referenced this pull request Mar 8, 2016
Implement support for rotate.
@rossberg rossberg merged commit 67ac626 into WebAssembly:master Mar 8, 2016
@mbodart mbodart deleted the bswaprotate branch March 8, 2016 17:49
Connicpu pushed a commit to Connicpu/wasm-spec that referenced this pull request May 11, 2020
The new names are memory.atomic.notify, memory.atomic.wait32, and
memory.atomic.wait64.

See WebAssembly/threads#145.
Connicpu pushed a commit to Connicpu/wasm-spec that referenced this pull request Jun 7, 2020
Issue WebAssembly/reference-types#69 requires
that `ref.null` instructions include a reference type immediate. This
concept isn't present in the bulk-memory proposal, but the encoding is
(in element segment expressions).

This change updates the binary and text format, but not the syntax. This
is OK for now, since the only reference type allowed here is `funcref`.
ngzhian pushed a commit to ngzhian/spec that referenced this pull request Nov 4, 2021
…bly#149 (WebAssembly#151)

Previously it was not clear what to do when passing an `i32` to, e.g., an `i8x16.splat`: the `i32` has more bits than fit in an `i8` lane. As discussed in WebAssembly#149, this change removes the extra bits (potentially losing information) so that the input parameter will fit in the splatted lanes. If at some point the spec adds support for `i8` and `i16` types, then this change would be unnecessary since the splat signature could be, e.g., `i8x16.splat(x: i8)` and no truncation would be required.
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.

6 participants