cent and ucent?

Alex Rønne Petersen xtzgzorex at gmail.com
Sat Jan 28 19:57:55 PST 2012


On 29-01-2012 04:38, Daniel Murphy wrote:
> "bearophile"<bearophileHUGS at lycos.com>  wrote in message
> news:jg2cku$2ljk$1 at digitalmars.com...
>> Integer numbers have some proprieties that compilers use with built-in
>> fixed-size numbers to optimize code. I think such optimizations are not
>> performed on library-defined numbers like a Fixed!128 or BigInt. This
>> means there are advantages of having cent/ucent/BigInt as built-ins.
>>
>
> Yes, but the advantages in implementation ease and portability currently
> favour a library solution.
> Do the gcc or llvm backends support 128 bit integers?

Can't speak for GCC, but LLVM allows arbitrary-size integers. SDC maps 
cent/ucent to i128.

>
>> Alternatively in theory special annotations are able to tell the compiler
>> that a user-defined type shares some of the characteristics of integer
>> numbers, allowing the compiler to optimize better at compile-time. But I
>> think not even the Scala compiler is so powerful.
>
> This would still require backend support for many things.
>
>

Most of LLVM's optimizers work on arbitrary-size ints.

-- 
- Alex


More information about the Digitalmars-d mailing list