Module core::core_simd::ops

source ·
🔬This is a nightly-only experimental API. (portable_simd #86656)

Modules

  • assign 🔒 Experimental
    Assignment operators
  • deref 🔒 Experimental
    This module hacks in “implicit deref” for Simd’s operators. Ideally, Rust would take care of this itself, and method calls usually handle the LHS implicitly. But this is not the case with arithmetic ops.
  • unary 🔒 Experimental

Macros

  • for_base_ops 🔒 Experimental
  • for_base_types 🔒 Experimental
  • int_divrem_guard 🔒 Experimental
    SAFETY: This macro must only be used to impl Div or Rem and given the matching intrinsic. It guards against LLVM’s UB conditions for integer div or rem using masks and selects, thus guaranteeing a Rust value returns instead.
  • unsafe_base 🔒 Experimental
  • wrap_bitshift 🔒 Experimental
    SAFETY: This macro should not be used for anything except Shl or Shr, and passed the appropriate shift intrinsic. It handles performing a bitand in addition to calling the shift operator, so that the result is well-defined: LLVM can return a poison value if you shl, lshr, or ashr if rhs >= <Int>::BITS At worst, this will maybe add another instruction and cycle, at best, it may open up more optimization opportunities, or simply be elided entirely, especially for SIMD ISAs which default to this.