public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: libc-hacker@sources.redhat.com
Subject: [PATCH] Fix __clz_tab
Date: Thu, 14 Mar 2002 09:38:00 -0000	[thread overview]
Message-ID: <20020314183755.C2204@sunsite.ms.mff.cuni.cz> (raw)
In-Reply-To: <1016061212.6837.1083.camel@myware.mynet>; from drepper@redhat.com on Wed, Mar 13, 2002 at 03:13:32PM -0800

On Wed, Mar 13, 2002 at 03:13:32PM -0800, Ulrich Drepper wrote:
> > it is
> > just not needed anywhere on certain arches. I'd think the best thing to do
> > would be to put them back, make __clz_tab hidden (but am not sure if
> > it should be in stdlib/longlong.h header (as e.g. gcc is not interested in
> > such changes),
> 
> The file is not going back for all archs.  Any change will have to
> happen in an architecture-dependent Makefile.  How the attribute is
> added is another problem.

Something like this (I haven't bothered with attribute_hidden for it yet)?
I think the default should be to compile __clz_tab in, since
from currently supported glibc major architectures it is needed for 10 and
not needed for 3.

2002-03-14  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/generic/mp_clz_tab.c: New.
	* sysdeps/i386/mp_clz_tab.c: New.
	* sysdeps/hppa/mp_clz_tab.c: New.
	* sysdeps/powerpc/mp_clz_tab.c: New.
	* stdlib/Makefile (aux): Revert last patch.
	* math/Makefile (gmp-objs): Likewise.

--- libc/math/Makefile.jj	Wed Mar 13 07:53:21 2002
+++ libc/math/Makefile	Thu Mar 14 08:00:28 2002
@@ -183,7 +183,7 @@ o = .os
 endif
 gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%$o,\
 		      add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \
-		      lshift rshift udiv_qrnnd inlines)
+		      lshift rshift mp_clz_tab udiv_qrnnd inlines)
 $(objpfx)atest-exp: $(gmp-objs)
 $(objpfx)atest-sincos: $(gmp-objs)
 $(objpfx)atest-exp2: $(gmp-objs)
--- libc/stdlib/Makefile.jj	Thu Mar 14 06:20:28 2002
+++ libc/stdlib/Makefile	Thu Mar 14 08:01:28 2002
@@ -70,9 +70,7 @@ mpn-headers = longlong.h gmp.h gmp-impl.
 routines := $(strip $(routines) $(mpn-routines))	\
 	    dbl2mpn ldbl2mpn				\
 	    mpn2flt mpn2dbl mpn2ldbl
-# mp_clz seems not to be used.  At least on x86.  If removing the file
-# does not cause problem clean this up and actually remove the file.
-aux := fpioconst# mp_clz_tab
+aux := fpioconst mp_clz_tab
 distribute := $(distribute) $(mpn-headers) gen-mpn-copy fpioconst.h
 
 generated += isomac isomac.out
--- libc/sysdeps/generic/mp_clz_tab.c.jj	Thu Mar 14 08:04:35 2002
+++ libc/sysdeps/generic/mp_clz_tab.c	Mon Jul  9 14:57:52 2001
@@ -0,0 +1,37 @@
+/* __clz_tab -- support for longlong.h
+   Copyright (C) 1991, 1993, 1994, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  Its master source is NOT part of
+   the C library, however.  The master source lives in the GNU MP Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if 0
+#include "gmp.h"
+#include "gmp-impl.h"
+#endif
+
+const
+unsigned char __clz_tab[] =
+{
+  0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+  6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+  8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+};
--- libc/sysdeps/hppa/mp_clz_tab.c.jj	Thu Mar 14 08:06:11 2002
+++ libc/sysdeps/hppa/mp_clz_tab.c	Thu Mar 14 08:06:11 2002
@@ -0,0 +1 @@
+/* __clz_tab not needed on hppa.  */
--- libc/sysdeps/i386/mp_clz_tab.c.jj	Thu Mar 14 08:05:58 2002
+++ libc/sysdeps/i386/mp_clz_tab.c	Thu Mar 14 08:05:58 2002
@@ -0,0 +1 @@
+/* __clz_tab not needed on i386.  */
--- libc/sysdeps/powerpc/mp_clz_tab.c.jj	Thu Mar 14 08:06:29 2002
+++ libc/sysdeps/powerpc/mp_clz_tab.c	Thu Mar 14 08:06:29 2002
@@ -0,0 +1 @@
+/* __clz_tab not needed on powerpc.  */


	Jakub

  reply	other threads:[~2002-03-14 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3C8F6C22.6B38A19E@iol.unh.edu>
2002-03-13  8:36 ` [PATCH] Fix _itoa_lower_digits (was Re: bootstrap 2.95 libc not building on alpha) Jakub Jelinek
2002-03-13 15:13   ` Ulrich Drepper
2002-03-14  9:38     ` Jakub Jelinek [this message]
2002-03-14 12:45       ` [PATCH] Fix __clz_tab Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020314183755.C2204@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).