longinteger on Cray J90

Marc Poinot Marc.Poinot at onera.fr
Mon May 22 12:31:54 CEST 2000

I'm trying to use Python on a J90.

This Cray, and its folks, has 8 bytes
size shorts, int, long, long long, etc...
Looks like some hardware discount ;) ?

I have a 8 bytes concern with longobject.c
which manipulates heavily bit masks.

I found that the carry (add) and borrow (sub)
are not "masked" correctly as shorts.
Thus, it looks like some of the asserts are
not relevants (i.e. assert(borrow == 0) ),
but not only the asserts.
As soon as your long object is larger than SHIFT,
at least the borrow/carry is not "cleared" correctly.

Python 1.5.2 (#16, May 22 2000, 12:14:02) [C] on unicos10
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> a=01000000000000000
>>> a-1
>>> b=long(a)
>>> b
>>> b-1
Assertion failed: borrow == 0, file longobject.c, line 1120

I've read some emails from Konrad H. and Tim P.
about that. K.Hinsen has problems with regexp.
T.Peters suggested the use of a macro
to mask the shorts. But such a use seems difficult
as the long object representation has a digit typedef,
I have to find back the use of this type in the
whole Python code... (I am wrong, K.P. ?).

The description in Include/longinterp.h gives some
details about what the short/digit/wdigit types should
be able to do. But in my case, I wonder how to make
a wdigit able to handle twice the size of a digit?

Then, here's my question:

How to use an European short instead of an African one?

Marcvs [alias I guess this is the emerged part of
        the problem, maybe are there some hidden use
        of shorts (such as in regexp as described in
        the T.H. email ?). I say *maybe* because the 
        tests are completed.]

More information about the Python-list mailing list