Skip to content

Support wasm select instruction with V128-typed operands.#2391

Merged
julian-seward1 merged 1 commit into
bytecodealliance:mainfrom
julian-seward1:arm64-select-v128
Nov 11, 2020
Merged

Support wasm select instruction with V128-typed operands.#2391
julian-seward1 merged 1 commit into
bytecodealliance:mainfrom
julian-seward1:arm64-select-v128

Conversation

@julian-seward1

Copy link
Copy Markdown
Contributor
  • this requires upgrading to wasmparser 0.67.0.

  • There are no CLIF side changes because the CLIF select instruction is
    polymorphic enough.

  • on aarch64, there is unfortunately no conditional-move (csel) instruction on
    vectors. This patch adds a synthetic instruction VecCSel which does
    behave like that. At emit time, this is emitted as an if-then-else diamond
    (4 insns).

  • aarch64 implementation is otherwise straightforwards.

@julian-seward1

Copy link
Copy Markdown
Contributor Author

cc @yurydelendik

@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:wasm fuzzing Issues related to our fuzzing infrastructure lightbeam Issues related to the Lightbeam compiler wasmtime:api Related to the API of the `wasmtime` crate itself labels Nov 11, 2020
@github-actions

Copy link
Copy Markdown

Subscribe to Label Action

cc @fitzgen, @peterhuene

Details This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:wasm", "fuzzing", "lightbeam", "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing
  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

} else if is_float && bits == 64 {
ctx.emit(Inst::FpuCSel64 { cond, rd, rn, rm });
} else if is_float && bits == 128 {
ctx.emit(Inst::VecCSel { cond, rd, rn, rm });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note, it is weird to see that ctx.emit(Inst::CSel ... below did not have assert to prevent float/128 to become csel.

* this requires upgrading to wasmparser 0.67.0.

* There are no CLIF side changes because the CLIF `select` instruction is
  polymorphic enough.

* on aarch64, there is unfortunately no conditional-move (csel) instruction on
  vectors.  This patch adds a synthetic instruction `VecCSel` which *does*
  behave like that.  At emit time, this is emitted as an if-then-else diamond
  (4 insns).

* aarch64 implementation is otherwise straightforwards.
@julian-seward1 julian-seward1 merged commit 41e87a2 into bytecodealliance:main Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:wasm cranelift Issues related to the Cranelift code generator fuzzing Issues related to our fuzzing infrastructure lightbeam Issues related to the Lightbeam compiler wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants