Improve documentation
[sxemacs] / src / ent / ent.h
index c74fc98..c0f28c8 100644 (file)
@@ -55,24 +55,24 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
    octon     = octonion number (which library does that? lidia?) - NOT YET
 
-   Category unions: 
+   Category unions:
    ================
    rational        = integer + bigq
    real            = float + bigf + bigr
-                     (and everything else simulating real numbers)
+                    (and everything else simulating real numbers)
    comparable      = rational + real
-                     (and everything else that has a total order)
+                    (and everything else that has a total order)
    complex         = bigc + gaussian
    algebraic       = rational + ffelm + padic + gaussian
    archimedean     = rational + real + complex
-                     (and everything else with an archimedean valuation)
+                    (and everything else with an archimedean valuation)
    non-archimidean = padic + ffelm
 
    number    = archimedean + non-archimedean + quatern + octon
 
 
    The top-level configure script should define the symbols
-   HAVE_MPZ, HAVE_MPQ, HAVE_MPF, HAVE_MPFR and HAVE_MPC to indicate which 
+   HAVE_MPZ, HAVE_MPQ, HAVE_MPF, HAVE_MPFR and HAVE_MPC to indicate which
    it provides.
    If some type is not defined by the library, this is what happens:
 
@@ -132,7 +132,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #endif
 #if defined HAVE_MPC && defined WITH_MPC
 # include "ent/ent-mpc.h"
-#elif defined HAVE_PSEUC && defined WITH_PSEUC 
+#elif defined HAVE_PSEUC && defined WITH_PSEUC
 # include "ent/ent-pseumpc.h"
 #endif
 #if defined HAVE_ECM && defined WITH_ECM
@@ -523,6 +523,20 @@ __ase_ffsl(long unsigned int x)
        return 32 - cnt;
 }
 
+#elif defined __powerpc64__
+
+extern_inline long unsigned int
+__ase_ffsl(long unsigned int x)
+{
+       long unsigned int cnt;
+
+       __asm__ volatile(
+               "cntlzw %[out], %[in]\n"
+               : [out] "=r" (cnt)
+               : [in] "r" (x & -x));
+       return 64 - cnt;
+}
+
 #elif defined HAVE_FFSL
 extern_inline long unsigned int
 __ase_ffsl(long unsigned int x)
@@ -607,6 +621,34 @@ __ase_flsl(long unsigned int x)
        return x;
 }
 
+#elif defined __ppc__
+extern_inline long unsigned int
+__ase_flsl(long unsigned int x)
+{
+       long unsigned int cnt;
+
+        __asm__ volatile(
+               "cntlzw %[out], %[in]"
+               : [out] "=r" (cnt)
+               : [in] "r" (x)
+               );
+        return 64 - cnt;
+}
+
+#elif defined __powerpc64__
+extern_inline long unsigned int
+__ase_flsl(long unsigned int x)
+{
+       long unsigned int cnt;
+
+        __asm__ volatile(
+               "cntlzd %[out], %[in]"
+               : [out] "=r" (cnt)
+               : [in] "r" (x)
+               );
+        return 64 - x;
+}
+
 #elif defined HAVE_FLSL
 extern_inline long unsigned int
 __ase_flsl(long unsigned int x)