Open NamorNiradnug opened 5 months ago
what you want is usually round_ties_even
(not yet available on Simd
), since that usually compiles to a single instruction
what you want is usually
round_ties_even
(not yet available onSimd
), since that usually compiles to a single instruction
Yet still there are maybe platforms where it's not the case. Or may be such an instruction is slower than another rounding instruction.
Although at least NEON, AVX and SSE all have round_ties_even
instructions.
Thanks for a workaround!
.round()
function is very slow compared to platform-native intrinsic on AVX (https://godbolt.org/z/3sdd9jrvW) because it provides a platform-agnostic behavior. Although there are many use cases when the exact behavior on half-way values or INFs and NaNs doesn't matter.I think adding somewhat like
round_fast
function is reasonable.