Skip to content

Sync the integer unary operators with AstSemantics.md.#44

Merged
sunfishcode merged 1 commit intomasterfrom
integer-unary
Sep 3, 2015
Merged

Sync the integer unary operators with AstSemantics.md.#44
sunfishcode merged 1 commit intomasterfrom
integer-unary

Conversation

@sunfishcode
Copy link
Member

AstSemantics.md presently has no integer neg, abs, or not operators. It
does have a popcnt operator.

@rossberg
Copy link
Member

rossberg commented Sep 2, 2015

LGTM, but I am rather confused why we have neg & abs for floats but not for ints. What's the motivation?

@kg
Copy link
Contributor

kg commented Sep 2, 2015

Same question. Shouldn't we just add int neg/abs/not to astsemantics? Is there a reason to omit them? All three seem useful and common

@jfbastien
Copy link
Member

The FP operations cannot be emulated with other FP operations (though they technically can be with integer operations and a healthy assumption that sign is MSB).

The int operations are redundant, and we've gone back and forth on which should be in the IR and which shouldn't.

@sunfishcode
Copy link
Member Author

We discussed integer abs at one point -- it's interesting because the alternative reads the operand twice, which blocks single-use expression tree formation, but there was concern with the overall number of opcodes. I did add it as a possible future feature though.

@jfbastien
Copy link
Member

I think the != discussion led us to decide that it probably wasn't worth being stingy on opcodes, though. It's probably worth opening an issue for these, and basing our decision on data once we have large codebases?

@titzer
Copy link
Contributor

titzer commented Sep 2, 2015

+1 for waiting on larger applications. I think we've got everything we need
for completeness and everything else is just convenience.

On Wed, Sep 2, 2015 at 7:16 PM, JF Bastien notifications@github.com wrote:

I think the != discussion led us to decide that it probably wasn't worth
being stingy on opcodes, though. It's probably worth opening an issue for
these, and basing our decision on data once we have large codebases?


Reply to this email directly or view it on GitHub
#44 (comment).

@jfbastien
Copy link
Member

So it sounds like for now this is lgtm to merge, and file an issue on the design repo to gather data?

@sunfishcode
Copy link
Member Author

Merging because I believe we basically have consensus here, at least with respect to bringing the spec repo into accordance with the design repo. If people want integer abs/neg/not or other things, they're welcome to pursue them in the design repo first.

AstSemantics.md presently has no integer neg, abs, or not operators. It
does have a popcnt operator.
sunfishcode added a commit that referenced this pull request Sep 3, 2015
Sync the integer unary operators with AstSemantics.md.
@sunfishcode sunfishcode merged commit ce645d2 into master Sep 3, 2015
@jfbastien jfbastien deleted the integer-unary branch September 3, 2015 22:11
littledan pushed a commit to littledan/spec that referenced this pull request Mar 4, 2018
eqrion pushed a commit to eqrion/wasm-spec that referenced this pull request Jul 18, 2019
alexcrichton pushed a commit to alexcrichton/spec that referenced this pull request Nov 18, 2019
…Interface

Accessing SIMD types form JavaScript throws
ErikMcClure pushed a commit to innative-sdk/spec that referenced this pull request Jun 15, 2020
This change modifies `assert_return`. After the Wasm function is
invoked, the result will either be `undefined`, a JS `Number`, or a JS
`Array`. It's simpler to treat them all as an array, with `undefined`
representing an empty array, and `Number` representing an array with one
element.

We don't check for `Number` here, since as soon as we add support for
the reference-types proposal, a scalar result may be an `Object` too.

Fixes issue WebAssembly#44.
backes pushed a commit to backes/spec that referenced this pull request Jul 12, 2023
Rename new traps.wast test -> traps0.wast
dhil added a commit to dhil/webassembly-spec that referenced this pull request Aug 2, 2024
…ebAssembly#44)

* [spec] resume_throw should accept multiple handlers (WebAssembly#71)

* Add missing *

---------

Co-authored-by: Alan L <gh@symb.olic.link>
stevenfontanella pushed a commit to stevenfontanella/spec that referenced this pull request Nov 12, 2025
These proposals have both been merged in the main spec repo.
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.

5 participants