emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intervals crash


From: David Kastrup
Subject: Re: Intervals crash
Date: Mon, 27 Sep 2010 08:55:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

"Stephen J. Turnbull" <address@hidden> writes:

> Miles Bader writes:
>
>  > "unsigned good or evil" is such a hoary old religious issue that
>  > any unasked-for advocacy is likely to get you lumped in with the
>  > freaks, simply out of habit on the part of the listener...
>
> OK.  Nevertheless, I find it strange that the *bare fact* that
> removing unsigned thoroughly has saved XEmacs users many crashes can
> pass without comment (as it has, four times now).

Since few people except yourself here have experience with XEmacs, there
is not much to comment on.  That does not mean that your report went
unnoticed.  What kind of reply would you want?  "That's not relevant
since Emacs programmers are smarter than XEmacs programmers" and then
you try countering that?  A bit hard to pull off given that this thread
is about problems with EMACS_UINT in Emacs.

Personally, I was surprised that we have EMACS_UINT at all since Emacs
integers are, after all, signed, and I would not have much confidence in
applications that tried squeezing that bit out for unsigned operations.
When programming in assembly language, you have the respective
operations and status bits and conditions to pull mixed signedness
operations reasonably well.  In C, and operations have a fixed sign
interpretation for both operands and you don't get access to the
combination of carry and overflow status bits that are needed as
transitory extra precision for sorting out the ugly cases.

When you don't desperately need that extra bit of unsignedness, it is
rarely worth getting.  It's been somewhat sobering to when first
programming with the 68000 (the C compilers started out with 16bit ints)
that using _unsigned_ array index variables bloated the code and slowed
it down.  The indexed addressing modes only knew how to deal with signed
offsets.

In fact, basically any modern CPU can deal better with sign extension
(in particular in addressing modes) than with, uh, unsign extension.  So
unless you definitely need that extra bit, unsigned is not worth the
trouble.

For EMACS_UINT, we can safely say we don't need that extra bit since
Emacs integers are signed (and smaller in total size) to begin with.

Now that's not at all a comment on your practical experiences (like you
desired and will not likely get).  This is just another theoretic
rambling.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]