public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: sjm <smorris@xionics.com>
To: gw32 <gnu-win32@cygnus.com>
Subject: Re: long long vs long
Date: Thu, 23 Jul 1998 11:42:00 -0000	[thread overview]
Message-ID: <9807231347.AA10987@frodo> (raw)

Earnie Boyd writes:
 > Or why not set a new standard something like
 > 
 > int8, int16, int32, int64 to indicate the number of bits.

Right! The ambiguity of variable sizes has been the most unportable feature of
C. I know why they did it but it is still a pain. In those days the world
hadn't decided whether word sizes would be a multiple of 6 or 8 bits.
Implementing a 32 bit data type on an 18 bit (or 24 bit) machine would have
been a disaster. Some machines would have wanted int6, int12, int18 and int24
as bacic integer sizes. It was better to leave word sizes ambiguous and accept
the portability problem.

Did you ever wonder why octal was so popular and why many C constants were
originally only defineable as octal? Octal makes sense in an environment with
word sizes of multiples of 3 bits. Hex is only useful with multiples of 4
bits.

For those who don't remember, early DEC and IBM machines were 6 bit based. For
example the PDP-8 has a 12 bit word size. The IBM 360 was 36 bits. Radix 6
character encoding was quit popular on such machines.

Even worse, many processors only supported one word size. For example special
code needed to be emitted to access bytes on the 16 bit Nova machines. There
were no byte instructions; a lot of shifting and masking. That is what "int"
was for. It was intended to be the native "fast" data type that could be
accessed with single instructions. On a 16 bit machine a 32 bit word was
accessed as two words and implemented as multiple word arithmetic. Of course
that is how "long long" is implemented on most machines today.

Now that bytes have become a defacto standard for word size multiple and
variable word size inctructions exist everywhere one would think C could move
forward. Then again maybe intel is going to jump from variable 64 to a fixed
96 bits for the p96 generation.

Steve Morris
sjm@judgement.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

             reply	other threads:[~1998-07-23 11:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-23 11:42 sjm [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-08-04 16:53 dahms
1998-08-01  2:01 Joerg Pommnitz
1998-07-29 16:23 dahms
1998-07-27 18:55 dahms
1998-07-24 12:58 Earnie Boyd
1998-07-24  5:20 Robert.Cross
1998-07-23 11:42 Martin Portmann
1998-07-22 17:12 John Estabrook
1998-07-22 10:06 Earnie Boyd
1998-07-23  0:43 ` $Bill Luebkert
1998-07-21  1:55 Graham Murray
1998-07-22  6:17 ` Harry Broomhall
1998-07-22 13:57 ` Nicholas R LeRoy
1998-07-22 13:57 ` Michael H. Warfield
1998-07-23  6:15   ` Harry Broomhall
1998-07-23 13:02   ` Matthew Donadio
1998-07-23 15:30   ` Timothy Writer
1998-07-24 12:58     ` Matthew Donadio
1998-07-25  0:08     ` Larry Hall
1998-07-25  1:22       ` Timothy Writer
1998-07-24 12:58   ` Benjamin Riefenstahl
1998-07-22 16:50 ` Michael Weiser
1998-07-23  8:33   ` Harry Broomhall
1998-07-23 19:01     ` Michael Weiser
1998-07-24  5:20       ` Harry Broomhall
1998-07-25  0:08         ` Mumit Khan
1998-07-26  9:27           ` sjm
     [not found]           ` <9807261625.AA18550.cygnus.gnu-win32@frodo>
1998-07-28  0:57             ` Christopher G. Faylor
1998-07-27 14:23         ` Michael Weiser
1998-07-25  1:22       ` Timothy Writer
1998-07-28  0:57         ` Michael Weiser
1998-07-24  0:25     ` massimo morara
1998-07-23  8:33   ` Brian Osman
1998-07-27 14:23     ` Michael Weiser
1998-07-22 17:12 ` Andrew Sharp
     [not found] <Michael>
     [not found] ` <H.>
     [not found]   ` <Warfield"'s>
     [not found]     ` <message>
     [not found]       ` <of>
     [not found]         ` <"Wed,>
     [not found]           ` <22>
     [not found]             ` <Jul>
     [not found]               ` <1998>
     [not found]                 ` <11:08:42>
     [not found]                   ` <-0400>

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=9807231347.AA10987@frodo \
    --to=smorris@xionics.com \
    --cc=gnu-win32@cygnus.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).