Skip to content

Evaluate i64.add_wide plus i64.add_wide3 #34

@alexcrichton

Description

@alexcrichton

I wanted to extract the proposal from here to a separate issue to avoid getting lost too much in that thread. Specifically it seems worthwhile to me to evaluate new addition/subtraction instructions:

i64.add_wide:   [i64, i64] ->      [i64, i64]  ;; a + b -> (low, high=carry)
i64.add3_wide:  [i64, i64, i64] -> [i64, i64]  ;; a + b + c -> (low, high=carry)
i64.sub_wide:   [i64, i64] ->      [i64, i64]  ;; a - b -> (difference, borrow)
i64.sub2_wide:  [i64, i64, i64] -> [i64, i64]  ;; a - b - c -> (difference, borrow)

(names bikesheddable over time of course)

My thinking for evaluating this would be:

  • Implement them in a fork of wasm-tools (not too bad).
  • Implement them in Wasmtime (probably not too bad).
  • Implement them in LLVM (pretty nontrivial for me) under a new flag temporarily.
  • Evaluate performance of instructions before+after, only before, only after, etc.

Much of the performance here will probably related to how good the LLVM implementation is would be my guess. To be determined!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions