develooper Front page | perl.perl6.internals | Postings from April 2008

Re: [perl #53406] [TODO] Add 'long long' to types supported by NCI

Thread Previous | Thread Next
From:
Mark Glines
Date:
April 27, 2008 18:08
Subject:
Re: [perl #53406] [TODO] Add 'long long' to types supported by NCI
On Sat, 26 Apr 2008 19:18:21 -0700
Geoffrey Broadwell (via RT) <parrotbug-followup@parrotcode.org> wrote:

> # New Ticket Created by  Geoffrey Broadwell 
> # Please include the string:  [perl #53406]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53406 >

> (I wish we could just insist that INTVAL be 64 bits everywhere, but
> alas that doesn't make a lot of sense for very memory-constrained
> environments.  Though those do get rarer by the day ....)

In the future, INTVAL will probably be 128 bits for some platforms.
I'd really like to see a set of fixed-width types (similar to what p5
has for pack and unpack), so you have the option of "native int" or
"exactly 32 bits" or whatever you need.

HUGEINTVAL is 64 bits on both linux-x86 and linux-amd64, so it
seems like a good start.  Here's an ugly patch that attempts to add it.

Problems with this patch:

1.  It probably won't work on win32-x64... I seem to recall someone
mentioning HUGEINTVAL is just 32 bits there.
2.  The patch adds a HUGEINTVAL to the PObj union, and would probably
require additional fixups all over parrot to be able to access the
resulting object.

The above makes me think we might be better off using a BigInt object
for this data.  But anyway, here's what I got.

Mark


Thread Previous | Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About