Skip to content

Unary eqz operator #554

Closed
Closed

Description

@sunfishcode

WIthout br_unless, reversing a branch without reorganizing basic blocks requires adding two instructions, an i32.const 0 and an i32.eq operator. This is a very common pattern which adds clutter. A unary not operator would be trivial to implement, make pattern-matching of branching easier, and reduce clutter for a common pattern.

Activity

  1. titzer commented on Feb 25, 2016

    @titzer

    It appears in the binary format, and we've implemented in V8. Also in favor of br_unless, but we haven't implemented that.

  2. sunfishcode commented on Feb 25, 2016

    @sunfishcode
    MemberAuthor

    Ok, great. I'll submit PRs adding unary not to ml-proto and AstSemantics.md then so that we're all in sync.

  3. sunfishcode commented on Feb 25, 2016

    @sunfishcode
    MemberAuthor

    Design PR: #555

  4. added this to the MVP milestone on Feb 27, 2016
  5. changed the title [-]Unary `not` operator[/-] [+]Unary `eqz` operator[/+] on Mar 11, 2016
  6. sunfishcode commented on Mar 11, 2016

    @sunfishcode
    MemberAuthor

    Design is done; spec PR: WebAssembly/spec#259

  7. rossberg commented on Mar 12, 2016

    @rossberg
    Member

    Spec landed as well, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions