Boost logo

Boost :

Subject: Re: [boost] [XInt] Some after thoughts about SIMD
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-03-12 05:07:31


On 11/03/2011 20:29, Simonson, Lucanus J wrote:
> Mathias Gaunard wrote:
>> On 11/03/2011 01:06, Simonson, Lucanus J wrote:
>>
>>> For infinite precision integer in particular you need access to the
>>> carry bit that is generated by vector artihmetic and other
>>> instruction level features.
>>
>> SSE provides no mean whatsoever to obtain the carry bits when doing
>> addition of vectors.
>>
>> Altivec does, however.
>>
>> I don't see how that changes anything with regards to the user anyway.
>> Those are details from the internals of the 128-bit integer type.
>
> Shouldn't the infinite precision algorithm use carry bit if the hardware supports it? Do we program to the lowest common demoninator then claim optimality?

Everything would be dictated by the interface the algorithms expect, and
how they detect and handle overflows.

Then it's simply a matter to implement the interface using the best
possible set of instructions.

It's true the right interface to deal with carry is not entirely
obvious. Experience with writing XInt should help the author come up
with one though.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk