|
From: Jan-Benedict G. <jb...@us...> - 2004-11-19 13:09:07
|
Update of /cvsroot/linux-vax/kernel-2.5/include/asm-vax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18641 Modified Files: bitops.h Log Message: - I've now taken Kenn's suggestion to force ffs's base operand into memory. mm/bootmem.c (as of 2.5.9) calls ffs() with a constant argument, which (with "g" constraint) may show up as an immediate value -- which the VAX CPUs as well as gas refuse to use. - Since many (at least mostly all "important) architectures (including i386) use a C-only implementation for ffs(), I guess this isn't all that bad wrt. performance. Index: bitops.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/bitops.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- bitops.h 2 Sep 2004 22:41:49 -0000 1.13 +++ bitops.h 19 Nov 2004 13:08:56 -0000 1.14 @@ -393,12 +393,18 @@ { int r; + /* + * FIXME: We're forcing the input to be in memory, but it would + * be okay if it was in a register, too. However, if it's "g", + * gcc may decide to put in an immediate value, which is not accepted + * by CPU (and gas). + */ __asm__("ffs $0, $32, %1, %0\n" "bnequ 1f\n" "movl $-1,%0\n" "1:" : "=ir" (r) - : "g" (x)); + : "m" (x)); return r+1; } #endif |