Thread overview | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 28, 2008 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
You know, the unimplemented 128 bit integer types. Does anyone have a use for these? |
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Reply to Walter,
> You know, the unimplemented 128 bit integer types.
>
> Does anyone have a use for these?
>
I'd like to see them. Some times it can be handy to have a "larger" integer than the default size, so as 64bit get implemented (it is right?) I think it will be handy.
|
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright Wrote:
> You know, the unimplemented 128 bit integer types.
>
> Does anyone have a use for these?
Well the only uses I can think of, I'd prefer an unlimited-size big integer struct anyway... Since they can't be operated on in registers (at least in x86), their value seems limited.
|
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Hello Walter,
> You know, the unimplemented 128 bit integer types.
>
> Does anyone have a use for these?
>
Was that "cent" and "ucent"?
Would any of these map well to SSE Instructions on Intel CPU's?
-JJR
|
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | == Quote from Walter Bright (newshound1@digitalmars.com)'s article
> You know, the unimplemented 128 bit integer types.
> Does anyone have a use for these?
Well, we've got bigints in both Phobos and Tango now. Given the clumsiness or downright impossibility of manipulating 128-bit ints in hardware on x86-32, would they even be much faster than bigints? I mean, you couldn't even fit 2 128-bit ints plus a stack pointer in the general-purpose registers of an x86.
|
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Reimer | John Reimer wrote: > Hello Walter, > >> You know, the unimplemented 128 bit integer types. >> >> Does anyone have a use for these? >> > > > Was that "cent" and "ucent"? yes. > Would any of these map well to SSE Instructions on Intel CPU's? Not a chance :-( |
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | Hello dsimcha,
> == Quote from Walter Bright (newshound1@digitalmars.com)'s article
>
>> You know, the unimplemented 128 bit integer types. Does anyone have a
>> use for these?
>>
> Well, we've got bigints in both Phobos and Tango now. Given the
> clumsiness or downright impossibility of manipulating 128-bit ints in
> hardware on x86-32, would they even be much faster than bigints? I
> mean, you couldn't even fit 2 128-bit ints plus a stack pointer in the
> general-purpose registers of an x86.
>
That's why I was asking about SSE... I believe that they have 128-bit registers that can be viewed as integers and unsigned integers. But I'm not very familiar with how this works.
-JJR
|
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | dsimcha wrote:
> == Quote from Walter Bright (newshound1@digitalmars.com)'s article
>> You know, the unimplemented 128 bit integer types.
>> Does anyone have a use for these?
>
> Well, we've got bigints in both Phobos and Tango now. Given the clumsiness or
> downright impossibility of manipulating 128-bit ints in hardware on x86-32, would
> they even be much faster than bigints? I mean, you couldn't even fit 2 128-bit
> ints plus a stack pointer in the general-purpose registers of an x86.
It can be done (not impractical at all), the issue is is it worth while?
|
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Sat, 27 Dec 2008 20:38:12 -0800, Walter Bright wrote: > You know, the unimplemented 128 bit integer types. > > Does anyone have a use for these? Cryptographers would. -- Derek Parnell Melbourne, Australia skype: derek.j.parnell |
December 28, 2008 Re: 128 bit signed and unsigned integer types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright:
> It can be done (not impractical at all), the issue is is it worth while?
128 bit are two words in the 64-bit CPUs that are now getting very common. So it's like 64 bit operations on 32 bit CPUs.
A possible use is for runtime test for overflows: you can perform operations among 64 bit integers with 128 bit precision, and then you can look at the result if it fits still in 64 bits. If not, you can raise an overflow exception (probably there other ways to test for overflow, but this seems simple to implement). You can use 64 bits to implement the safe operations among 32-16-8 bit numbers on the 64 bit CPUs).
Bye,
bearophile
|
Copyright © 1999-2021 by the D Language Foundation