Browse Source

* Xtensa: cleanup unused stuff
+ Xtense: updated conditions

git-svn-id: trunk@44351 -

florian 5 years ago
parent
commit
fb2e262027

+ 9 - 33
compiler/xtensa/cpubase.pas

@@ -107,7 +107,8 @@ unit cpubase;
       TAsmCond=(C_None,
         C_EQ,C_NE,
         C_GE,C_LT,C_GEU,C_LTU,
-        C_ANY,C_BNONE,C_ALL,C_NALL,C_BC,C_BS
+        C_ANY,C_BNONE,C_ALL,C_NALL,C_BC,C_BS,
+        C_EQZ,C_NEZ
       );
 
       TAsmConds = set of TAsmCond;
@@ -116,40 +117,25 @@ unit cpubase;
       cond2str : array[TAsmCond] of string[4]=('',
         'eq','ne',                         
         'ge','lt','geu','ltu',
-        'any','none','all','nall','bc','bs'
+        'any','none','all','nall','bc','bs',
+        'eqz','nez'
       );
 
       uppercond2str : array[TAsmCond] of string[4]=('',
         'EQ','NE',
         'GE','LT','GEU','LTU',
-        'ANY','NONE','ALL','NALL','BC','BS'
+        'ANY','NONE','ALL','NALL','BC','BS',
+        'EQZ','NEZ'
       );
 
-{*****************************************************************************
-                                   Flags
-*****************************************************************************}
-
-    type
-      TResFlags = (F_EQ,F_NE,F_CS,F_CC,F_MI,F_PL,F_VS,F_VC,F_HI,F_LS,
-        F_GE,F_LT,F_GT,F_LE);
-
 {*****************************************************************************
                                 Operands
 *****************************************************************************}
 
-      taddressmode = (AM_OFFSET,AM_PREINDEXED,AM_POSTINDEXED);
-      tshiftmode = (SM_None,SM_LSL,SM_LSR,SM_ASR,SM_ROR,SM_RRX);
 
+    type
       tupdatereg = (UR_None,UR_Update);
 
-      pshifterop = ^tshifterop;
-
-      tshifterop = record
-        shiftmode : tshiftmode;
-        rs : tregister;
-        shiftimm : byte;
-      end;
-
       tcpumodeflag = (mfA, mfI, mfF);
       tcpumodeflags = set of tcpumodeflag;
 
@@ -250,7 +236,6 @@ unit cpubase;
     function reg_cgsize(const reg: tregister) : tcgsize;
     function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
-    procedure inverse_flags(var f: TResFlags);
     function findreg_by_number(r:Tregister):tregisterindex;
     function std_regnum_search(const s:string):Tregister;
     function std_regname(r:Tregister):string;
@@ -341,16 +326,6 @@ unit cpubase;
       end;
 
 
-    procedure inverse_flags(var f: TResFlags);
-      const
-        inv_flags: array[TResFlags] of TResFlags =
-          (F_NE,F_EQ,F_CC,F_CS,F_PL,F_MI,F_VC,F_VS,F_LS,F_HI,
-          F_LT,F_GE,F_LE,F_GT);
-      begin
-        f:=inv_flags[f];
-      end;
-
-
     function findreg_by_number(r:Tregister):tregisterindex;
       begin
         result:=rgBase.findreg_by_number_table(r,regnumber_index);
@@ -380,7 +355,8 @@ unit cpubase;
         inverse: array[TAsmCond] of TAsmCond=(C_None,
           C_NE,C_EQ,
           C_LT,C_GE,C_LTU,C_GEU,
-          C_BNONE,C_ANY,C_NALL,C_BNONE,C_BS,C_BC
+          C_BNONE,C_ANY,C_NALL,C_BNONE,C_BS,C_BC,C_NEZ,
+          C_EQZ
         );
       begin
         result := inverse[c];

+ 0 - 1
compiler/xtensa/ncpucnv.pas

@@ -75,7 +75,6 @@ implementation
         hreg1,
         hregister : tregister;
         href      : treference;
-        resflags  : tresflags;
         hlabel    : tasmlabel;
         newsize   : tcgsize;
       begin

+ 1 - 2
compiler/xtensa/ncpumat.pas

@@ -137,7 +137,6 @@ implementation
     procedure tcpushlshrnode.second_64bit;
       var
         v : TConstExprInt;
-        so: tshifterop;
         lreg, resreg: TRegister64;
 
       procedure emit_instr(p: tai);
@@ -157,7 +156,7 @@ implementation
          subs  shiftval2, shiftval1, #32
          movpl dstlo, srchi, lsr shiftval2
       }
-      procedure shift_by_variable(srchi, srclo, dsthi, dstlo, shiftval: TRegister; sm: TShiftMode);
+      procedure shift_by_variable(srchi, srclo, dsthi, dstlo, shiftval: TRegister);
         var
           shiftval1,shiftval2:TRegister;
         begin

+ 0 - 17
compiler/xtensa/racpugas.pas

@@ -165,23 +165,6 @@ Unit racpugas;
         end;
 
 
-      function is_shifter_ref_operation(var a : tshiftmode) : boolean;
-        begin
-          a := SM_NONE;
-          if      (actasmpattern='LSL') then
-            a := SM_LSL
-          else if (actasmpattern='LSR') then
-            a := SM_LSR
-          else if (actasmpattern='ASR') then
-            a := SM_ASR
-          else if (actasmpattern='ROR') then
-            a := SM_ROR
-          else if (actasmpattern='RRX') then
-            a := SM_RRX;
-          is_shifter_ref_operation := not(a=SM_NONE);
-        end;
-
-
       procedure read_index_shift(require_rbracket : boolean);
         var
           shift : aint;