Boost logo

Boost :

Subject: Re: [boost] Boost SIMD beta release
From: Domagoj Saric (dsaritz_at_[hidden])
Date: 2012-12-24 11:16:13


"Peter Dimov" wrote in message
news:EC9066EE5B5448A2B4BAF64570BE6BAD_at_pdimov5...
> Yes, and the right thing to do is...

Actually there is a "significant"[1] portion of cases where alignment
problems can be fixed more elegantly. If we realize that protected memory
systems have page-size-granularity which is much larger than any conceivable
SIMD vector size it immediately follows that "overread" (reading outside of
the specified range) of a maximum size of "SIMD-cardinal - 1" is always
safe. Further more in a single threaded case or when you allocate your
arrays with both their location and size aligned, overwrite is also always
safe when you wrap the overwrite in a guard class that automatically aligns
the array pointers/iterators and then simply restores any possibly
overwritten elements in its destructor (NT2/Boost.SIMD devs might recall the
discussion of EdgeRestoredOutputRange on the mailing list and/or IRC). This
only requires that all the arrays be compatibly aligned (i.e. if one is off
by 1 and the other by 2 this approach cannot be used) but it covers almost
all of my/our own cases (usually it only does not cover cases that arise
when crossing 3rd party library/legacy interfaces)...

@NT2 devs, I might have missed it but I didn't see you mention your
shifted-iterator functionality in this context...

[1] I know, a weasel word...to make it less so I'm referring to my
experience with digital signal processing...

-- 
"What Huxley teaches is that in the age of advanced technology, spiritual
devastation is more likely to come from an enemy with a smiling face than
from one whose countenance exudes suspicion and hate."
Neil Postman 

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