Re: Portable "add with carry" loop for arbitrary precision arithmetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Alexander Konovalenko" <alexkon@xxxxxxxxx> writes:

> There is an "add with carry" instruction on some architectures which
> enables efficient implementation of arbitrary precision (bignum)
> integer addition. Is it possible to make gcc generate efficient
> machine code from pure C or C++ code for bignum addition on those
> architectures?
>
> It looks like the popular libraries like GMP and CLN use hand-coded
> assembly for that. I wonder if gcc can help rewrite that kind of code
> in a more portable way.

In general, no, except for the limiting case of the "long long" type.
gcc doesn't provide any machine independent access to the carry flag.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux