Boost logo

Boost :

Subject: Re: [boost] [XInt] Some after thoughts about SIMD
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2011-03-11 14:29:37


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? Only in the cases where the lowest common denominator is sufficent to achieve optimality. That is the exception, not the rule, I'm afraid.

I am basing my opinion on experience with larrabee vector instruction set not SSE.

  http://drdobbs.com/architecture-and-design/216402188?pgno=2

"Vector Arithmetic, Logical, and Shift Instructions
The arithmetic, logical, and shift vector instructions include everything you'd expect: add, subtract, add with carry, subtract with borrow, multiply, round, clamp, max, min, absolute max, logical-or, logical-and, logical-xor, logical-shift and arithmetic-shift by a per-element variable number of bits, and conversions among floats, doubles, and signed and unsigned int32s."

I'll call out add with carry and subtract with borrow from that list, which is not exhaustive, by the way. There are a ton of instructions and some are impossible to map an expression to using expression templates due to language limitations.

I said vector instruction sets are a moving target at the outset. If you are designing based on SSE you are solving yesterday's problems.

Regards,
Luke


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