Module 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.
shift_scalar ๐Ÿ”’ Experimental
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.