MOVE optimization ?
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
I have all optimizations on (Pentium/MMX), but compiler unnecessarily call SYSTEM_MOVE even the count is constant and less or equal do 32 bit. Couldn't be these:
# [4] Move(A,B,4);
movl $4,%ecx
movl $U_P$PROGRAM_B,%edx
movl $U_P$PROGRAM_A,%eax
call SYSTEM_MOVE$formal$formal$LONGINT
changed to this?:
movl U_P$PROGRAM_A,%eax
movl %eax,U_P$PROGRAM_B
I can't use B[] := A[], because it is a byte array. "B := A" works correctly by 2x dword move (if the array has a size bigger than 8, for example 16, there is direcly the MOVSL code instead of S_M).
And if the count is a constant bigger than 4 (for example on array in size of 128 bytes), shouldn't be faster istead of calling S_M do MOVSD instruction?:
movl $U_P$PROGRAM_B,%edi
movl $U_P$PROGRAM_A,%esi
movl $16,%ecx
rep
movsl
I mean, couldn't be S_M coded into the source directly instead of CALL (like if I copy one record to another one?).
I don't understand to PM very well so if my opions are wrong, please don't blame me...
Additional information:
Reporter: Martin Lux
EMail: martin dot lux at worldonline dot cz
Mantis conversion info:
- Mantis ID: 6063
- OS: Win32