mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 23:29:32 +02:00
* Enabled internal handling of Abs(longint) for all targets. It has been implemented in cross-platform way ages ago (see tcginlinenode.second_abs_long), but not enabled on MIPS,SPARC and m68k.
- RTL: removed MIPS,SPARC and m68k-specific implementations of Abs(longint), and marked the generic one as required for bootstrapping purposes only. git-svn-id: trunk@27857 -
This commit is contained in:
parent
c853c29c3c
commit
217ab9879c
@ -2930,9 +2930,10 @@ begin
|
|||||||
def_system_macro('FPC_STATICRIPFIXED');
|
def_system_macro('FPC_STATICRIPFIXED');
|
||||||
def_system_macro('FPC_VARIANTCOPY_FIXED');
|
def_system_macro('FPC_VARIANTCOPY_FIXED');
|
||||||
def_system_macro('FPC_DYNARRAYCOPY_FIXED');
|
def_system_macro('FPC_DYNARRAYCOPY_FIXED');
|
||||||
{$if defined(x86) or defined(powerpc) or defined(powerpc64) or defined(cpuarm)}
|
|
||||||
|
{ abs(long) is handled internally on all CPUs }
|
||||||
def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
|
def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
|
||||||
{$endif}
|
|
||||||
def_system_macro('FPC_HAS_UNICODESTRING');
|
def_system_macro('FPC_HAS_UNICODESTRING');
|
||||||
def_system_macro('FPC_RTTI_PACKSET1');
|
def_system_macro('FPC_RTTI_PACKSET1');
|
||||||
def_system_macro('FPC_HAS_CPSTRING');
|
def_system_macro('FPC_HAS_CPSTRING');
|
||||||
|
@ -1486,6 +1486,8 @@ function fpc_mod_longint(n,z : longint) : longint; [public,alias: 'FPC_MOD_LONGI
|
|||||||
{****************************************************************************}
|
{****************************************************************************}
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_ABS_LONGINT}
|
{$ifndef FPC_SYSTEM_HAS_ABS_LONGINT}
|
||||||
|
{ This is only needed to bootstrap on SPARC targets
|
||||||
|
(MIPS and m68k too, but they have no releases, so bootstrapping is not an issue) }
|
||||||
function abs(l:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
|
function abs(l:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
if l<0 then
|
if l<0 then
|
||||||
|
@ -336,20 +336,6 @@ asm
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_ABS_LONGINT}
|
|
||||||
function abs(l : longint) : longint;
|
|
||||||
begin
|
|
||||||
asm
|
|
||||||
move.l l,d0
|
|
||||||
tst.l d0
|
|
||||||
bpl @LMABS1
|
|
||||||
neg.l d0
|
|
||||||
@LMABS1:
|
|
||||||
move.l d0,@RESULT
|
|
||||||
end ['d0'];
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function InterLockedDecrement (var Target: longint) : longint;
|
function InterLockedDecrement (var Target: longint) : longint;
|
||||||
begin
|
begin
|
||||||
{$warning FIX ME}
|
{$warning FIX ME}
|
||||||
|
@ -411,14 +411,6 @@ procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];
|
|||||||
Integer math
|
Integer math
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_ABS_LONGINT}
|
|
||||||
function abs(l:longint):longint; assembler;{$ifdef SYSTEMINLINE}inline;{$endif}nostackframe;
|
|
||||||
asm
|
|
||||||
sra $1,$4,31 // $at,$4,31
|
|
||||||
xor $2,$4,$1 // $2,$4,$at
|
|
||||||
sub $2,$2,$1 // $2,$2,$at
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
fpc_system_lock : longint; export name 'fpc_system_lock';
|
fpc_system_lock : longint; export name 'fpc_system_lock';
|
||||||
|
|
||||||
|
@ -321,14 +321,6 @@ procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];
|
|||||||
Integer math
|
Integer math
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_ABS_LONGINT}
|
|
||||||
function abs(l:longint):longint; assembler;{$ifdef SYSTEMINLINE}inline;{$endif}nostackframe;
|
|
||||||
asm
|
|
||||||
sra %o0,31,%g1
|
|
||||||
add %o0,%g1,%o0
|
|
||||||
xor %o0,%g1,%o0
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
fpc_system_lock : byte;export name 'fpc_system_lock';
|
fpc_system_lock : byte;export name 'fpc_system_lock';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user