diff --git a/.gitattributes b/.gitattributes index 55dffa78cb..0b5d0d0615 100644 --- a/.gitattributes +++ b/.gitattributes @@ -913,6 +913,7 @@ compiler/utils/mkspreg.pp svneol=native#text/plain compiler/utils/mkx86inl.pp svneol=native#text/plain compiler/utils/mkx86ins.pp svneol=native#text/plain compiler/utils/mkx86reg.pp svneol=native#text/plain +compiler/utils/mkxtensareg.pp svneol=native#text/pascal compiler/utils/msg2inc.pp svneol=native#text/plain compiler/utils/msgdif.pp svneol=native#text/plain compiler/utils/msgused.pl svneol=native#text/plain @@ -1009,6 +1010,16 @@ compiler/x86_64/x8664nop.inc svneol=native#text/plain compiler/x86_64/x8664op.inc svneol=native#text/plain compiler/x86_64/x8664pro.inc svneol=native#text/plain compiler/x86_64/x8664tab.inc svneol=native#text/plain +compiler/xtensa/rxtensacon.inc svneol=native#text/plain +compiler/xtensa/rxtensadwa.inc svneol=native#text/plain +compiler/xtensa/rxtensanor.inc svneol=native#text/plain +compiler/xtensa/rxtensanum.inc svneol=native#text/plain +compiler/xtensa/rxtensarni.inc svneol=native#text/plain +compiler/xtensa/rxtensasri.inc svneol=native#text/plain +compiler/xtensa/rxtensasta.inc svneol=native#text/plain +compiler/xtensa/rxtensastd.inc svneol=native#text/plain +compiler/xtensa/rxtensasup.inc svneol=native#text/plain +compiler/xtensa/xtensareg.dat svneol=native#text/plain /fpmake.pp svneol=native#text/plain /fpmake_add1.inc svneol=native#text/plain /fpmake_proc1.inc svneol=native#text/plain diff --git a/compiler/utils/mkxtensareg.pp b/compiler/utils/mkxtensareg.pp new file mode 100644 index 0000000000..016a44fb63 --- /dev/null +++ b/compiler/utils/mkxtensareg.pp @@ -0,0 +1,276 @@ +{ + Copyright (c) 1998-2002 by Peter Vreman and Florian Klaempfl + + Convert xtensareg.dat to several .inc files for usage with + the Free pascal compiler + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} +{$mode objfpc} + +program mkxtensareg; + +const Version = '1.00'; + max_regcount = 200; + +var s : string; + i : longint; + line : longint; + regcount:byte; + regcount_bsstart:byte; + names, + regtypes, + subtypes, + supregs, + numbers, + stdnames, + stabs,dwarf : array[0..max_regcount-1] of string[63]; + regnumber_index, + std_regname_index : array[0..max_regcount-1] of byte; + +function tostr(l : longint) : string; + +begin + str(l,tostr); +end; + +function readstr : string; + + begin + result:=''; + while (s[i]<>',') and (i<=length(s)) do + begin + result:=result+s[i]; + inc(i); + end; + end; + + +procedure readcomma; + begin + if s[i]<>',' then + begin + writeln('Missing "," at line ',line); + writeln('Line: "',s,'"'); + halt(1); + end; + inc(i); + end; + + +procedure skipspace; + + begin + while (s[i] in [' ',#9]) do + inc(i); + end; + +procedure openinc(out f:text;const fn:string); +begin + writeln('creating ',fn); + assign(f,fn); + rewrite(f); + writeln(f,'{ don''t edit, this file is generated from xtensareg.dat }'); +end; + + +procedure closeinc(var f:text); +begin + writeln(f); + close(f); +end; + +procedure build_regnum_index; + +var h,i,j,p,t:byte; + +begin + {Build the registernumber2regindex index. + Step 1: Fill.} + for i:=0 to regcount-1 do + regnumber_index[i]:=i; + {Step 2: Sort. We use a Shell-Metzner sort.} + p:=regcount_bsstart; + repeat + for h:=0 to regcount-p-1 do + begin + i:=h; + repeat + j:=i+p; + if numbers[regnumber_index[j]]>=numbers[regnumber_index[i]] then + break; + t:=regnumber_index[i]; + regnumber_index[i]:=regnumber_index[j]; + regnumber_index[j]:=t; + if i
=stdnames[std_regname_index[i]] then + break; + t:=std_regname_index[i]; + std_regname_index[i]:=std_regname_index[j]; + std_regname_index[j]:=t; + if i
'$' then
+ begin
+ writeln('Missing $ before number, at line ',line);
+ writeln('Line: "',s,'"');
+ halt(1);
+ end;
+ numbers[regcount]:=regtypes[regcount]+copy(subtypes[regcount],2,255)+'00'+copy(supregs[regcount],2,255);
+ if i