mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 10:19:17 +02:00
+ added sqr(shortint) and sqr(smallint) for CPUs with 8/16-bit alu
git-svn-id: trunk@36342 -
This commit is contained in:
parent
7c9e5591b6
commit
ba665e103c
@ -1993,6 +1993,24 @@ end;
|
|||||||
|
|
||||||
{$endif ndef FPC_SYSTEM_HAS_ODD_QWORD}
|
{$endif ndef FPC_SYSTEM_HAS_ODD_QWORD}
|
||||||
|
|
||||||
|
{$if defined(CPUINT8)}
|
||||||
|
{$ifndef FPC_SYSTEM_HAS_SQR_SHORTINT}
|
||||||
|
function sqr(l:shortint):shortint;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
begin
|
||||||
|
sqr:=l*l;
|
||||||
|
end;
|
||||||
|
{$endif ndef FPC_SYSTEM_HAS_SQR_SHORTINT}
|
||||||
|
{$endif CPUINT8}
|
||||||
|
|
||||||
|
{$if defined(CPUINT16) or defined(CPUINT8)}
|
||||||
|
{$ifndef FPC_SYSTEM_HAS_SQR_SMALLINT}
|
||||||
|
function sqr(l:smallint):smallint;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
begin
|
||||||
|
sqr:=l*l;
|
||||||
|
end;
|
||||||
|
{$endif ndef FPC_SYSTEM_HAS_SQR_SMALLINT}
|
||||||
|
{$endif CPUINT16 or CPUINT8}
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_SQR_LONGINT}
|
{$ifndef FPC_SYSTEM_HAS_SQR_LONGINT}
|
||||||
|
|
||||||
function sqr(l:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
|
function sqr(l:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
@ -875,6 +875,12 @@ Function abs(l:Int64):Int64;[internproc:fpc_in_abs_long];
|
|||||||
{$else FPC_HAS_INTERNAL_ABS_INT64}
|
{$else FPC_HAS_INTERNAL_ABS_INT64}
|
||||||
Function abs(l:Int64):Int64;[internconst:fpc_in_const_abs];{$ifdef SYSTEMINLINE}inline;{$endif}
|
Function abs(l:Int64):Int64;[internconst:fpc_in_const_abs];{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
{$endif FPC_HAS_INTERNAL_ABS_INT64}
|
{$endif FPC_HAS_INTERNAL_ABS_INT64}
|
||||||
|
{$if defined(CPUINT8)}
|
||||||
|
Function sqr(l:shortint):shortint;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
{$endif CPUINT8}
|
||||||
|
{$if defined(CPUINT16) or defined(CPUINT8)}
|
||||||
|
Function sqr(l:smallint):smallint;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
{$endif CPUINT16 or CPUINT8}
|
||||||
Function sqr(l:Longint):Longint;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
Function sqr(l:Longint):Longint;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
Function sqr(l:Int64):Int64;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
Function sqr(l:Int64):Int64;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
Function sqr(l:QWord):QWord;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
Function sqr(l:QWord):QWord;[internconst:fpc_in_const_sqr];{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
|
Loading…
Reference in New Issue
Block a user