Opteron: Error: suffix or operands invalid for `bsf'

Francois G. Dorais dorais@gauss.dartmouth.edu
Fri, 25 Jul 2003 11:27:59 -0400 (EDT)

Hi Felix,

The compiler seems to have a problem with the bsfq instruction generated
for the count_trailing_zeros macro declared in longlong.h, line 716. The
instruction is perfectly legal, so I suspect a compiler bug, but I haven't
seen anything in the gcc bug list. Generate the assembly file to see if
it's not trying to do something stupid... or try again with another
version of gcc if you can upgrade it.

There is quick fix if it turns out the compiler simply can't deal
with bsfq: use the generic count_leading/trailing_zeros macros defined at
line 1624 of longlong.h instead. This will likely be slower, but it's sure
to work... until a real fix comes along.

(You might also want to inspect longlong.h and dive_1.c for corruption,
it's unlikely but you never know...)

Best of luck,
Francois G. Dorais

On Fri, 25 Jul 2003, Felix E. Klee wrote:

> Hi,
> compiling GMP on a 64Bit Opteron powered system fails:
>     gcc -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I..
>     -DOPERATION_dive_1 -g -O2 -c dive_1.c -o dive_1.o
>     /tmp/ccAjXa2y.s: Assembler messages:
>     /tmp/ccAjXa2y.s:41: Error: suffix or operands invalid for `bsf'
>     make[2]: *** [dive_1.lo] Error 1
> GCC info:
>     jkrueger@ekpvms64:/home/jkrueger/trasim/3rdparty/gmp-4.1.2> gcc -v
>     gcc -v
>     Reading specs from /usr/lib64/gcc-lib/x86_64-suse-linux/3.2.2/specs
>     Configured with: ../configure --enable-threads=posix --prefix=/usr
>     --with-local-prefix=/usr/local --infodir=/usr/share/info
>     --mandir=/usr/share/man --libdir=/usr/lib64
>     --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj
>     --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
>     --with-system-zlib --enable-shared --enable-__cxa_atexit
>     x86_64-suse-linux
>     Thread model: posix
>     gcc version 3.2.2 (SuSE Linux)
> GMP configuration:
>     ./configure --enable-cxx --enable-shared=no
> Any ideas what might be going wrong?
> Felix
> --
> To contact me in private don't reply but send mail to
>     felix DOT klee AT inka DOT de
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss@swox.com
> https://gmplib.org/mailman/listinfo/gmp-discuss