Browse Source

m68k: added a helper function to check if a register is an FPU register

Karoly Balogh 2 years ago
parent
commit
f2d6b4d530
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/m68k/cpubase.pas

+ 6 - 0
compiler/m68k/cpubase.pas

@@ -300,6 +300,7 @@ unit cpubase;
 
 
     function isaddressregister(reg : tregister) : boolean;
     function isaddressregister(reg : tregister) : boolean;
     function isintregister(reg : tregister) : boolean;
     function isintregister(reg : tregister) : boolean;
+    function isfpuregister(reg : tregister) : boolean;
     function fpuregopsize: TOpSize; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function fpuregopsize: TOpSize; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function fpuregsize: aint; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function fpuregsize: aint; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function needs_unaligned(const refalignment: aint; const size: tcgsize): boolean;
     function needs_unaligned(const refalignment: aint; const size: tcgsize): boolean;
@@ -517,6 +518,11 @@ implementation
         result:=getregtype(reg)=R_INTREGISTER;
         result:=getregtype(reg)=R_INTREGISTER;
       end;
       end;
 
 
+    function isfpuregister(reg : tregister) : boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
+      begin
+        result:=getregtype(reg)=R_FPUREGISTER;
+      end;
+
     function fpuregopsize: TOpSize; {$ifdef USEINLINE}inline;{$endif USEINLINE}
     function fpuregopsize: TOpSize; {$ifdef USEINLINE}inline;{$endif USEINLINE}
       const
       const
         fpu_regopsize: array[boolean] of TOpSize = ( S_FX, S_FD );
         fpu_regopsize: array[boolean] of TOpSize = ( S_FX, S_FD );