Skip to content
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

CL/aarch64: implement the wasm SIMD pseudo-max/min and FP-rounding in… #2312

Merged

Conversation

julian-seward1
Copy link
Contributor

…structions

This patch implements, for aarch64, the following wasm SIMD extensions

Floating-point rounding instructions
WebAssembly/simd#232

Pseudo-Minimum and Pseudo-Maximum instructions
WebAssembly/simd#122

The changes are straightforward:

  • build.rs: the relevant tests have been enabled

  • cranelift/codegen/meta/src/shared/instructions.rs: new CLIF instructions
    fmin_pseudo and fmax_pseudo. The wasm rounding instructions do not need
    any new CLIF instructions.

  • cranelift/wasm/src/code_translator.rs: translation into CLIF; this is
    pretty much the same as any other unary or binary vector instruction (for
    the rounding and the pmin/max respectively)

  • cranelift/codegen/src/isa/aarch64/lower_inst.rs:

    • fmin_pseudo and fmax_pseudo are converted into a two instruction
      sequence, fcmpgt followed by bsl
    • the CLIF rounding instructions are converted to a suitable vector
      frint{n,z,p,m} instruction.
  • cranelift/codegen/src/isa/aarch64/inst/mod.rs: minor extension of pub enum VecMisc2 to handle the rounding operations. And corresponding emit
    cases.

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:meta Everything related to the meta-language. cranelift:wasm labels Oct 23, 2020
Copy link
Contributor

@yurydelendik yurydelendik left a comment

Choose a reason for hiding this comment

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

Looks good with better fmin_pseudo/ fmax_pseudo instruction descriptions (maybe even a note at lower_inst.rs implementation?)

@julian-seward1 julian-seward1 force-pushed the arm64-simd-pminmax-round branch 3 times, most recently from df58133 to bfceb8c Compare October 24, 2020 08:57
…structions

This patch implements, for aarch64, the following wasm SIMD extensions

  Floating-point rounding instructions
  WebAssembly/simd#232

  Pseudo-Minimum and Pseudo-Maximum instructions
  WebAssembly/simd#122

The changes are straightforward:

* `build.rs`: the relevant tests have been enabled

* `cranelift/codegen/meta/src/shared/instructions.rs`: new CLIF instructions
  `fmin_pseudo` and `fmax_pseudo`.  The wasm rounding instructions do not need
  any new CLIF instructions.

* `cranelift/wasm/src/code_translator.rs`: translation into CLIF; this is
  pretty much the same as any other unary or binary vector instruction (for
  the rounding and the pmin/max respectively)

* `cranelift/codegen/src/isa/aarch64/lower_inst.rs`:
  - `fmin_pseudo` and `fmax_pseudo` are converted into a two instruction
    sequence, `fcmpgt` followed by `bsl`
  - the CLIF rounding instructions are converted to a suitable vector
    `frint{n,z,p,m}` instruction.

* `cranelift/codegen/src/isa/aarch64/inst/mod.rs`: minor extension of `pub
  enum VecMisc2` to handle the rounding operations.  And corresponding `emit`
  cases.
@julian-seward1 julian-seward1 merged commit c15d9bd into bytecodealliance:main Oct 26, 2020
bjorn3 added a commit to bjorn3/wasmtime that referenced this pull request Jul 27, 2021
bjorn3 added a commit to bjorn3/wasmtime that referenced this pull request Aug 27, 2021
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:meta Everything related to the meta-language. cranelift:wasm cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants