On 24/01/2014 01:03, Martin Frb wrote:

Until that is done, your best choice, if you need the speed is to do this by hand:


or better
if cnt = 0 then exit;
tmpptrA := @a[0];
tmpptrB := @b[0];
for i := 0 to cnt - 1 do
    begin
      tmpVAlue := tmpptrA^ + tmpptrB^;
      tmpptrA^ := tmpVAlue;
      inc(tmpptrA); // assuming a typed pointer
      tmpptrA^ := tmpVAlue;
      inc(tmpptrB); // assuming a typed pointer
    end;

Actually, if the late hour has not clouded my sight, it goes even better.

tmpptrA := @a[0];
tmpptrB := @b[0];
 tmpVAlue := tmpptrA^;
for i := 0 to cnt - 1 do
    begin
      tmpVAlue := tmpVAlue + tmpptrB^;
      tmpptrA^ := tmpVAlue;
      inc(tmpptrA); // assuming a typed pointer
      inc(tmpptrB); // assuming a typed pointer
    end;
    tmpptrA^ := tmpVAlue;

the last is actually a[cnt], not sure if intended, but it is done so in the original code too.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to