Skip to content

Commit 1770e0a

Browse files
WIP
1 parent 053c9ed commit 1770e0a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/xsimd/arch/common/xsimd_common_arithmetic.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ namespace xsimd
203203
{
204204
if (std::is_signed<T>::value)
205205
{
206-
auto mask = (other >> (8 * sizeof(T) - 1));
207206
auto self_pos_branch = min(std::numeric_limits<T>::max() - other, self);
208207
auto self_neg_branch = max(std::numeric_limits<T>::min() - other, self);
209-
return other + select(batch_bool<T, A>(mask.data), self_neg_branch, self_pos_branch);
208+
return other + select(other >= 0, self_pos_branch, self_neg_branch);
210209
}
211210
else
212211
{

0 commit comments

Comments
 (0)