From 01aceb4f07a0ddd103bc8b4339018ee14199dba8 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 2 Jul 1999 18:06:40 +0000 Subject: [PATCH] + qword/int64: lo/hi/swap --- rtl/inc/innr.inc | 8 ++++++-- rtl/inc/makefile.inc | 2 +- rtl/inc/system.inc | 24 +++++++++++++++++++++--- rtl/inc/systemh.inc | 13 +++++++++++-- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/rtl/inc/innr.inc b/rtl/inc/innr.inc index d5ebe7b5cb..57575f1a29 100644 --- a/rtl/inc/innr.inc +++ b/rtl/inc/innr.inc @@ -71,9 +71,14 @@ const in_const_exp = 114; in_const_ln = 115; in_const_sin = 116; + in_lo_qword = 117; + in_hi_qword = 118; { $Log$ - Revision 1.7 1999-04-17 13:10:23 peter + Revision 1.8 1999-07-02 18:06:40 florian + + qword/int64: lo/hi/swap + + Revision 1.7 1999/04/17 13:10:23 peter * addr() internal Revision 1.10 1998/10/05 12:32:45 peter @@ -88,6 +93,5 @@ const Revision 1.3 1998/09/01 17:36:19 peter + internconst - } diff --git a/rtl/inc/makefile.inc b/rtl/inc/makefile.inc index 064cca768a..a61fb289c5 100644 --- a/rtl/inc/makefile.inc +++ b/rtl/inc/makefile.inc @@ -6,7 +6,7 @@ # implementation files. SYSNAMES=systemh heaph mathh filerec textrec system real2str sstrings innr \ - file typefile text rtti heap astrings objpas objpash except + file typefile text rtti heap astrings objpas objpash except int64 SYSINCNAMES=$(addsuffix .inc,$(SYSNAMES)) # Other unit names which can be used for all systems diff --git a/rtl/inc/system.inc b/rtl/inc/system.inc index 7aa6b8eb6a..eb6a5db1dd 100644 --- a/rtl/inc/system.inc +++ b/rtl/inc/system.inc @@ -57,10 +57,14 @@ Function lo(i : Integer) : byte; [INTERNPROC: In_lo_Word]; Function lo(w : Word) : byte; [INTERNPROC: In_lo_Word]; Function lo(l : Longint) : Word; [INTERNPROC: In_lo_long]; Function lo(l : DWord) : Word; [INTERNPROC: In_lo_long]; +Function lo(q : QWord) : DWord; [INTERNPROC: In_lo_qword]; +Function lo(i : Int64) : DWord; [INTERNPROC: In_lo_qword]; Function hi(i : Integer) : byte; [INTERNPROC: In_hi_Word]; Function hi(w : Word) : byte; [INTERNPROC: In_hi_Word]; Function hi(l : Longint) : Word; [INTERNPROC: In_hi_long]; Function hi(l : DWord) : Word; [INTERNPROC: In_hi_long]; +Function hi(q : QWord) : DWord; [INTERNPROC: In_hi_qword]; +Function hi(i : Int64) : DWord; [INTERNPROC: In_hi_qword]; Function chr(b : byte) : Char; [INTERNPROC: In_chr_byte]; Function Length(s : string) : byte; [INTERNPROC: In_Length_string]; @@ -138,7 +142,7 @@ End; Function Swap (X : Integer) : Integer;[internconst:in_const_swap_word]; Begin - Swap:=Integer(Swap(Word(X))); + swap:=(X and $ff) shl 8 + (X shr 8) End; Function swap (X : Longint) : Longint;[internconst:in_const_swap_long]; @@ -148,9 +152,20 @@ End; Function Swap (X : Cardinal) : Cardinal;[internconst:in_const_swap_long]; Begin - Swap:=Swap(Longint(X)); + Swap:=(X and $ffff) shl 16 + (X shr 16) End; +Function Swap (X : QWord) : QWord; +Begin + Swap:=(X and $ffffffff) shl 32 + (X shr 32); +End; + +Function swap (X : Int64) : Int64; +Begin + Swap:=(X and $ffffffff) shl 32 + (X shr 32); +End; + + {$endif RTLLITE} {**************************************************************************** @@ -554,7 +569,10 @@ end; { $Log$ - Revision 1.61 1999-07-01 15:39:51 florian + Revision 1.62 1999-07-02 18:06:42 florian + + qword/int64: lo/hi/swap + + Revision 1.61 1999/07/01 15:39:51 florian + qword/int64 type released Revision 1.60 1999/06/11 11:47:00 peter diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc index c5b1a4a9ba..8c8d784ba7 100644 --- a/rtl/inc/systemh.inc +++ b/rtl/inc/systemh.inc @@ -170,15 +170,21 @@ Function lo(l:Longint):Word; Function lo(l:DWord):Word; Function lo(i:Integer):byte; Function lo(B: Byte):Byte; +Function lo(q : QWord) : DWord; +Function lo(i : Int64) : DWord; Function hi(w:Word):byte; Function hi(i:Integer):byte; Function hi(l:Longint):Word; Function hi(b : Byte) : Byte; Function hi(l: DWord): Word; +Function hi(q : QWord) : DWord; +Function hi(i : Int64) : DWord; Function Swap (X:Word):Word; Function Swap (X:Integer):Integer; Function Swap (X:Cardinal):Cardinal; -Function Swap (X:Longint):Longint; +Function Swap (X:LongInt):LongInt; +Function Swap (X:QWord):QWord; +Function Swap (X:Int64):Int64; {$endif RTLLITE} Function Random(l:Longint):Longint; @@ -470,7 +476,10 @@ const { $Log$ - Revision 1.58 1999-06-30 22:17:22 florian + Revision 1.59 1999-07-02 18:06:43 florian + + qword/int64: lo/hi/swap + + Revision 1.58 1999/06/30 22:17:22 florian + fpuint64 to system unit interface added: if it is true, the rtl uses the fpu to do int64 operations, if possible