]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
expand128 bugs fixed
authorApostolos Tapsas <apostolos@vm01.debian11>
Fri, 22 Oct 2021 07:05:55 +0000 (07:05 +0000)
committerApostolos Tapsas <apostolos@vm01.debian11>
Fri, 22 Oct 2021 07:05:55 +0000 (07:05 +0000)
src/util/arch/ppc64el/bitutils.h

index fbe016f2b3fd0f4a49978d3b440092239e08e828..10c4869b38cf0a43d1b7b490c1da2968f85d675c 100644 (file)
@@ -135,17 +135,16 @@ u64a expand64_impl(u64a x, u64a m) {
 }
 
 static really_inline
-m128 expand128_impl(m128 xvec, m128 mvec) {
+m128 expand128_impl(m128 x, m128 m) {
     m128 one = set1_2x64(1);
     m128 bb = one;
     m128 res = zeroes128();
     while (isnonzero128(m)) {
+       m128 xm = and128(x, bb);
         m128 mm = sub_2x64(zeroes128(), m);
-        m128 xm = and128(x, m);
-        xm = and128(xm, mm);
-
         m128 mask = not128(eq64_m128(xm, zeroes128()));
-        res = or128(res, and128(bb, mask));
+       mask = and128(mask, and128(m,mm));
+        res = or128(res, mask);
         m = and128(m, sub_2x64(m, one));
         bb = lshift64_m128(bb, 1);
     }