Function core::core_simd::intrinsics::simd_neg
source · pub(crate) unsafe extern "platform-intrinsic" fn simd_neg<T>(
x: T
) -> T
🔬This is a nightly-only experimental API. (
portable_simd
#86656)Expand description
neg/fneg
ints: ultimately becomes a call to cg_ssa’s BuilderMethods::neg. cg_llvm equates this to simd_sub(Simd::splat(0), x)
.
floats: LLVM’s fneg, which changes the floating point sign bit. Some arches have instructions for it.
Rust panics for Neg::neg(int::MIN) due to overflow, but it is not UB in LLVM without nsw
.