simd comparison operator?

John Colvin john.loughran.colvin at gmail.com
Tue Feb 19 09:58:13 PST 2013


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.


More information about the Digitalmars-d mailing list