Skip to content

Implementation-dependent reciprocal [sqrt] approximation instructions #4

Open
@stoklund

Description

@stoklund

The proposal in WebAssembly/simd#1 includes these instructions:

  • f32x4.reciprocalApproximation(a: v128) -> v128,
  • f32x4.reciprocalSqrtApproximation(a: v128) -> v128,
  • f64x2.reciprocalApproximation(a: v128) -> v128, and
  • f64x2.reciprocalSqrtApproximation(a: v128) -> v128.

The corresponding scalar instructions are mentioned in the future features design document.

These instructions are available in the ARM, Intel, and MIPS SIMD instruction sets. They are typically implemented as table-driven piece-wise linear approximations on the interval [0.5; 1) or [0.25; 1) and then extended to the full exponent domain. However, the exact nature of the approximation is implementation-dependent, so different ISAs will get different results.

The approximations are either used as-is for low-precision graphics or physics code, or they are used as starting points and refined with one or more steps of Newton-Raphson.

Metadata

Metadata

Assignees

No one assigned

    Labels

    instruction-proposalout of scopeOut of scope for this proposal, can be explored in a subsequent proposal.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions