Skip to content

Commit c527f46

Browse files
riscv
1 parent 34b6bec commit c527f46

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ namespace xsimd
13591359
std::make_tuple(wrap::vmaxq_u8, wrap::vmaxq_s8, wrap::vmaxq_u16, wrap::vmaxq_s16,
13601360
wrap::vmaxq_u32, wrap::vmaxq_s32, wrap::vmaxq_f32)
13611361
};
1362-
return dispatcher.apply(register_type(rhs), register_type(lhs));
1362+
return dispatcher.apply(register_type(lhs), register_type(rhs));
13631363
}
13641364

13651365
template <class A, class T, detail::enable_sized_integral_t<T, 8> = 0>

include/xsimd/arch/xsimd_neon64.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,11 @@ namespace xsimd
584584
template <class A>
585585
XSIMD_INLINE batch<double, A> min(batch<double, A> const& lhs, batch<double, A> const& rhs, requires_arch<neon64>) noexcept
586586
{
587+
#ifdef __FAST_MATH__
587588
return vminq_f64(lhs, rhs);
589+
#else
590+
return vminnmq_f64(lhs, rhs);
591+
#endif
588592
}
589593

590594
/*******
@@ -594,7 +598,11 @@ namespace xsimd
594598
template <class A>
595599
XSIMD_INLINE batch<double, A> max(batch<double, A> const& lhs, batch<double, A> const& rhs, requires_arch<neon64>) noexcept
596600
{
601+
#ifdef __FAST_MATH__
597602
return vmaxq_f64(lhs, rhs);
603+
#else
604+
return vmaxnmq_f64(lhs, rhs);
605+
#endif
598606
}
599607

600608
/*******

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,14 +742,14 @@ namespace xsimd
742742
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
743743
XSIMD_INLINE batch<T, A> max(batch<T, A> const& lhs, batch<T, A> const& rhs, requires_arch<rvv>) noexcept
744744
{
745-
return detail::rvvmax(lhs, rhs);
745+
return detail::rvvmax(rhs, lhs);
746746
}
747747

748748
// min
749749
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
750750
XSIMD_INLINE batch<T, A> min(batch<T, A> const& lhs, batch<T, A> const& rhs, requires_arch<rvv>) noexcept
751751
{
752-
return detail::rvvmin(lhs, rhs);
752+
return detail::rvvmin(rhs, lhs);
753753
}
754754

755755
// neg

include/xsimd/arch/xsimd_vsx.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,14 @@ namespace xsimd
470470
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
471471
XSIMD_INLINE batch<T, A> max(batch<T, A> const& self, batch<T, A> const& other, requires_arch<vsx>) noexcept
472472
{
473-
return vec_max(self.data, other.data);
473+
return vec_max(other.data, self.data);
474474
}
475475

476476
// min
477477
template <class A, class T, class = typename std::enable_if<std::is_scalar<T>::value, void>::type>
478478
XSIMD_INLINE batch<T, A> min(batch<T, A> const& self, batch<T, A> const& other, requires_arch<vsx>) noexcept
479479
{
480-
return vec_min(self.data, other.data);
480+
return vec_min(other.data, self.data);
481481
}
482482

483483
// mul

0 commit comments

Comments
 (0)