<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- -/libgcc/libgcc2.c
+++ +/libgcc/libgcc2.c
@@ -819,21 +819,6 @@
 };
 #endif
 
-#if defined(L_popcountsi2) || defined(L_popcountdi2)
-#define POPCOUNTCST2(x) (((UWtype) x &lt;&lt; __CHAR_BIT__) | x)
-#define POPCOUNTCST4(x) (((UWtype) x &lt;&lt; (2 * __CHAR_BIT__)) | x)
-#define POPCOUNTCST8(x) (((UWtype) x &lt;&lt; (4 * __CHAR_BIT__)) | x)
-#if W_TYPE_SIZE == __CHAR_BIT__
-#define POPCOUNTCST(x) x
-#elif W_TYPE_SIZE == 2 * __CHAR_BIT__
-#define POPCOUNTCST(x) POPCOUNTCST2 (x)
-#elif W_TYPE_SIZE == 4 * __CHAR_BIT__
-#define POPCOUNTCST(x) POPCOUNTCST4 (POPCOUNTCST2 (x))
-#elif W_TYPE_SIZE == 8 * __CHAR_BIT__
-#define POPCOUNTCST(x) POPCOUNTCST8 (POPCOUNTCST4 (POPCOUNTCST2 (x)))
-#endif
-#endif
-
 #ifdef L_popcountsi2
 #undef int
 int
@@ -842,11 +827,11 @@
   /* Force table lookup on targets like AVR and RL78 which only
      pretend they have LIBGCC2_UNITS_PER_WORD 4, but actually
      have 1, and other small word targets.  */
-#if __SIZEOF_INT__ &gt; 2 &amp;&amp; defined (POPCOUNTCST) &amp;&amp; __CHAR_BIT__ == 8
-  x = x - ((x &gt;&gt; 1) &amp; POPCOUNTCST (0x55));
-  x = (x &amp; POPCOUNTCST (0x33)) + ((x &gt;&gt; 2) &amp; POPCOUNTCST (0x33));
-  x = (x + (x &gt;&gt; 4)) &amp; POPCOUNTCST (0x0F);
-  return (x * POPCOUNTCST (0x01)) &gt;&gt; (W_TYPE_SIZE - __CHAR_BIT__);
+#if __SIZEOF_INT__ &gt; 2 &amp;&amp; __CHAR_BIT__ == 8
+  x = x - ((x &gt;&gt; 1) &amp; ((UWtype) ~0 / 3));
+  x = (x &amp; ((UWtype) ~0 / 5)) + ((x &gt;&gt; 2) &amp; ((UWtype) ~0 / 5));
+  x = (x + (x &gt;&gt; 4)) &amp; ((UWtype) ~0 / 17);
+  return (x * ((UWtype) ~0 / 255)) &gt;&gt; (W_TYPE_SIZE - __CHAR_BIT__);
 #else
   int i, ret = 0;
 
@@ -869,14 +854,14 @@
 #if __SIZEOF_INT__ &gt; 2 &amp;&amp; defined (POPCOUNTCST) &amp;&amp; __CHAR_BIT__ == 8
   const DWunion uu = {.ll = x};
   UWtype x1 = uu.s.low, x2 = uu.s.high;
-  x1 = x1 - ((x1 &gt;&gt; 1) &amp; POPCOUNTCST (0x55));
-  x2 = x2 - ((x2 &gt;&gt; 1) &amp; POPCOUNTCST (0x55));
-  x1 = (x1 &amp; POPCOUNTCST (0x33)) + ((x1 &gt;&gt; 2) &amp; POPCOUNTCST (0x33));
-  x2 = (x2 &amp; POPCOUNTCST (0x33)) + ((x2 &gt;&gt; 2) &amp; POPCOUNTCST (0x33));
-  x1 = (x1 + (x1 &gt;&gt; 4)) &amp; POPCOUNTCST (0x0F);
-  x2 = (x2 + (x2 &gt;&gt; 4)) &amp; POPCOUNTCST (0x0F);
+  x1 = x1 - ((x1 &gt;&gt; 1) &amp; ((UWtype) ~0 / 3));
+  x2 = x2 - ((x2 &gt;&gt; 1) &amp; ((UWtype) ~0 / 3));
+  x1 = (x1 &amp; ((UWtype) ~0 / 5)) + ((x1 &gt;&gt; 2) &amp; ((UWtype) ~0 / 5));
+  x2 = (x2 &amp; ((UWtype) ~0 / 5)) + ((x2 &gt;&gt; 2) &amp; ((UWtype) ~0 / 5));
+  x1 = (x1 + (x1 &gt;&gt; 4)) &amp; ((UWtype) ~0 / 17);
+  x2 = (x2 + (x2 &gt;&gt; 4)) &amp; ((UWtype) ~0 / 17);
   x1 += x2;
-  return (x1 * POPCOUNTCST (0x01)) &gt;&gt; (W_TYPE_SIZE - __CHAR_BIT__);
+  return (x1 * ((UWtype) ~0 / 255)) &gt;&gt; (W_TYPE_SIZE - __CHAR_BIT__);
 #else
   int i, ret = 0;
 
</pre></body></html>