From f8f54dcbcfa27eafd4fa8593601c692e1bb1a13e Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 27 Mar 2025 22:33:30 +0100 Subject: [PATCH] + RiscV has internal rol/r support --- compiler/fpcdefs.inc | 2 ++ compiler/options.pas | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/fpcdefs.inc b/compiler/fpcdefs.inc index bc01fe5e51..ad0e275d1d 100644 --- a/compiler/fpcdefs.inc +++ b/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} diff --git a/compiler/options.pas b/compiler/options.pas index ea66aa13a3..e37b5e10ca 100644 --- a/compiler/options.pas +++ b/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}