On Tuesday, 19 February 2013 at 16:03:58 UTC, bearophile wrote:
Don:

Simd comparison generally doesn't return a bool, it returns a bool array,
one per element.

Does (arr[] < 10) mean "is every element in arr less than 10" OR "is any element of arr less than 10" OR "create a bool array which is true for each element which is less than 10" ?

All make sense. That's the problem.

Right, it's a design problem.
I think the right thing to do is to take a look at what's an efficient operation to do in hardware (and then look at what's the most commonly useful operation for users). I think the right design here is to return a bool[N]. So in this case monarch_dodra has to add some more code to test all/any.

Bye,
bearophile

There is significant opposition to any simd operators that allocate. The reasoning is that they appear fast but are in actual fact slow (for most normal size vectors, the allocation would be much slower than the calculation itself).

I love the features of numpy and matlab etc. when it comes to array operations, many of which allocate implicitly, but Walter and others were quite adamant they they do not belong in D, a position I've come to agree with.

Reply via email to