RemoveFloatingPoint - Build an Oberon system without Floating Point support
While floating point is certainly important in general-purpose computers, it is mostly unneccessary in some embedded systems. Also, floating point support needs considerable space on a FPGA, therefore you may want to remove it.
Turns out, there are only very few modules in the Project Oberon outer core that actually
require floating point - Files.Mod
to read and write REAL values, Texts.Mod
to read
and parse them, and of course the compiler.
But even when you remove floating point from the compiler, it is straightforward to later compile a compiler with floating point support on the compiler that does not have it (probably because that is the way how floating point support was added to the compiler in the first place).
Splines.patch
can be used to compile DrawAddons
modification on a system without floating point; expect some rough approximations and
overflow artifacts when drawing Splines, though.
Alternatively, SimpleSoftFloat.patch
comes with a very crude
software floating point emulation (providing only about 4 significant digits on division)
and patches both Splines.Mod
and RealCalc.Mod
to use it. Splines is slower than the
previous patch, but I did not notice any precision artifacts.
-
Apply
RealityLost.patch
toFiles.Mod
,Texts.Mod
and the compiler. -
Recompile
Files.Mod
and rebuild the whole system (including the compiler):ORP.Compile Files.Mod/s Modules.Mod/s ~ ORL.Link Modules ~ ORL.Load Modules.bin ~ ORP.Compile Input.Mod/s Display.Mod/s Viewers.Mod/s ~ ORP.Compile Fonts.Mod/s Texts.Mod/s ~ ORP.Compile Oberon.Mod/s ~ ORP.Compile MenuViewers.Mod/s ~ ORP.Compile TextFrames.Mod/s ~ ORP.Compile System.Mod/s ~ ORP.Compile Edit.Mod/s ~ ORP.Compile ORS.Mod/s ORB.Mod/s ~ ORP.Compile ORG.Mod/s ORP.Mod/s ~
-
Restart the system.
-
Revert the patch from above
-
Apply
RealityRegained.patch
to the compiler. -
Recompile the compiler first:
ORP.Compile ORS.Mod/s ORB.Mod/s ~ ORP.Compile ORG.Mod/s ORP.Mod/s ~
-
Restart the system
-
Recompile
Files.Mod
and rebuild the whole system (including the compiler):ORP.Compile Files.Mod/s Modules.Mod/s ~ ORL.Link Modules ~ ORL.Load Modules.bin ~ ORP.Compile Input.Mod/s Display.Mod/s Viewers.Mod/s ~ ORP.Compile Fonts.Mod/s Texts.Mod/s ~ ORP.Compile Oberon.Mod/s ~ ORP.Compile MenuViewers.Mod/s ~ ORP.Compile TextFrames.Mod/s ~ ORP.Compile System.Mod/s ~ ORP.Compile Edit.Mod/s ~ ORP.Compile ORS.Mod/s ORB.Mod/s ~ ORP.Compile ORG.Mod/s ORP.Mod/s ~
-
Restart the system.