From ef708fdab9a22c62200c7f6e248d6a9c8c8d4284 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 18 Nov 2002 18:33:51 +0000 Subject: [PATCH] * Swap(QWord) constant support --- compiler/compinnr.inc | 6 +++++- compiler/ninl.pas | 14 ++++++++++++-- rtl/inc/innr.inc | 6 +++++- rtl/inc/system.inc | 9 ++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/compiler/compinnr.inc b/compiler/compinnr.inc index 8b45d8cbf6..62a30fa581 100644 --- a/compiler/compinnr.inc +++ b/compiler/compinnr.inc @@ -88,6 +88,7 @@ const in_arctan_extended = 125; in_ln_extended = 126; in_sin_extended = 127; + in_const_swap_qword = 128; { MMX functions } { these contants are used by the mmx unit } @@ -106,7 +107,10 @@ const { $Log$ - Revision 1.9 2002-10-02 18:20:52 peter + Revision 1.10 2002-11-18 18:35:01 peter + * Swap(QWord) constant support + + Revision 1.9 2002/10/02 18:20:52 peter * Copy() is now internal syssym that calls compilerprocs Revision 1.8 2002/07/16 15:34:20 florian diff --git a/compiler/ninl.pas b/compiler/ninl.pas index 053d981b22..c6d0d24b9c 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -1101,7 +1101,7 @@ implementation end; var - vl,vl2 : longint; + vl,vl2 : TConstExprInt; vr : bestreal; hp : tnode; srsym : tsym; @@ -1237,6 +1237,13 @@ implementation else hp:=cordconstnode.create((vl and $ffff) shl 16+(vl shr 16),left.resulttype,true); end; + in_const_swap_qword : + begin + if isreal then + CGMessage(type_e_mismatch) + else + hp:=cordconstnode.create((vl and $ffff) shl 32+(vl shr 32),left.resulttype,true); + end; in_const_ptr : begin if isreal then @@ -2401,7 +2408,10 @@ begin end. { $Log$ - Revision 1.96 2002-11-18 17:31:57 peter + Revision 1.97 2002-11-18 18:35:01 peter + * Swap(QWord) constant support + + Revision 1.96 2002/11/18 17:31:57 peter * pass proccalloption to ret_in_xxx and push_xxx functions Revision 1.95 2002/11/16 17:59:31 peter diff --git a/rtl/inc/innr.inc b/rtl/inc/innr.inc index 07f26b6d02..7024cc5b5f 100644 --- a/rtl/inc/innr.inc +++ b/rtl/inc/innr.inc @@ -82,6 +82,7 @@ const in_arctan_extended = 125; in_ln_extended = 126; in_sin_extended = 127; + in_const_swap_qword = 128; { MMX functions } { these contants are used by the mmx unit } @@ -100,7 +101,10 @@ const { $Log$ - Revision 1.4 2002-09-07 15:07:45 peter + Revision 1.5 2002-11-18 18:33:51 peter + * Swap(QWord) constant support + + Revision 1.4 2002/09/07 15:07:45 peter * old logs removed and tabs fixed } diff --git a/rtl/inc/system.inc b/rtl/inc/system.inc index 2d02020c66..42dbc98ee4 100644 --- a/rtl/inc/system.inc +++ b/rtl/inc/system.inc @@ -198,12 +198,12 @@ Begin Swap:=(X and $ffff) shl 16 + (X shr 16) End; -Function Swap (X : QWord) : QWord;{$ifdef SYSTEMINLINE}inline;{$endif} +Function Swap (X : QWord) : QWord;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:in_const_swap_qword]; Begin Swap:=(X and $ffffffff) shl 32 + (X shr 32); End; -Function swap (X : Int64) : Int64;{$ifdef SYSTEMINLINE}inline;{$endif} +Function swap (X : Int64) : Int64;{$ifdef SYSTEMINLINE}inline;{$endif}[internconst:in_const_swap_qword]; Begin Swap:=(X and $ffffffff) shl 32 + (X shr 32); End; @@ -757,7 +757,10 @@ end; { $Log$ - Revision 1.36 2002-10-14 19:39:17 peter + Revision 1.37 2002-11-18 18:33:51 peter + * Swap(QWord) constant support + + Revision 1.36 2002/10/14 19:39:17 peter * threads unit added for thread support Revision 1.35 2002/09/18 18:32:01 carl