gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Apr 2007 06:46:37 +0000 (06:46 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Apr 2007 06:46:37 +0000 (06:46 +0000)
* optabs.c (set_conv_libfunc): Prefer libgcc2's __ffsMM2 functions
over an external ffs function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124096 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/optabs.c

index 3983b42..b77b42d 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-24  Richard Sandiford  <richard@codesourcery.com>
+
+       * optabs.c (set_conv_libfunc): Prefer libgcc2's __ffsMM2 functions
+       over an external ffs function.
+
 2007-04-24  Chao-ying Fu  <fu@mips.com>
            Richard Sandiford  <richard@nildram.co.uk>
 
index 49e0121..b63accc 100644 (file)
@@ -5411,6 +5411,7 @@ void
 init_optabs (void)
 {
   unsigned int i;
+  enum machine_mode int_mode;
 
   /* Start by initializing all tables to contain CODE_FOR_nothing.  */
 
@@ -5620,6 +5621,11 @@ init_optabs (void)
   /* Fill in the optabs with the insns we support.  */
   init_all_optabs ();
 
+  /* The ffs function operates on `int'.  Fall back on it if we do not
+     have a libgcc2 function for that width.  */
+  int_mode = mode_for_size (INT_TYPE_SIZE, MODE_INT, 0);
+  ffs_optab->handlers[(int) int_mode].libfunc = init_one_libfunc ("ffs");
+
   /* Initialize the optabs with the names of the library functions.  */
   init_integral_libfuncs (add_optab, "add", '3');
   init_floating_libfuncs (add_optab, "add", '3');
@@ -5731,10 +5737,6 @@ init_optabs (void)
     abs_optab->handlers[TYPE_MODE (complex_double_type_node)].libfunc
       = init_one_libfunc ("cabs");
 
-  /* The ffs function operates on `int'.  */
-  ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)].libfunc
-    = init_one_libfunc ("ffs");
-
   abort_libfunc = init_one_libfunc ("abort");
   memcpy_libfunc = init_one_libfunc ("memcpy");
   memmove_libfunc = init_one_libfunc ("memmove");