diff options
Diffstat (limited to 'compiler/options.pas')
-rw-r--r-- | compiler/options.pas | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/compiler/options.pas b/compiler/options.pas index a5844254b5..2ef6f6a6da 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -135,7 +135,8 @@ const + [system_i386_GO32V2] + [system_i386_freebsd] + [system_i386_netbsd] - + [system_i386_wdosx]; + + [system_i386_wdosx] + + [system_riscv32_linux,system_riscv64_linux]; suppported_targets_x_smallr = systems_linux + systems_solaris + [system_i386_haiku] @@ -695,6 +696,12 @@ begin {$ifdef sparc64} 's', {$endif} +{$ifdef riscv32} + 'R', +{$endif} +{$ifdef riscv64} + 'r', +{$endif} {$ifdef avr} 'V', {$endif} @@ -1186,6 +1193,11 @@ begin include(init_settings.moduleswitches,cs_fp_emulation); end; {$endif cpufpemu} + 'E' : + If UnsetBool(More, j, opt, false) then + exclude(init_settings.localswitches,cs_check_fpu_exceptions) + Else + include(init_settings.localswitches,cs_check_fpu_exceptions); 'f' : begin s:=upper(copy(more,j+1,length(more)-j)); @@ -3581,6 +3593,23 @@ procedure read_arguments(cmd:TCmdStr); def_system_macro('FPC_COMP_IS_INT64'); {$endif aarch64} + {$ifdef riscv32} + def_system_macro('CPURISCV'); + def_system_macro('CPURISCV32'); + def_system_macro('CPU32'); + def_system_macro('FPC_CURRENCY_IS_INT64'); + def_system_macro('FPC_COMP_IS_INT64'); + def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); + {$endif riscv32} + {$ifdef riscv64} + def_system_macro('CPURISCV'); + def_system_macro('CPURISCV64'); + def_system_macro('CPU64'); + def_system_macro('FPC_CURRENCY_IS_INT64'); + def_system_macro('FPC_COMP_IS_INT64'); + def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); + {$endif riscv64} + {$if defined(cpu8bitalu)} def_system_macro('CPUINT8'); {$elseif defined(cpu16bitalu)} @@ -4012,12 +4041,13 @@ begin if not(option.FPUSetExplicitly) and ((target_info.system in [system_arm_wince,system_arm_gba, system_m68k_amiga,system_m68k_atari, - system_arm_nds,system_arm_embedded]) + system_arm_nds,system_arm_embedded, + system_riscv32_embedded,system_riscv64_embedded]) {$ifdef arm} or (target_info.abi=abi_eabi) {$endif arm} ) -{$if defined(arm) or defined (m68k)} +{$if defined(arm) or defined(riscv32) or defined(riscv64) or defined (m68k)} or (init_settings.fputype=fpu_soft) {$endif arm or m68k} then @@ -4121,6 +4151,32 @@ begin def_system_macro('CPUTHUMB2'); {$endif arm} +{$if defined(riscv32) or defined(riscv64)} + { ARMHF defaults } + if (target_info.abi = abi_riscv_hf) then + { set default cpu type to ARMv7a for ARMHF unless specified otherwise } + begin + if not option.CPUSetExplicitly then + init_settings.cputype:=cpu_rv64imafdc; + if not option.OptCPUSetExplicitly then + init_settings.optimizecputype:=cpu_rv64imafdc; + + { Set FPU type } + if not(option.FPUSetExplicitly) then + begin + init_settings.fputype:=fpu_fd; + end + else + begin + if not (init_settings.fputype in [fpu_fd]) then + begin + Message(option_illegal_fpu_eabihf); + StopOptions(1); + end; + end; + end; +{$endif defined(riscv32) or defined(riscv64)} + {$ifdef jvm} { set default CPU type to Dalvik when targeting Android } if target_info.system=system_jvm_android32 then |