[SOLVED] what to do if my target MIPS cpu has no FPU lazarus / 64-FPC development ---------------------------------------------------------------------- Key-Real · 2024-04-18 12:02 -Cfnone spits: Compiling ./rtl/ps1/system.pp compproc.inc(838,47) Error: Identifier not found "double" compproc.inc(839,47) Error: Identifier not found "double" softfpu.pp(134,19) Error: Identifier not found "double" softfpu.pp(134,25) Error: Error in type definition softfpu.pp(144,19) Error: Identifier not found "extended" softfpu.pp(144,27) Error: Error in type definition system.pp(35,1) Fatal: There were 6 errors compiling module, stopping -Cfsoft generates assembler FPU code some advises? ---------------------------------------------------------------------- Thaddy · 2024-04-18 12:34 You scale integers.... ---------------------------------------------------------------------- Key-Real · 2024-04-18 12:35 yes, but is there not allready a .inc file in the rtl for thouse types ---------------------------------------------------------------------- Laksen · 2024-04-18 14:14 Check how the embedded target does it. Most of those don't have FPU support But beware that it's not just a one liner. It likely requires lots of code to get completely right ---------------------------------------------------------------------- Thaddy · 2024-04-18 16:39 Scaling integers is a junior job and not very complex as long as the required precision is known. For embedded: define your precision... is usually enough. ---------------------------------------------------------------------- Laksen · 2024-04-18 17:04 Thaddy, please keep on topic. This is clearly about softfpu development for the RTL ---------------------------------------------------------------------- Thaddy · 2024-04-18 17:54 But I am on topic. ---------------------------------------------------------------------- PascalDragon · 2024-04-18 19:36 Quote from: Key-Real on April 18, 2024, 02:02:29 pmsome advises? You might need to add Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$define cpufpemu} to the MIPS related defines in compiler/fpcdefs.inc. I have not tested however whether that is enough. Quote from: Thaddy on April 18, 2024, 07:54:39 pmBut I am on topic. You are absolutely offtopic, because as usual you did not read and understand the original post to grasp what this topic is about: It is about using/enabling the software floating point support provided by the compiler for a specific target, not about using fixed comma arithmetic. ---------------------------------------------------------------------- Key-Real · 2024-04-18 20:16 I added the {$define cpufpemu} now can't compile anymore /run/media/key-real/E3AF-F107/code/source/compiler/ppc -Ur -Xs -O2 -n -Fumipsel -Fusystems -Fu/run/media/key- real/E3AF-F107/code/source/rtl/units/x86_64-linux -Fimipsel -FEmipsel/bin/x86_64-linux -FUmipsel/units/x86_64-linux -Cg -Fl/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1 -dRELEASE -DD2024/04/18 -dmipsel -dGDB -Fumips -Sew -o/run/media/key- real/E3AF-F107/code/source/compiler/ppcrossmipsel pp.pas nld.pas(844,54) Error: Identifier not found "fpu_libgcc" nld.pas(1623) Fatal: There were 1 errors compiling module, stopping ---------------------------------------------------------------------- PascalDragon · 2024-04-18 20:27 Quote from: Key-Real on April 18, 2024, 10:16:29 pmnld.pas(844,54) Error: Identifier not found "fpu_libgcc" Either add fpc_libgcc to tfputype in compiler/mips/cpuinfo.pas or protect it using {$if declared(fpc_libgcc)}. ---------------------------------------------------------------------- Key-Real · 2024-04-18 20:48 I added fpu_libgcc to tfputype and 'libgcc' to fputypestr now i do $./compiler/ppcrossmipsel ./rtl/ps1/system.pp -Tps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown- elf/bin/mipsel-unknown-elf- -Cfsoft Warning: Source OS Redefined! Free Pascal Compiler version 3.3.1 [2024/04/18] for mipsel Copyright (c) 1993-2024 by Florian Klaempfl and others Target OS: PlayStation 1 for MIPSEL Compiling ./rtl/ps1/system.pp mips.inc(187,4) Note: "assembler" not yet supported inside inline procedure/function generic.inc(88,40) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead. generic.inc(347,12) Warning: Comparison might be always true due to range of constant and expression generic.inc(544,19) Note: Local variable "pendpart" not used system.inc(482,5) Fatal: Internal error 2007042702 Fatal: Compilation aborted ---------------------------------------------------------------------- PascalDragon · 2024-04-18 21:44 Seems like there are some locations that don't handle software floating point correctly for the MIPS CPU. Best look for fpu_soft inside the other code generator backends and try to adjust locations in the MIPS backend in similar ways. ---------------------------------------------------------------------- Laksen · 2024-04-18 22:49 Anything involving fpu_libgcc is the wrong path to look for, pretty sure it's just leftovers from long ago. fpu_soft is the right fputype for softfloat stuff. Same with CPUFPEMU, as far as I remember it's only relevant for cases where you have mixed support or ancient cpus ---------------------------------------------------------------------- PascalDragon · 2024-04-21 19:23 Quote from: Laksen on April 19, 2024, 12:49:12 amAnything involving fpu_libgcc is the wrong path to look for, pretty sure it's just leftovers from long ago. fpu_soft is the right fputype for softfloat stuff. Same with CPUFPEMU, as far as I remember it's only relevant for cases where you have mixed support or ancient cpus Doesn't change that fpu_libgcc seems to be required for compilation currently. ---------------------------------------------------------------------- Laksen · 2024-04-21 20:36 True, it might have some deep roots but I think it's safe just to define it whenever required like other targets and then just ignoring anything about it ---------------------------------------------------------------------- nickysn · 2024-04-23 14:16 In addition to the advices above, also make sure that the calling convention (defined in compiler/mips/cpupara.pas) doesn't use FPU registers to pass parameters or function return values when the softfpu is selected. For a working example, look at: compiler/avr/cpupara.pas