libgcc2.c (__paritysi2, [...]): Replace last two reduction rounds with a "bit table...
authorRichard Henderson <rth@redhat.com>
Wed, 5 Feb 2003 00:43:22 +0000 (16:43 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 5 Feb 2003 00:43:22 +0000 (16:43 -0800)
        * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction
        rounds with a "bit table" lookup.

From-SVN: r62421

gcc/ChangeLog
gcc/libgcc2.c

index dfafdec..17553a3 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-04  Richard Henderson  <rth@redhat.com>
+
+       * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction
+       rounds with a "bit table" lookup.
+
 2003-02-04  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * reload.c (find_reloads): Do not use the mode specified in the insn
index a6eb1f0..2801681 100644 (file)
@@ -664,9 +664,8 @@ __paritysi2 (USItype x)
   nx ^= nx >> 16;
   nx ^= nx >> 8;
   nx ^= nx >> 4;
-  nx ^= nx >> 2;
-  nx ^= nx >> 1;
-  return nx & 1;
+  nx &= 0xf;
+  return (0x6996 >> nx) & 1;
 }
 #endif
 \f
@@ -680,9 +679,8 @@ __paritydi2 (UDItype x)
   nx ^= nx >> 16;
   nx ^= nx >> 8;
   nx ^= nx >> 4;
-  nx ^= nx >> 2;
-  nx ^= nx >> 1;
-  return nx & 1;
+  nx &= 0xf;
+  return (0x6996 >> nx) & 1;
 }
 #endif