mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-13 15:39:33 +01:00
Currently the ARM-Port uses generic functions for SwapEndian, which are
relativly slow.
This patch adds optimized functions for the 32 and 64-bit case, the 16
bit case is still handled with a normal function, while the generated
code is far from optimal, the inlining (which is not possible with
asm-functions) makes it faster than the optimized function.
Some Numbers from my 1.2GHz Kirkwood (ARMv5):
Old New Result
SwapEndian(Integer) 12.168s 5.411s 44.47%
SwapEndian(Int64) 168.28s 9.015s 5.36%
Testcode was
begin
I := $FFFFFFF;
while I > 0 do
begin
Val2 := MySwapEndian(Val);
Dec(I);
end;
end.
Currently only the ARM implementation is tested. ARMv6+ includes a rev
instruction, while I've implemented them, I was not able to test them.
git-svn-id: trunk@20685 -
|
||
|---|---|---|
| .. | ||
| arm.inc | ||
| divide.inc | ||
| int64p.inc | ||
| makefile.cpu | ||
| math.inc | ||
| mathu.inc | ||
| mathuh.inc | ||
| set.inc | ||
| setjump.inc | ||
| setjumph.inc | ||
| strings.inc | ||
| stringss.inc | ||
| thumb2.inc | ||