All of lore.kernel.org
 help / color / mirror / Atom feed
[parent not found: <42B91C1400005075@mail-1-bnl.tiscali.it>]
[parent not found: <200507051816.j65IGuIY028621@hiauly1.hia.nrc.ca>]
[parent not found: <42C81991.6030502@tiscali.be>]
* Re: [parisc-linux] [gcc] should we teach gcc some new tricks?
@ 2005-06-23  7:19 Joel Soete
  2005-06-23 13:09 ` John David Anglin
  0 siblings, 1 reply; 43+ messages in thread
From: Joel Soete @ 2005-06-23  7:19 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

...
>
> /* Parse the -mfixed-range=3D option string.  */
>
> static void
> fix_range (const char *const_str)
> {
>   int i, first, last;
>   char *str, *dash, *comma;
>
>   /* str must be of the form REG1'-'REG2{,REG1'-'REG} where REG1 and
>   REG2 are either register names or register numbers.  The effect
>   of this option is to mark the registers in the range from REG1 to
>   REG2 as ``fixed'' so they won't be used by the compiler.  This is
>   used, e.g., to ensure that kernel mode code doesn't use f32-f127.  */=

>
That confirms well the gcc info description:
`-mfixed-range=3DREGISTER-RANGE'
      Generate code treating the given register range as fixed registers.=

      A fixed register is one that the register allocator can not use.
      This is useful when compiling kernel code. A register range is
      specified as two registers separated by a dash. Multiple register
      ranges can be specified separated by a comma.
 ;-)

> You are probably best to use register names.
I would prefer too.

> There are 28 fp registers
> starting at fr4.  The number for fr4 is 32.  I see there is a typo
> in the comment regarding the range, "f32-f127".  This is a cut and
> paste error.
>
Nice add on (tx),

> The millicode routines don't use the fp regs.  However, libgcc does
> and the kernel is linked against libgcc.  Thus, for this to work, you
> will need to build both a kernel build version of gcc and the kernel
> with the -mfixed-range option.  You probably want to leave about four
> fp registers unfixed for integer multiplcation.  This is essential on
> hppa64 as we don't have millicode support for 64-bit integer
> multiplication.  This support is provided by libgcc routines.
>
my main interest is still 32bit kernel  for the moment(the most of my sys=
tems
 b180,  c110, d380 ;-)):
2.6.8 ans 2.6.9-rc2-pa1 works fine when compiled with -mdisable-fpregs op=
tion
but panicing quickly whitout?

And effectively with -mdisable-fpregs option a function like <do_setitime=
r>
(amoung others) used __muldi3 as in:
[...]
1012b630:       e8 4b 01 61     b,l 101016e8 <__muldi3>,rp
[...]
1012b650:       e8 4b 01 21     b,l 101016e8 <__muldi3>,rp
1012b654:       08 03 02 5a     copy r3,r26
[...]

while without it obviously compile something like:
[...]
1012ba00:       27 88 10 16     fldw 4(,ret0),fr22
1012ba04:       30 00 40 16     fcpy,sgl fr0,fr22
1012ba08:       37 b6 1c 29     ldo -11ec(ret1),r22
1012ba0c:       22 bc 8d 1a     ldil 68db8000,r21
1012ba10:       27 c1 12 16     fstw fr22,-10(,sp)
1012ba14:       36 b8 17 5a     ldo bad(r21),r24
1012ba18:       34 01 1f fe     ldi fff,r1
1012ba1c:       34 02 3f ff     ldi -1,rp
1012ba20:       22 a6 22 06     ldil 1030d000,r21
1012ba24:       0f c1 10 93     ldw -10(,sp),r19
1012ba28:       36 b5 09 a0     ldo 4d0(r21),r21
1012ba2c:       2e a0 10 17     fldd 0(,r21),fr23
1012ba30:       d2 77 1c 1f     extrw,s r19,0,1,r23
1012ba34:       3a d7 57 17     xmpyu fr22,fr23R,fr23
1012ba38:       0b 17 02 17     and r23,r24,r23
1012ba3c:       2f c1 12 17     fstd fr23,-10(,sp)
[...]

But that doesn't make me yet understand what it could make as side effect=

versus
the 64bit twin kernel??

I still have to learn more ;-)

Thanks a lot,
    Joel


_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 43+ messages in thread
[parent not found: <200505031334.j43DYRBT004104@hiauly1.hia.nrc.ca>]
* [parisc-linux] [gcc] should we teach gcc some new tricks?
@ 2005-03-24 13:07 Randolph Chung
  2005-03-24 13:27 ` James A. Morrison
  0 siblings, 1 reply; 43+ messages in thread
From: Randolph Chung @ 2005-03-24 13:07 UTC (permalink / raw)
  To: parisc-linux

i've been looking at the extreme slowness of ext3 during some workloads.
came across this bit of code... not that it will make any difference,
but i wonder if we can make gcc a bit smarter?

given this bit of C code:

static inline int test_bit(int nr, const void * addr)
{
	const unsigned char *ADDR = (const unsigned char *) addr;
	return (ADDR[nr >> 3] >> (nr & 7)) & 1;
}

int proc1(int nr, int foo)
{
	int ret;
	char *buf1, *buf2;

	if (test_bit(nr, buf1))
		return 0;

	if (foo)
		ret = 1;
	else
		ret = !test_bit(nr, buf2);
	return ret;
}

int proc2(int nr, int foo)
{
	char *buf1, *buf2;

	if (test_bit(nr, buf1))
		return 0;

	if (foo)
		return 1;
	else
		return !test_bit(nr, buf2);
}

i would have expected gcc to produce the same code for proc1() and
proc2() (and in fact it does for 32-bit), but for 64-bit, proc2() is 2
insn shorter than proc1().  it seems like there are also some
opportunities for further optimizations if gcc can recognize that the
return value can only be 0 or 1, so the sign extension (?) extrd insn at
the end is not needed, and we can deposit the result directly into ret0
instead of r20. that should save us 2 insns.

.globl proc2
	.type	proc2, @function
proc2:
	.PROC
	.CALLINFO FRAME=0,NO_CALLS
	.ENTRY
	extrd,s %r26,63,32,%r26
	extrw,u %r26,31,3,%r19
	extrd,s %r25,63,32,%r25
	mtsarcm %r19
	extrd,s %r26,60,61,%r26
	ldb %r26(%r20),%r19
	extrw,s %r19,%sar,32,%r19
	bb,*< %r19,63,.L10
	ldi 0,%r28
	ldi 1,%r28
	cmpb,*<> %r0,%r25,.L10
	ldi 0,%r20
	ldb %r26(%r21),%r19
	extrw,s %r19,%sar,32,%r19
	extrd,s,*< %r19,63,1,%r0
	ldi 1,%r20
	extrd,s %r20,63,32,%r28
.L10:
	bve,n (%r2)
	.EXIT
	.PROCEND

is this worth looking into? :)
randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2005-07-09 15:42 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <42B91C1400000F85@mail-1-bnl.tiscali.it>
2005-06-25  6:46 ` [parisc-linux] [gcc] should we teach gcc some new tricks? John David Anglin
2005-06-25  8:29   ` Joel Soete
2005-07-01 13:43     ` Joel Soete
     [not found] <42B91C1400005075@mail-1-bnl.tiscali.it>
2005-07-09 15:42 ` Joel Soete
     [not found] <200507051816.j65IGuIY028621@hiauly1.hia.nrc.ca>
2005-07-06 16:40 ` Joel Soete
2005-07-06 17:00   ` John David Anglin
     [not found] <42C81991.6030502@tiscali.be>
2005-07-03 18:47 ` John David Anglin
2005-07-04 14:51   ` Joel Soete
2005-07-05 14:59     ` Joel Soete
2005-07-07  1:27     ` John David Anglin
2005-06-23  7:19 Joel Soete
2005-06-23 13:09 ` John David Anglin
     [not found] <200505031334.j43DYRBT004104@hiauly1.hia.nrc.ca>
2005-05-03 17:58 ` Joel Soete
2005-05-03 19:00   ` John David Anglin
  -- strict thread matches above, loose matches on Subject: below --
2005-03-24 13:07 Randolph Chung
2005-03-24 13:27 ` James A. Morrison
2005-03-24 16:19   ` John David Anglin
2005-03-24 16:59     ` Grant Grundler
2005-03-24 17:35       ` John David Anglin
2005-03-24 21:23         ` Grant Grundler
     [not found]           ` <200503242133.j2OLXl4R020985@hiauly1.hia.nrc.ca>
2005-03-24 22:33             ` Grant Grundler
2005-03-24 23:34               ` John David Anglin
2005-03-24 23:55                 ` Randolph Chung
2005-03-24 23:59                   ` Randolph Chung
2005-03-25  0:07                   ` John David Anglin
2005-06-22 19:54             ` Joel Soete
2005-06-23  3:23               ` John David Anglin
2005-06-23  5:27               ` Grant Grundler
2005-06-23  6:10                 ` Joel Soete
2005-03-24 19:37       ` James A. Morrison
2005-03-24 21:33         ` Grant Grundler
2005-03-26  8:55       ` Matthias Klose
2005-03-26 15:48         ` John David Anglin
2005-03-26 21:35           ` Grant Grundler
     [not found]           ` <16971.44399.144991.110733@gargle.gargle.HOWL>
2005-03-29  1:36             ` John David Anglin
2005-03-31 12:08             ` Michael S. Zick
2005-05-02 18:37           ` Joel Soete
2005-05-02 19:01             ` John David Anglin
2005-05-02 20:20               ` John David Anglin
2005-05-02 20:46                 ` John David Anglin
2005-05-05 16:20                   ` Joel Soete
2005-05-05 17:07                     ` John David Anglin
2005-05-05 18:41                       ` Joel Soete

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.