[vsipl++] [patch] Vector assignment, sarsim bits
Nathan (Jasper) Myers
ncm at codesourcery.com
Fri Sep 23 23:11:31 UTC 2005
On Fri, Sep 23, 2005 at 03:58:10PM -0400, Jules Bergmann wrote:
> ... I changed the Vector assignment
> operators (+=, -=, etc) to go through the same dispatch as 'operator=',
> so that 'A += B' gets evaluated as 'A = A + B'. This throws away the
> knowledge that it is an update expression, but it lets it get evaluated
> by IPP when possible. In the long term, we may want to add special
> dispatch for operator assignment so we don't throw this knowledge away.
I guess I think of op= as a special case of op+=, not the other way
'round. That is, if you imagine an operator # such that (a # b) => b,
then a.op#=(b), which must mean (a = a # b), is identical to what we
call a.op=(b). In normal code we usually implement op+ using op+=,
making the latter the more fundamental.
I don't know if that means anything in terms of the code we have.
Anyhow I thought you were talking about distributed operation, rather
than IPP. I see IPP implements both a = b + c and a += b. I wonder
if we're better off ignoring one or other of those. My guess would
be that if we used just one, it should be the second. Anyway it
extends more naturally to their operation a += b * c.
More information about the vsipl++