View mode: basic / threaded / horizontal-split · Log in · Help
March 15, 2012
Re: Wanted: 128 bit integers
"Jonathan M Davis" <jmdavisProg@gmx.com> wrote in message 
news:mailman.685.1331774722.4860.digitalmars-d@puremagic.com...
> On Thursday, March 15, 2012 11:55:46 Daniel Murphy wrote:
>> "Jonathan M Davis" <jmdavisProg@gmx.com> wrote in message
>> news:mailman.666.1331749219.4860.digitalmars-d@puremagic.com...
>>
>> > long long is 128 bits on 64-bit Linux.
>>
>> Are you sure about this?  I think we already had this discussion...
>
> If it isn't, then whatever that discussion was obviously didn't stick in 
> my
> head.
>
> - Jonathan M Davis

long double (aka real, a much better name) is 128 bits (including padding) 
on some platforms/compilers, I'm pretty sure long long is 64 bits in every 
x86-64 memory model.  Some compilers do however support 128 bit integer 
types on some platforms.
March 15, 2012
Re: Wanted: 128 bit integers
"Manu" <turkeyman@gmail.com> wrote in message 
news:mailman.657.1331715447.4860.digitalmars-d@puremagic.com...

>
> Why aren't they implemented in a library for the time being at least, so 
> code can compile and work?
>

The obvious answer is because nobody's done it yet.

I have a branch that partially implements ucent in the dmd backend 
(somewhere in my fork on github), but it will likely be at least a month 
before I have time to work on it again.  It looks like it will be pretty 
easy on 64 bit.
March 15, 2012
Re: Wanted: 128 bit integers
On 3/15/12 1:42 AM, Daniel Murphy wrote:
> "Manu"<turkeyman@gmail.com>  wrote in message
> news:mailman.657.1331715447.4860.digitalmars-d@puremagic.com...
>
>>
>> Why aren't they implemented in a library for the time being at least, so
>> code can compile and work?
>>
>
> The obvious answer is because nobody's done it yet.
>
> I have a branch that partially implements ucent in the dmd backend
> (somewhere in my fork on github), but it will likely be at least a month
> before I have time to work on it again.  It looks like it will be pretty
> easy on 64 bit.

My suggestion is to focus on fixed arbitrary-sized integers in Phobos, 
and then add optimizations for 64-bit integers on architectures that 
support it.

Andrei
March 15, 2012
Re: Wanted: 128 bit integers
Andrei Alexandrescu:

> My suggestion is to focus on fixed arbitrary-sized integers in 
> Phobos, and then add optimizations for 64-bit integers on 
> architectures that support it.

I think library-defined fixed arbitrary-sized integers and 
built-in cent/ucent types are both useful to have. One doesn't 
fully replace the other. cent/ucent is more efficient (even on 32 
bit systems), while FixedInt is more flexible.

But both are low-priority.

Bye,
bearophile
March 15, 2012
Re: Wanted: 128 bit integers
"Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message 
news:jjt1lh$pfb$1@digitalmars.com...
>
> My suggestion is to focus on fixed arbitrary-sized integers in Phobos, and 
> then add optimizations for 64-bit integers on architectures that support 
> it.
>
> Andrei
>
>

Yeah.  A lot of the BigInt code can probably be adapted, if someone wants to 
give it a go.
March 15, 2012
Re: Wanted: 128 bit integers
On Thursday, 15 March 2012 at 15:39:47 UTC, Daniel Murphy wrote:
> "Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in 
> message
> news:jjt1lh$pfb$1@digitalmars.com...
>>
>> My suggestion is to focus on fixed arbitrary-sized integers in 
>> Phobos, and then add optimizations for 64-bit integers on 
>> architectures that support it.
>>
>> Andrei
>>
>>
>
> Yeah.  A lot of the BigInt code can probably be adapted, if 
> someone wants to
> give it a go.

I was really only checking to see if anyone had already 
implemented 128-bit integers. It seems like the answer is no, but 
Daniel may have some code.

It looks like the quickest solution is for me to do it myself. 
I'll let you all know when it's ready.

Paul
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home