On 24 October 2012 16:00, bearophile <bearophileHUGS@lycos.com> wrote:
Manu:After reading that paper I am not sure you are right. See how their language manages masks by itself. This is from page 3:
D already has what's required to do some fairly nice (by comparison) simd stuff with good supporting libraries.
// vector length of context = 1; current_mask = T
int block[4] v = <0,3,4,1>;
int block[4] w = 3; // <3,3,3,3> via broadcast
bool block[4] m = v < w; // <T,F,F,T>
++v; // <1,4,5,2>
if (m) {
// vector length of context = 4; current_mask = m
v += 2; // <3,4,5,4>
} else {
// vector length of context = 4; current_mask = ~m
v += 3; // <3,7,8,4>
}
// vector length of context = 1; current_mask = T
(The simple benchmarks of the paper show a 5-15% performance loss compared to handwritten SIMD code.)