Skip to content

missing APIs vs std::simd #355

Description

@Shnatsel

Desirable, needs implementation (vectors)

Desirable, needs implementation (masks only)

Not investigated (TODO: move into another category)

  • Horizontal bitwise reductions: reduce_or, reduce_xor, etc. Implement reduce_and, reduce_or, reduce_xor #346
  • reduce_product Implement reduce_product() #361
  • Signed int saturating_abs, saturating_neg, is_positive, is_negative, signum.
  • leading_zeros, trailing_zeros, leading_ones, trailing_ones (expensive emulation but maybe still faster than scalar?)
  • interleave and deinterleave on masks
  • to_degrees, to_radians on floats
  • Sign, NaN, infinity, finite, subnormal, and normal classification on floats
  • simd_clamp on floats
  • Ties-away-from-zero round on floats (round-ties-even is supported; ties away from zero has poor hardware support)

Compatibilty/convenience wrappers

Not sure if we should add all of these, the API surface is large enough as it is.

Tricky API questions

  • extract
  • simd_swizzle!
  • generic cast between arbitrary same-lane-count vectors (we have explicit to_float/to_int and widen/narrow but not fully generic cast)
  • lane-wise abs_diff that always needs to return unsigned values, and std doesn't implement for floats

Not planned

  • integer div, rem: no hardware support
  • Masked load/store: load_or_default, load_or, load_select (only supported on AVX-512)
  • Scatter/gather (impractically slow, often slower than scalar) Add (scalarized) safe gather and scatter ops #171
  • Trigonometry, exponents, etc. (likely needs a separate crate with configurable trade-offs, not part of base fearless_simd)
  • floating-point remainder: no hardware support, approximations available for special cases, full support complex and expensive (might bundle with trigonometry crate?)

Activity

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions