
20 Dec
2012
20 Dec
'12
6:21 p.m.
On 20/12/12 18:34, Peter Dimov wrote:
We're rolling a beta release of Boost.SIMD along with a beta release of NT2.
...
What is the recommended Boost.SIMD way to write a function like
void add_n( float const * s, float const * s2, float * d, size_t n ); // d[i] = s[i] + s2[i]
where none of s, s2, d are guaranteed to be aligned?
I don't think there is any easy way. Either you use unaligned loads/stores for all but one variable, or you generate all variants depending on how disaligned each pointer is compared to each other and select the optimal variant at runtime. I'd recommend to go the unaligned_load + store route for simplicity.