Преглед изворни кода

+ Xtensa: completed rtl skeleton

git-svn-id: trunk@44322 -
florian пре 5 година
родитељ
комит
28c0a47a95

+ 3 - 0
.gitattributes

@@ -12071,11 +12071,14 @@ rtl/x86_64/strings.inc svneol=native#text/plain
 rtl/x86_64/stringss.inc svneol=native#text/plain
 rtl/x86_64/x86_64.inc svneol=native#text/plain
 rtl/xtensa/cpuh.inc svneol=native#text/plain
+rtl/xtensa/int64p.inc svneol=native#text/plain
 rtl/xtensa/makefile.cpu svneol=native#text/plain
 rtl/xtensa/math.inc svneol=native#text/plain
 rtl/xtensa/set.inc svneol=native#text/plain
 rtl/xtensa/setjump.inc svneol=native#text/plain
 rtl/xtensa/setjumph.inc svneol=native#text/plain
+rtl/xtensa/strings.inc svneol=native#text/plain
+rtl/xtensa/stringss.inc svneol=native#text/plain
 rtl/xtensa/xtensa.inc svneol=native#text/plain
 tests/MPWMake -text
 tests/Makefile svneol=native#text/plain

+ 19 - 1
rtl/embedded/system.cfg

@@ -245,4 +245,22 @@
 -SfCOMMANDARGS
 -SfRANDOM
 -SfRESOURCES
-#endif CPURISCV64
+#endif CPURISCV64
+
+# Xtensa is powerful enough to handle most object pascal constructs
+# it is only a matter of size
+#ifdef CPUXTENSA
+-SfSOFTFPU
+-SfCLASSES
+-SfEXCEPTIONS
+-SfANSISTRINGS
+-SfRTTI
+-SfWIDESTRINGS
+-SfDYNARRAYS
+-SfTHREADING
+-SfVARIANTS
+-SfOBJECTS
+-SfCOMMANDARGS
+-SfRANDOM
+-SfRESOURCES
+#endif CPUXTENSA

+ 1 - 0
rtl/embedded/system.pp

@@ -142,6 +142,7 @@ var
 {$undef fpc_softfpu_interface}
 
 {$endif FPC_HAS_FEATURE_SOFTFPU}
+
 {$endif FPUNONE}
 
 {$ifdef CPUI8086}

+ 4 - 0
rtl/inc/systemh.inc

@@ -351,6 +351,10 @@ Type
 {$ifdef CPUXTENSA}
   {$define DEFAULT_DOUBLE}
 
+  {$define FPC_INCLUDE_SOFTWARE_MOD_DIV}
+  {$define FPC_INCLUDE_SOFTWARE_MUL}
+  {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
+
   {$ifndef FPUNONE}
     {$define SUPPORT_SINGLE}
     {$define SUPPORT_DOUBLE}

+ 15 - 0
rtl/xtensa/int64p.inc

@@ -0,0 +1,15 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by the Free Pascal development team
+
+    This file contains some helper routines for int64 and qword
+
+    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.
+
+ **********************************************************************}
+

+ 18 - 0
rtl/xtensa/strings.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2000 by Jonas Maebe, member of the
+    Free Pascal development team
+
+    Processor dependent part of strings.pp, that can be shared with
+    sysutils unit.
+
+    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.
+
+ **********************************************************************}
+
+

+ 18 - 0
rtl/xtensa/stringss.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Jonas Maebe, member of the
+    Free Pascal development team
+
+    Processor dependent part of strings.pp, not shared with
+    sysutils unit.
+
+    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.
+
+ **********************************************************************}
+
+

+ 136 - 0
rtl/xtensa/xtensa.inc

@@ -14,3 +14,139 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
  **********************************************************************}
+{$define FPC_SYSTEM_HAS_SYSRESETFPU}
+Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+end;
+
+{$define FPC_SYSTEM_HAS_SYSINITFPU}
+Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+end;
+
+procedure fpc_cpuinit;
+begin
+  { don't let libraries influence the FPU cw set by the host program }
+  if not IsLibrary then
+    SysInitFPU;
+end;
+
+
+{$IFNDEF INTERNAL_BACKTRACE}
+{$define FPC_SYSTEM_HAS_GET_FRAME}
+function get_frame:pointer;assembler;nostackframe;
+  asm
+  end;
+{$ENDIF not INTERNAL_BACKTRACE}
+
+
+{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
+function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler;nostackframe;
+  asm
+  end;
+
+
+{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
+function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;assembler;nostackframe;
+  asm
+  end;
+
+
+{$define FPC_SYSTEM_HAS_SPTR}
+Function Sptr : pointer;assembler;nostackframe;
+  asm
+  end;
+
+
+function InterLockedDecrement (var Target: longint) : longint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target-1;
+    Target:=Result;
+  end;
+
+
+function InterLockedIncrement (var Target: longint) : longint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target+1;
+    Target:=Result;
+  end;
+
+
+function InterLockedExchange (var Target: longint;Source : longint) : longint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target;
+    Target:=Source;
+  end;
+
+
+function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target;
+    if Result=Comperand then
+      Target:=NewValue;
+  end;
+
+
+function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target;
+    Target:=Result+Source;
+  end;
+
+
+function InterLockedDecrement (var Target: smallint) : smallint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target-1;
+    Target:=Result;
+  end;
+
+
+function InterLockedIncrement (var Target: smallint) : smallint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target+1;
+    Target:=Result;
+  end;
+
+
+function InterLockedExchange (var Target: smallint;Source : smallint) : smallint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target;
+    Target:=Source;
+  end;
+
+
+function InterlockedCompareExchange(var Target: smallint; NewValue: smallint; Comperand: smallint): smallint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target;
+    if Result=Comperand then
+      Target:=NewValue;
+  end;
+
+
+function InterLockedExchangeAdd (var Target: smallint;Source : smallint) : smallint;
+  var
+    temp_sreg : byte;
+  begin
+    Result:=Target;
+    Target:=Result+Source;
+  end;
+
+