Testing latest pari + WASM + node.js... and it works?! Wow.
License: GPL3
ubuntu2004
#line 2 "../src/kernel/none/bfffo.h"1/* Copyright (C) 2000 The PARI group.23This file is part of the PARI/GP package.45PARI/GP is free software; you can redistribute it and/or modify it under the6terms of the GNU General Public License as published by the Free Software7Foundation; either version 2 of the License, or (at your option) any later8version. It is distributed in the hope that it will be useful, but WITHOUT9ANY WARRANTY WHATSOEVER.1011Check the License for details. You should have received a copy of it, along12with the package; see the file 'COPYING'. If not, write to the Free Software13Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */1415#if !defined(INLINE)16extern int bfffo(ulong x);17#else1819#if defined(__GNUC__) && !defined(DISABLE_INLINE)2021#ifdef LONG_IS_64BIT22# define bfffo(x) \23__extension__ ({ \24static int __bfffo_tabshi[16]={4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};\25int __value = BITS_IN_LONG - 4; \26ulong __arg1=(x); \27if (__arg1 & ~0xffffffffUL) {__value -= 32; __arg1 >>= 32;}\28if (__arg1 & ~0xffffUL) {__value -= 16; __arg1 >>= 16;} \29if (__arg1 & ~0x00ffUL) {__value -= 8; __arg1 >>= 8;} \30if (__arg1 & ~0x000fUL) {__value -= 4; __arg1 >>= 4;} \31__value + __bfffo_tabshi[__arg1]; \32})33#else34# define bfffo(x) \35__extension__ ({ \36static int __bfffo_tabshi[16]={4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};\37int __value = BITS_IN_LONG - 4; \38ulong __arg1=(x); \39if (__arg1 & ~0xffffUL) {__value -= 16; __arg1 >>= 16;} \40if (__arg1 & ~0x00ffUL) {__value -= 8; __arg1 >>= 8;} \41if (__arg1 & ~0x000fUL) {__value -= 4; __arg1 >>= 4;} \42__value + __bfffo_tabshi[__arg1]; \43})44#endif4546#else4748INLINE int49bfffo(ulong x)50{51static int tabshi[16]={4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};52int value = BITS_IN_LONG - 4;53ulong arg1=x;54#ifdef LONG_IS_64BIT55if (arg1 & ~0xffffffffUL) {value -= 32; arg1 >>= 32;}56#endif57if (arg1 & ~0xffffUL) {value -= 16; arg1 >>= 16;}58if (arg1 & ~0x00ffUL) {value -= 8; arg1 >>= 8;}59if (arg1 & ~0x000fUL) {value -= 4; arg1 >>= 4;}60return value + tabshi[arg1];61}62#endif6364#endif656667