On Tuesday, 19 February 2013 at 17:58:14 UTC, John Colvin wrote:
On Tuesday, 19 February 2013 at 17:46:56 UTC, bearophile wrote:
John Colvin:
a) quite counter-intuitive. An operation between two normal,
heap allocated arrays generating a stack allocated array,
with the scoping rules that entails?
Then maybe:
bool[4] res = a > b;
Bye,
bearophile
Yes, but it's quite restrictive to force it to be declared at
the same place as it's assigned, if that's what you're implying.
Essentially what's needed in order to allow all this and other
simd operations that don't work in-place on the main operands
is a guarantee that the memory has been pre-allocated. Then it
really doesn't matter whether it's stack or heap.
Hum... so long story short, it is doable, but because the result
of "[]<" is ambiguous, it is not built into the language.
Gonna play around with core.simd then!