Browse Source

+ Xtensa: more cpu capabilites
+ Xtensa: set cpu for xtensa-linux as call window support is required

git-svn-id: trunk@45731 -

florian 5 years ago
parent
commit
5ad02a3799
4 changed files with 21 additions and 8 deletions
  1. 2 0
      compiler/options.pas
  2. 8 3
      compiler/xtensa/cgcpu.pas
  3. 3 2
      compiler/xtensa/cpuinfo.pas
  4. 8 3
      compiler/xtensa/ncpuadd.pas

+ 2 - 0
compiler/options.pas

@@ -4297,6 +4297,8 @@ begin
       if (init_settings.fputype=fpu_soft) then
       if (init_settings.fputype=fpu_soft) then
         include(init_settings.moduleswitches,cs_fp_emulation);
         include(init_settings.moduleswitches,cs_fp_emulation);
     end;
     end;
+  if not(option.CPUSetExplicitly) and (target_info.system=system_xtensa_linux) then
+    init_settings.cputype:=cpu_lx6;
 {$endif xtensa}
 {$endif xtensa}
 
 
 {$ifdef arm}
 {$ifdef arm}

+ 8 - 3
compiler/xtensa/cgcpu.pas

@@ -614,9 +614,14 @@ implementation
       var
       var
         instr: taicpu;
         instr: taicpu;
       begin
       begin
-        instr:=taicpu.op_reg_sym(A_B,f.register,l);
-        instr.condition:=flags_to_cond(f.flag);
-        list.concat(instr);
+        if CPUXTENSA_HAS_BOOLEAN_OPTION in cpu_capabilities[current_settings.cputype] then
+          begin
+            instr:=taicpu.op_reg_sym(A_B,f.register,l);
+            instr.condition:=flags_to_cond(f.flag);
+            list.concat(instr);
+          end
+        else
+          Internalerror(2020070401);
       end;
       end;
 
 
 
 

+ 3 - 2
compiler/xtensa/cpuinfo.pas

@@ -136,7 +136,8 @@ Const
    tcpuflags =
    tcpuflags =
       (
       (
         CPUXTENSA_REGWINDOW,
         CPUXTENSA_REGWINDOW,
-        CPUXTENSA_HAS_SEXT
+        CPUXTENSA_HAS_SEXT,
+        CPUXTENSA_HAS_BOOLEAN_OPTION
       );
       );
 
 
    tfpuflags =
    tfpuflags =
@@ -150,7 +151,7 @@ Const
      (
      (
        { cpu_none     } [],
        { cpu_none     } [],
        { cpu_lx106    } [],
        { cpu_lx106    } [],
-       { cpu_lx6      } [CPUXTENSA_REGWINDOW, CPUXTENSA_HAS_SEXT]
+       { cpu_lx6      } [CPUXTENSA_REGWINDOW, CPUXTENSA_HAS_SEXT, CPUXTENSA_HAS_BOOLEAN_OPTION]
      );
      );
 
 
    fpu_capabilities : array[tfputype] of set of tfpuflags =
    fpu_capabilities : array[tfputype] of set of tfpuflags =

+ 8 - 3
compiler/xtensa/ncpuadd.pas

@@ -275,9 +275,14 @@ interface
         { initialize de result }
         { initialize de result }
         if cmpop then
         if cmpop then
           begin
           begin
-           location_reset(location,LOC_FLAGS,OS_NO);
-           location.resflags.register:=NR_B0;
-           location.resflags.flag:=F_NZ;
+            if CPUXTENSA_HAS_BOOLEAN_OPTION in cpu_capabilities[current_settings.cputype] then
+              begin
+                location_reset(location,LOC_FLAGS,OS_NO);
+                location.resflags.register:=NR_B0;
+                location.resflags.flag:=F_NZ;
+              end
+            else
+              Internalerror(2020070402);
           end
           end
         else
         else
          begin
          begin