rtl/generic.inc, minor optimizations:

* fpc_help_constructor: call platform-optimized version of FillChar directly instead of going through generic overloaded version.
* don't compile software multiplication routines if not necessary (the interface part already has similar $ifdef around)
* fpc_shortstr_append_shortstr: use sizeint instead of integer (the latter is 16-bit, produces less efficient code on most platforms)

git-svn-id: trunk@19727 -
This commit is contained in:
sergei 2011-12-02 20:55:53 +00:00
parent 32094761ef
commit 8dc6ebb5ed

View File

@ -752,7 +752,7 @@ begin
end; end;
if _self<>nil then if _self<>nil then
begin begin
fillchar(_self^,pvmt(vmtcopy)^.size,#0); fillchar(_self^,pvmt(vmtcopy)^.size,0);
ppointer(_self+_vmt_pos)^:=vmtcopy; ppointer(_self+_vmt_pos)^:=vmtcopy;
end; end;
fpc_help_constructor:=_self; fpc_help_constructor:=_self;
@ -1025,7 +1025,7 @@ end;
procedure fpc_shortstr_append_shortstr(var s1:shortstring;const s2:shortstring);compilerproc; procedure fpc_shortstr_append_shortstr(var s1:shortstring;const s2:shortstring);compilerproc;
[public,alias:'FPC_SHORTSTR_APPEND_SHORTSTR']; [public,alias:'FPC_SHORTSTR_APPEND_SHORTSTR'];
var var
s1l, s2l : integer; s1l, s2l : sizeint;
begin begin
s1l:=length(s1); s1l:=length(s1);
s2l:=length(s2); s2l:=length(s2);
@ -1292,6 +1292,7 @@ end;
{**************************************************************************** {****************************************************************************
Software multiplication Software multiplication
****************************************************************************} ****************************************************************************}
{$ifdef FPC_INCLUDE_SOFTWARE_MUL}
{$ifndef FPC_SYSTEM_HAS_MUL_INTEGER} {$ifndef FPC_SYSTEM_HAS_MUL_INTEGER}
function fpc_mul_integer(f1,f2 : integer;checkoverflow : boolean) : integer;[public,alias: 'FPC_MUL_INTEGER']; compilerproc; function fpc_mul_integer(f1,f2 : integer;checkoverflow : boolean) : integer;[public,alias: 'FPC_MUL_INTEGER']; compilerproc;
@ -1447,6 +1448,8 @@ end;
end; end;
{$endif FPC_SYSTEM_HAS_MUL_DWORD} {$endif FPC_SYSTEM_HAS_MUL_DWORD}
{$endif FPC_INCLUDE_SOFTWARE_MUL}
{**************************************************************************** {****************************************************************************
Software longint/dword division Software longint/dword division
****************************************************************************} ****************************************************************************}