Michael Tokarev | 1 Feb 10:26
Picon

Re: [patch 14/44] generic hweight{64,32,16,8}()

Andi Kleen wrote:
> On Wednesday 01 February 2006 10:02, Akinobu Mita wrote:
> 
>>+static inline unsigned int hweight32(unsigned int w)
[]
> How large are these functions on x86? Maybe it would be better to not inline them,
> but put it into some C file out of line.

hweight8	47 bytes
hweight16	76 bytes
hweight32	97 bytes
hweight64	56 bytes (NOT inlining hweight32)
hweight64	197 bytes (inlining hweight32)

Those are when compiled as separate non-inlined functions,
with pushl %ebp and ret.

/mjt

Andi Kleen | 1 Feb 11:24
Picon

Re: [patch 14/44] generic hweight{64,32,16,8}()

On Wednesday 01 February 2006 10:26, Michael Tokarev wrote:
> Andi Kleen wrote:
> > On Wednesday 01 February 2006 10:02, Akinobu Mita wrote:
> > 
> >>+static inline unsigned int hweight32(unsigned int w)
> []
> > How large are these functions on x86? Maybe it would be better to not inline them,
> > but put it into some C file out of line.
> 
> hweight8	47 bytes
> hweight16	76 bytes
> hweight32	97 bytes
> hweight64	56 bytes (NOT inlining hweight32)
> hweight64	197 bytes (inlining hweight32)
> 
> Those are when compiled as separate non-inlined functions,
> with pushl %ebp and ret.

This would argue for moving them out of line.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe ultralinux" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Akinobu Mita | 2 Feb 13:50
Favicon

Re: [patch 14/44] generic hweight{64,32,16,8}()

On Wed, Feb 01, 2006 at 11:24:27AM +0100, Andi Kleen wrote:
> On Wednesday 01 February 2006 10:26, Michael Tokarev wrote:
> > Andi Kleen wrote:
> > > On Wednesday 01 February 2006 10:02, Akinobu Mita wrote:
> > > 
> > >>+static inline unsigned int hweight32(unsigned int w)
> > []
> > > How large are these functions on x86? Maybe it would be better to not inline them,
> > > but put it into some C file out of line.
> > 
> > hweight8	47 bytes
> > hweight16	76 bytes
> > hweight32	97 bytes
> > hweight64	56 bytes (NOT inlining hweight32)
> > hweight64	197 bytes (inlining hweight32)
> > 
> > Those are when compiled as separate non-inlined functions,
> > with pushl %ebp and ret.
> 
> This would argue for moving them out of line.

This patch will put hweight*() into lib/hweight.c

Index: 2.6-git/include/asm-generic/bitops/hweight.h
===================================================================
--- 2.6-git.orig/include/asm-generic/bitops/hweight.h
+++ 2.6-git/include/asm-generic/bitops/hweight.h
@@ -1,54 +1,9 @@
 #ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_
 #define _ASM_GENERIC_BITOPS_HWEIGHT_H_
(Continue reading)

Akinobu Mita | 9 Feb 06:55
Favicon

[PATCH] alpha: remove __alpha_cix__ and __alpha_fix__

On Thu, Feb 02, 2006 at 09:50:07PM +0900, mita wrote:
> This patch will put hweight*() into lib/hweight.c

I realized that this patch broke ia64 and alpha.
I want to fix it by making new config option like CONFIG_GENERIC_HWEIGHT.
But there is a difficulty to define CONFIG_GENERIC_HWEIGHT on alpha.
So I want to add the patch below. Does it cause anything bad?

Index: 2.6-git/arch/alpha/lib/ev6-memchr.S
===================================================================
--- 2.6-git.orig/arch/alpha/lib/ev6-memchr.S
+++ 2.6-git/arch/alpha/lib/ev6-memchr.S
@@ -84,7 +84,7 @@ $last_quad:
         beq     $2, $not_found	# U : U L U L

 $found_it:
-#if defined(__alpha_fix__) && defined(__alpha_cix__)
+#ifdef CONFIG_ALPHA_EV67
 	/*
 	 * Since we are guaranteed to have set one of the bits, we don't
 	 * have to worry about coming back with a 0x40 out of cttz...
Index: 2.6-git/arch/alpha/lib/fpreg.c
===================================================================
--- 2.6-git.orig/arch/alpha/lib/fpreg.c
+++ 2.6-git/arch/alpha/lib/fpreg.c
@@ -4,7 +4,7 @@
  * (C) Copyright 1998 Linus Torvalds
  */

-#if defined(__alpha_cix__) || defined(__alpha_fix__)
(Continue reading)

Richard Henderson | 9 Feb 20:12

Re: [PATCH] alpha: remove __alpha_cix__ and __alpha_fix__

On Thu, Feb 09, 2006 at 02:55:31PM +0900, Akinobu Mita wrote:
> -#if defined(__alpha_fix__) && defined(__alpha_cix__)
> +#ifdef CONFIG_ALPHA_EV67

What in the world is this supposed to fix?  You aren't seriously
suggesting that the compiler has stopped defining these, have you?

r~
Akinobu Mita | 10 Feb 06:40
Favicon

Re: [PATCH] alpha: remove __alpha_cix__ and __alpha_fix__

On Thu, Feb 09, 2006 at 11:12:36AM -0800, Richard Henderson wrote:
> On Thu, Feb 09, 2006 at 02:55:31PM +0900, Akinobu Mita wrote:
> > -#if defined(__alpha_fix__) && defined(__alpha_cix__)
> > +#ifdef CONFIG_ALPHA_EV67
> 
> What in the world is this supposed to fix?  You aren't seriously
> suggesting that the compiler has stopped defining these, have you?

I just want to imply the use of optimized hweight*() routines to
kbuild system.  In other word I want to tell the kbuild system
the condition of "defined(__alpha_fix__) && defined(__alpha_cix__)".

So I suggested to add previous patch and write below lines in
arch/alpha/Kconfig

config GENERIC_HWEIGHT
        bool
        default y if !ALPHA_EV6 && !ALPHA_EV67

Also, I wonder why there are such gcc builtin definition in kernel code.
Even if the gcc built with the support architecture extensions like CIX
and FIX, It doesn't mean the vmlinux built by that gcc always run
on those machines.

Akinobu Mita | 2 Feb 13:50
Favicon

Re: [patch 14/44] generic hweight{64,32,16,8}()

On Wed, Feb 01, 2006 at 11:24:27AM +0100, Andi Kleen wrote:
> On Wednesday 01 February 2006 10:26, Michael Tokarev wrote:
> > Andi Kleen wrote:
> > > On Wednesday 01 February 2006 10:02, Akinobu Mita wrote:
> > > 
> > >>+static inline unsigned int hweight32(unsigned int w)
> > []
> > > How large are these functions on x86? Maybe it would be better to not inline them,
> > > but put it into some C file out of line.
> > 
> > hweight8	47 bytes
> > hweight16	76 bytes
> > hweight32	97 bytes
> > hweight64	56 bytes (NOT inlining hweight32)
> > hweight64	197 bytes (inlining hweight32)
> > 
> > Those are when compiled as separate non-inlined functions,
> > with pushl %ebp and ret.
> 
> This would argue for moving them out of line.

This patch will put hweight*() into lib/hweight.c

Index: 2.6-git/include/asm-generic/bitops/hweight.h
===================================================================
--- 2.6-git.orig/include/asm-generic/bitops/hweight.h
+++ 2.6-git/include/asm-generic/bitops/hweight.h
@@ -1,54 +1,9 @@
 #ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_
 #define _ASM_GENERIC_BITOPS_HWEIGHT_H_
(Continue reading)

Andi Kleen | 1 Feb 11:24
Picon

Re: [patch 14/44] generic hweight{64,32,16,8}()

On Wednesday 01 February 2006 10:26, Michael Tokarev wrote:
> Andi Kleen wrote:
> > On Wednesday 01 February 2006 10:02, Akinobu Mita wrote:
> > 
> >>+static inline unsigned int hweight32(unsigned int w)
> []
> > How large are these functions on x86? Maybe it would be better to not inline them,
> > but put it into some C file out of line.
> 
> hweight8	47 bytes
> hweight16	76 bytes
> hweight32	97 bytes
> hweight64	56 bytes (NOT inlining hweight32)
> hweight64	197 bytes (inlining hweight32)
> 
> Those are when compiled as separate non-inlined functions,
> with pushl %ebp and ret.

This would argue for moving them out of line.

-Andi


Gmane