瀏覽代碼

+ RiscV has internal rol/r support

florian 4 月之前
父節點
當前提交
f8f54dcbcf
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 2 0
      compiler/fpcdefs.inc
  2. 4 1
      compiler/options.pas

+ 2 - 0
compiler/fpcdefs.inc

@@ -345,6 +345,7 @@
   {$define cpu32bit}
   {$define cpu32bitaddr}
   {$define cpu32bitalu}
+  {$define cpurox}
   {$define cpufpemu}
   {$define cputargethasfixedstack}
   {$define cpuneedsmulhelper}
@@ -372,6 +373,7 @@
   {$define cpu64bit}
   {$define cpu64bitaddr}
   {$define cpu64bitalu}
+  {$define cpurox}
   {$define cpufpemu}
   {$define cputargethasfixedstack}
   {$define cpuneedsmulhelper}

+ 4 - 1
compiler/options.pas

@@ -4832,9 +4832,12 @@ procedure read_arguments(cmd:TCmdStr);
 
       { these cpus have an inline rol/ror implementaion }
       {$ifdef cpurox}
-      {$ifdef m68k}
+      {$if defined(m68k)}
         if CPUM68K_HAS_ROLROR in cpu_capabilities[init_settings.cputype] then
           def_system_macro('FPC_HAS_INTERNAL_ROX');
+      {$elseif defined(riscv)}
+        if [CPURV_HAS_ZBB,CPURV_HAS_ZBKB]*cpu_capabilities[init_settings.cputype]<>[] then
+          def_system_macro('FPC_HAS_INTERNAL_ROX');
       {$else}
         def_system_macro('FPC_HAS_INTERNAL_ROX');
       {$endif}