FP support
Pages: 1 2 3 4 5 6 7 8 9 10 11 12
Cameron Cawley (3514) 157 posts |
Do you have a brief summary of what the current status of the apcs_softpcs library is, and what is still left to do? |
Stuart Swales (8827) 1357 posts |
The apcs_softpcs library has coverage of double (and float) operators, compiler support functions and standard library functions (to C99). No complex double support yet (none planned, I think it would only be me who’d use it). Note that use of /softfp with Norcroft C is not officially supported on RISC OS, but ROOL have been very helpful in fixing compiler bugs in this area. The current stable library sources can be downloaded from: http://croftnuisk.co.uk/exports/apcs_softpcs_20231218.zip Here’s a snippet from the top-level ReadMe to save downloading: What is it? apcs_softpcs provides support for the Norcroft C compiler for RISC OS when used with the softpcs procedure call standard, avoiding use of FPA floating point instructions in the compiled code, with ARM registers used to return floating point values from functions (and also to pass in floating point parameters, as already happens with APCS-32). double values are returned (and double parameters are passed) in ARM registers in FPA word order. apcs_softpcs provides functions to support all the basic floating point operators that may be emitted by the compiler (e.g. VFP instructions are used to implement all of those basic operators for both double and single precision. Note that no separate long double support is needed for these as it is equivalent to double on ARM Norcroft C. However, if VFP is not present on the system on which an application created with apcs_softpcs is run, apcs_softpcs will automatically fall back to using FPA instructions to implement these operators. apcs_softpcs also provides functions which wrap those standard C library functions which return double (or float) values in floating point register VFP instructions (and even just ARM instructions in some cases) are used to implement many of these functions without using the C library fallback, see the ReadMeMore file. If a new enough VFPSupport module (0.15 on) is present on the system on which an application created with apcs_softpcs is run, apcs_softpcs will use the elementary function tables provided by the VFPSupport module to implement the transcendental functions (cos, exp, and friends) for both double and single precision, otherwise falling back to using the C library code as before. VFPSupport module 0.17 or later is recommended. Performance? I obtained a 5-6 times speed improvement when inverting large matrices in PipeDream using VFP arithmetic provided by apcs_softpcs support compared to a standard FPA build using FPEmulator on the same system (ARMX6). If VFP is not available on the system on which an application created with apcs_softpcs is run, there is a small performance penalty for falling back to using FPA instructions for compiler support functions, especially for systems with FPA floating point hardware (that’s very few of them!). This also applies to standard C library math functions. |
Colin Ferris (399) 1813 posts |
Did someone mention FPE used in Draw! A use for Stuart’s Lib :-) |
Stuart Swales (8827) 1357 posts |
The correct thing to do is to eliminate the (repeated, can be sensible for transform setup) FP use there for the win. |
Matthew Phillips (473) 721 posts |
RiscOSM is routinely compiled with the apcs_softpcs library and the application !Run file will automatically select the appropriate !RunImage for your machine. You can tell if you are running the VFP version by checking the Info box to see if the version field includes VFP. Stuart was very helpful getting this working, and ROOL sorted out a compiler bug we encountered. |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12