Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Boolean & alpha &X11R6 et al
@ 1998-02-25 13:59 Uncle George
  0 siblings, 0 replies; 9+ messages in thread
From: Uncle George @ 1998-02-25 13:59 UTC (permalink / raw)


does anyone know what Boolean cant be defined as int, or long on an
alpha? it seems that the current definition of char would not be in the
best interests considering the alpha architecture.
gat

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
@ 1998-02-25 14:58 Stefan Schroepfer
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Schroepfer @ 1998-02-25 14:58 UTC (permalink / raw)


Uncle George ( Garlic Pizza Specialist ) wrote:
> 
> does anyone know what Boolean cant be defined as int, or long on an
> alpha? it seems that the current definition of char would not be in the
> best interests considering the alpha architecture.

Why not simply take long? In C++, sizeof (bool) == 8.

scr@iis.fhg.de

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
@ 1998-02-25 16:26 Uncle George
  0 siblings, 0 replies; 9+ messages in thread
From: Uncle George @ 1998-02-25 16:26 UTC (permalink / raw)


I mean change the concept of Boolean for all of X11R6 et al. from char
->int/long!

Stefan Schroepfer wrote:

> Uncle George ( Garlic Pizza Specialist ) wrote:
> >
> > does anyone know what Boolean cant be defined as int, or long on an
> > alpha? it seems that the current definition of char would not be in the
> > best interests considering the alpha architecture.
>
> Why not simply take long? In C++, sizeof (bool) == 8.
>
> scr@iis.fhg.de
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
@ 1998-02-25 16:32 Uncle George
  0 siblings, 0 replies; 9+ messages in thread
From: Uncle George @ 1998-02-25 16:32 UTC (permalink / raw)


an array of Boolean? would be nice BUT not too many people do just that.
most just say if ( foo )

maybe the alpha 21164 has the 8/16 bit instruction - should i build two
products - one for 21064, and another for the 21164?

does anyone know how to get gcc to do char/short instructions?
gat

H. Peter Anvin wrote:

> > does anyone know what Boolean cant be defined as int, or long on an
> > alpha? it seems that the current definition of char would not be in the
> > best interests considering the alpha architecture.
> > gat
>
> Not if you're defining an array of it; think about it...
>
> By the way, the 21164 has 8- and 16-bit access instructions.
>
>         -hpa

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
@ 1998-02-25 16:44 Richard Gorton
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Gorton @ 1998-02-25 16:44 UTC (permalink / raw)


>I mean change the concept of Boolean for all of X11R6 et al. from char
>->int/long!
>
>Stefan Schroepfer wrote:
>
> Uncle George ( Garlic Pizza Specialist ) wrote:
> >
> > does anyone know what Boolean cant be defined as int, or long on an
> > alpha? it seems that the current definition of char would not be in the
> > best interests considering the alpha architecture.
>
> Why not simply take long? In C++, sizeof (bool) == 8.
>

Why change it?  What is gained by changing it?  In reality, a boolean
is a '1' or a '0', but has been implemented as an 8-bit-byte for convenience
on most platforms for most languages.  Languages which have built-in bit
strings or bit datatypes may choose to implement this as a single bit.
I know that some implementations of PL/I do this (yeah, it still exists - I
worked on a UNIX compiler for PL/I).  Choosing a relatively small
implementation for a boolean is beneficial for a variety of reasons:

	- Direct memory/disk savings.
	  Storing a byte in memory vs. 4 bytes (or 8 if a long is used on Alpha)
	  is a significant memory savings.  Would you be annoyed if your
	  executables in size by 10%?  I would.  The 10% number is a total
	  guess, but consider that boolean variables sitting in the .data
	  section (and elsewhere in the object file) now get much larger.
	  Same situation with local (stack) and heap (malloc) variables.
	  Consider the size increase of your OS kernel...
	- Indirect memory effects (cache)
	  Bigger memory footprints frequently translate into slower
	  executing programs, for instruction and data caches.
	- Executable size/speed
	  On CISC machines, the size of the instructions to perform
	  32-bit (or larger) operations may take up more bytes of
	  code than the size of the instructions to perform the same
	  operations on single-byte data.  This isn't particularly
	  relevant on RISC machines.
	- Source code compatability with old code
	  Any pre-existing code which has unions of booleans
	  and or/assumptions about sizeof(char) == sizeof(boolean)
	  currently works.  Changing this could possibly require
	  significant recoding.  It's not necessarily good or bad,
	  it just requires work.

It can be done, but there are non-trivial drawbacks to doing so.
If memory and disk were free, then it might make more sense.

	Rick

Richard Gorton			All standard disclaimers apply.
AMT/Digital Semiconductor	Projects: DECmigrate (mx), FreePort Express,
Digital Equipment Corporation		  Linux/Alpha, JavaOS, StrongARM,
Reply-to: gorton@tallis.enet.dec.com	  Network Computers (SHARK)
http://www.digital.com/info/semiconductor/amt	

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
@ 1998-02-25 16:52 Richard Gorton
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Gorton @ 1998-02-25 16:52 UTC (permalink / raw)


>does anyone know how to get gcc to do char/short instructions?

Pick up a copy of gcc-2.8.0, gcc-2.8.1 (released real soon now),
or egcs (any), and build it for your system.  The binutils on RH 4.2
do _NOT_ recognize the new instructions, so you'll need to upgrade
those to be able to assemble code that uses said instructions.
Last time I checked, you have to explicitly tell egcs that you want
the default to be to generate those instructions.  gcc configures seem
to assume that it should try to generate code using those instructions
if your machine will support them.  In general, expect to see somewhere
between a 5-20% performance improvement in code which utilizes these
instructions.

>maybe the alpha 21164 has the 8/16 bit instruction - should i build two
>products - one for 21064, and another for the 21164?

I would say "don't bother with a 21064 version", but then, my job
is to create software to move _new_ chips/systems, so to me, the 21064
is irrelevant.  To be perfectly honest, I think the PC164SX machines
are inexepensive enough that you can reasonably tell commercial customers
that they really need to have a machine with a 21164 in it, and then
charge extra for the 21064 version (after all, if you have to do
extra work to support it...)

	Regards,

		Rick

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
@ 1998-02-25 16:59 Uncle George
  0 siblings, 0 replies; 9+ messages in thread
From: Uncle George @ 1998-02-25 16:59 UTC (permalink / raw)


how lomg does it take to do a Boolean test using char, how long for int, or for that
matter a long.
Now repeat that for all the tests u do during a run.
I dont know where the break even point is, but i suspect that a char Boolean is
expensive on the alpha ( as it is on the 21064 line of processors ).

btw DEC still selling those gigabyte mem machines ? ;-)

Richard Gorton wrote:

> >I mean change the concept of Boolean for all of X11R6 et al. from char
> >->int/long!
> >
> >Stefan Schroepfer wrote:
> >
> > Uncle George ( Garlic Pizza Specialist ) wrote:
> > >
> > > does anyone know what Boolean cant be defined as int, or long on an
> > > alpha? it seems that the current definition of char would not be in the
> > > best interests considering the alpha architecture.
> >
> > Why not simply take long? In C++, sizeof (bool) == 8.
> >
>
> Why change it?  What is gained by changing it?  In reality, a boolean
> is a '1' or a '0', but has been implemented as an 8-bit-byte for convenience
> on most platforms for most languages.  Languages which have built-in bit
> strings or bit datatypes may choose to implement this as a single bit.
> I know that some implementations of PL/I do this (yeah, it still exists - I
> worked on a UNIX compiler for PL/I).  Choosing a relatively small
> implementation for a boolean is beneficial for a variety of reasons:
>
>         - Direct memory/disk savings.
>           Storing a byte in memory vs. 4 bytes (or 8 if a long is used on Alpha)
>           is a significant memory savings.  Would you be annoyed if your
>           executables in size by 10%?  I would.  The 10% number is a total
>           guess, but consider that boolean variables sitting in the .data
>           section (and elsewhere in the object file) now get much larger.
>           Same situation with local (stack) and heap (malloc) variables.
>           Consider the size increase of your OS kernel...
>         - Indirect memory effects (cache)
>           Bigger memory footprints frequently translate into slower
>           executing programs, for instruction and data caches.
>         - Executable size/speed
>           On CISC machines, the size of the instructions to perform
>           32-bit (or larger) operations may take up more bytes of
>           code than the size of the instructions to perform the same
>           operations on single-byte data.  This isn't particularly
>           relevant on RISC machines.
>         - Source code compatability with old code
>           Any pre-existing code which has unions of booleans
>           and or/assumptions about sizeof(char) == sizeof(boolean)
>           currently works.  Changing this could possibly require
>           significant recoding.  It's not necessarily good or bad,
>           it just requires work.
>
> It can be done, but there are non-trivial drawbacks to doing so.
> If memory and disk were free, then it might make more sense.
>
>         Rick
>
> Richard Gorton                  All standard disclaimers apply.
> AMT/Digital Semiconductor       Projects: DECmigrate (mx), FreePort Express,
> Digital Equipment Corporation             Linux/Alpha, JavaOS, StrongARM,
> Reply-to: gorton@tallis.enet.dec.com      Network Computers (SHARK)
> http://www.digital.com/info/semiconductor/amt
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean & alpha &X11R6 et al
       [not found] <34F44DD6.2E6E6B4@voicenet.com>
@ 1998-02-25 18:20 ` Michal Jaegermann
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Jaegermann @ 1998-02-25 18:20 UTC (permalink / raw)


> 
> how lomg does it take to do a Boolean test using char, how long for int, or for that
> matter a long.

On an assembler level probably just about the same (jump on a value
of a non-zero status flag), but I did not check that and I am very far
from beeing an Alpha assmebler guru. :-)

If storing boolean characters in structures used by X is underneath
all these "unaligned access" traps from X, then a change could have
a performance impact.  But this hypothesis would have to be tested
first.

  Michal

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

* Re: Boolean &amp; alpha &amp;X11R6 et al
@ 1998-02-25 19:51 Uncle George
  0 siblings, 0 replies; 9+ messages in thread
From: Uncle George @ 1998-02-25 19:51 UTC (permalink / raw)


as of yet there are no char fetch/store instructions for the alpha gcc compiler ( for the
21164 processor there are instructions, but compiler hasn't been educated yet )

u in essence have to:
    1) fetch a long
     2) isolate the char in the long
      3) test the character.
      4) do ur branch
( it is much better written in the assembler book )

for storing u have to
    1) fetch the long
     2) mask out the char in the long
      3) or in the new value
      4) store the long

gat

Michal Jaegermann wrote:

> >
> > how lomg does it take to do a Boolean test using char, how long for int, or for that
> > matter a long.
>
> On an assembler level probably just about the same (jump on a value
> of a non-zero status flag), but I did not check that and I am very far
> from beeing an Alpha assmebler guru. :-)
>
> If storing boolean characters in structures used by X is underneath
> all these "unaligned access" traps from X, then a change could have
> a performance impact.  But this hypothesis would have to be tested
> first.
>
>   Michal
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

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

end of thread, other threads:[~1998-02-25 19:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-02-25 16:32 Boolean &amp; alpha &amp;X11R6 et al Uncle George
  -- strict thread matches above, loose matches on Subject: below --
1998-02-25 19:51 Uncle George
     [not found] <34F44DD6.2E6E6B4@voicenet.com>
1998-02-25 18:20 ` Michal Jaegermann
1998-02-25 16:59 Uncle George
1998-02-25 16:52 Richard Gorton
1998-02-25 16:44 Richard Gorton
1998-02-25 16:26 Uncle George
1998-02-25 14:58 Stefan Schroepfer
1998-02-25 13:59 Uncle George

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox