Explorar o código

* Swap(QWord) constant support

peter %!s(int64=23) %!d(string=hai) anos
pai
achega
ef708fdab9
Modificáronse 4 ficheiros con 28 adicións e 7 borrados
  1. 5 1
      compiler/compinnr.inc
  2. 12 2
      compiler/ninl.pas
  3. 5 1
      rtl/inc/innr.inc
  4. 6 3
      rtl/inc/system.inc

+ 5 - 1
compiler/compinnr.inc

@@ -88,6 +88,7 @@ const
    in_arctan_extended  = 125;
    in_arctan_extended  = 125;
    in_ln_extended      = 126;
    in_ln_extended      = 126;
    in_sin_extended     = 127;
    in_sin_extended     = 127;
+   in_const_swap_qword = 128;
 
 
 { MMX functions }
 { MMX functions }
 { these contants are used by the mmx unit }
 { these contants are used by the mmx unit }
@@ -106,7 +107,10 @@ const
 
 
 {
 {
   $Log$
   $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
     * Copy() is now internal syssym that calls compilerprocs
 
 
   Revision 1.8  2002/07/16 15:34:20  florian
   Revision 1.8  2002/07/16 15:34:20  florian

+ 12 - 2
compiler/ninl.pas

@@ -1101,7 +1101,7 @@ implementation
         end;
         end;
 
 
       var
       var
-         vl,vl2    : longint;
+         vl,vl2    : TConstExprInt;
          vr        : bestreal;
          vr        : bestreal;
          hp        : tnode;
          hp        : tnode;
          srsym     : tsym;
          srsym     : tsym;
@@ -1237,6 +1237,13 @@ implementation
                      else
                      else
                       hp:=cordconstnode.create((vl and $ffff) shl 16+(vl shr 16),left.resulttype,true);
                       hp:=cordconstnode.create((vl and $ffff) shl 16+(vl shr 16),left.resulttype,true);
                    end;
                    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 :
                  in_const_ptr :
                    begin
                    begin
                      if isreal then
                      if isreal then
@@ -2401,7 +2408,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $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
     * pass proccalloption to ret_in_xxx and push_xxx functions
 
 
   Revision 1.95  2002/11/16 17:59:31  peter
   Revision 1.95  2002/11/16 17:59:31  peter

+ 5 - 1
rtl/inc/innr.inc

@@ -82,6 +82,7 @@ const
    in_arctan_extended  = 125;
    in_arctan_extended  = 125;
    in_ln_extended      = 126;
    in_ln_extended      = 126;
    in_sin_extended     = 127;
    in_sin_extended     = 127;
+   in_const_swap_qword = 128;
 
 
 { MMX functions }
 { MMX functions }
 { these contants are used by the mmx unit }
 { these contants are used by the mmx unit }
@@ -100,7 +101,10 @@ const
 
 
 {
 {
   $Log$
   $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
     * old logs removed and tabs fixed
 
 
 }
 }

+ 6 - 3
rtl/inc/system.inc

@@ -198,12 +198,12 @@ Begin
   Swap:=(X and $ffff) shl 16 + (X shr 16)
   Swap:=(X and $ffff) shl 16 + (X shr 16)
 End;
 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
 Begin
   Swap:=(X and $ffffffff) shl 32 + (X shr 32);
   Swap:=(X and $ffffffff) shl 32 + (X shr 32);
 End;
 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
 Begin
   Swap:=(X and $ffffffff) shl 32 + (X shr 32);
   Swap:=(X and $ffffffff) shl 32 + (X shr 32);
 End;
 End;
@@ -757,7 +757,10 @@ end;
 
 
 {
 {
   $Log$
   $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
     * threads unit added for thread support
 
 
   Revision 1.35  2002/09/18 18:32:01  carl
   Revision 1.35  2002/09/18 18:32:01  carl