We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a27d0a3 commit 31d41ceCopy full SHA for 31d41ce
cp-algo/util/simd.hpp
@@ -18,8 +18,13 @@ namespace cp_algo {
18
using u8x32 = simd<uint8_t, 32>;
19
using dx4 = simd<double, 4>;
20
21
- inline dx4 abs(dx4 a) {
22
- return a < -a ? -a : a;
+ dx4 abs(dx4 a) {
+ return dx4{
23
+ std::abs(a[0]),
24
+ std::abs(a[1]),
25
+ std::abs(a[2]),
26
+ std::abs(a[3])
27
+ };
28
}
29
30
// https://stackoverflow.com/a/77376595
0 commit comments