diff --git a/include/xsimd/arch/xsimd_vsx.hpp b/include/xsimd/arch/xsimd_vsx.hpp index bf4c08308..122b916c7 100644 --- a/include/xsimd/arch/xsimd_vsx.hpp +++ b/include/xsimd/arch/xsimd_vsx.hpp @@ -605,8 +605,18 @@ namespace xsimd } // round - template ::value>> - XSIMD_INLINE batch round(batch const& self, requires_arch) noexcept + + // vec_round exists also for float vectors but is mapped to vrfin instruction which uses the wrong rounding mode +#if defined __has_builtin && __has_builtin(__builtin_vsx_xvrspi) + template + XSIMD_INLINE batch round(batch const& self, requires_arch) noexcept + { + return __builtin_vsx_xvrspi(self.data); + } +#endif + // For double vectors vec_round uses xvrdpi which does the right thing + template + XSIMD_INLINE batch round(batch const& self, requires_arch) noexcept { return vec_round(self.data); }