unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@twinsun.com>
Cc: raeburn@raeburn.org, emacs-devel@gnu.org
Subject: Re: 64-bit lossage
Date: Fri, 2 Aug 2002 17:03:42 -0700 (PDT)	[thread overview]
Message-ID: <200208030003.g7303g815713@green.twinsun.com> (raw)
In-Reply-To: <200208022213.g72MDa201780@aztec.santafe.edu> (rms@gnu.org)

> Date: Fri, 2 Aug 2002 16:13:36 -0600 (MDT)
> From: Richard Stallman <rms@gnu.org>
> 
>     can't we increase address space and improve performance on both
>     32- and 64-bit hosts, without widening Lisp_Object, by moving
>     the 4 tag bits to the low-order end of the Lisp_Object, and
>     ensuring that all non-Lisp_Int objects are aligned at a multiple of 16?
> 
> A cons cell is 8 bytes, so it would have to be a multiple of 8.

That could be arranged by sort of a Huffman coding for type bits, as
Ken Raeburn suggested.  E.g., if M denotes a mark bit and XX...X
denotes 28 value bits, we could do this:

 XX...X000M Lisp_Int
 XX...XX01M Lisp_Cons (note that it has 29 value bits)
 XX...X010M Lisp_Symbol
 XX...X011M Lisp_Misc
 XX...X100M Lisp_String
 XX...X110M Lisp_VectorLike
 XX...X111M Lisp_Float

Lisp_Symbol etc. would need to be on 16-byte boundaries, but that
could be arranged too.  Of course we don't need such niceties on
64-bit hosts, but even there I think it would be a performance win to
move the tag bits to the low-order end.

> Anyway, is the limiting factor really address space for Lisp objects?
> If the issue is the size of a single buffer, that is concerned
> with the range of integers, not addresses of Lisp objects.

To represent Elisp integers that do not fit in 28 bits, we could use
floating point.  IEEE-floating-point hosts will give us integers up to
2**51, which is enough.  There is room for a marker bit in 'struct
Lisp_Float.type' to say "This number is really an integer, and
operations like integerp should treat it as one".

(Another possibility is to use bignums, but I assume you've already
considered this.)

At the C level, buffer-size-related integers are currently 'int' or
'EMACS_INT'.  We need to change this to a size_t-width int.  This will
require a lot of C-level coding cleanup but should be invisible to the
Elisp user.  This low-level work needs to be done anyway, since
currently Emacs doesn't work with buffers larger than 2GB even on
64-bit hosts, since such hosts typically have 32-bit 'int'.

  reply	other threads:[~2002-08-03  0:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-01 16:18 64-bit lossage Dave Love
2002-07-02 19:45 ` Richard Stallman
2002-07-03 18:49   ` Andreas Schwab
2002-07-17 11:25     ` Dave Love
2002-07-17 19:47       ` Andreas Schwab
2002-07-22 16:08         ` Dave Love
2002-07-22 18:52           ` Ken Raeburn
2002-07-17 11:24   ` Dave Love
2002-07-17 12:43     ` Stefan Monnier
2002-07-18 14:55     ` Richard Stallman
2002-07-18 22:23       ` Ken Raeburn
2002-07-19 20:56         ` Richard Stallman
2002-07-20 21:58           ` Ken Raeburn
2002-07-23 22:09         ` Dave Love
2002-07-24 13:34           ` Ken Raeburn
2002-07-29 22:35             ` Dave Love
2002-07-21 11:35 ` Ken Raeburn
2002-07-21 14:05   ` Ken Raeburn
2002-07-23 22:14     ` Dave Love
2002-07-23 22:12   ` Dave Love
2002-07-26  7:02     ` Ken Raeburn
2002-07-29 22:43       ` Dave Love
2002-07-30 14:56         ` Ken Raeburn
2002-07-31  5:55           ` Richard Stallman
2002-08-01 17:19             ` Ken Raeburn
2002-08-01 21:19               ` Paul Eggert
2002-08-01 23:37                 ` Ken Raeburn
2002-08-01 23:50                   ` Paul Eggert
2002-08-03  7:48                     ` Ken Raeburn
2002-08-02 22:13                 ` Richard Stallman
2002-08-03  0:03                   ` Paul Eggert [this message]
2002-08-04 23:24                     ` Richard Stallman
2002-08-09  7:07                 ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200208030003.g7303g815713@green.twinsun.com \
    --to=eggert@twinsun.com \
    --cc=emacs-devel@gnu.org \
    --cc=raeburn@raeburn.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).