1. 24 Feb, 2022 8 commits
    • Jeffrey Lee's avatar
      Add 'K' to version string if MPsafe · 5b8642df
      Jeffrey Lee authored
    • Jeffrey Lee's avatar
      Functional multicore support · 83e9485b
      Jeffrey Lee authored
      Each core now has its own CoreVector, allowing the module to properly
      cope with the different cores being in different states
    • Jeffrey Lee's avatar
      Partial multicore support · 21d1c3af
      Jeffrey Lee authored
      CurrentContext is now tracked on a per-core basis
    • Jeffrey Lee's avatar
      Be aware of multicore machines · de5497f3
      Jeffrey Lee authored
      Update the NewCPV code so that the installed handler will only pay
      attention to aborts which are from the primary core.
    • Jeffrey Lee's avatar
      Add correct SP_und to FPEmulator_Abort · eb9c411d
      Jeffrey Lee authored
      With the old OS_ClaimProcessorVector, it was possible to calculate the
      original (i.e. pre-abort) SP_und value by adding 64 to the address of
      the abort stack frame. With the new OS_ClaimProcessorVector, this is no
      longer the case, since the kernel will have stacked an unknown amount of
      data there (and the CPV context frame). The CPV context contains the
      pre-abort SP_und, so by adding an extra field to the FPE abort stack
      frame we can report that value via FPEmulator_Abort.
      A new SWI, FPEmulator_Info, has also been added, in order to allow
      programs to easily determine the format of the abort stack frame that
      the running FPE version uses.
    • Jeffrey Lee's avatar
      Use the new (RISC OS 5.29) OS_ClaimProcessorVector API · d6d39e8f
      Jeffrey Lee authored
      This is a step towards the following future changes:
      * SMP-friendly FPEmulator; the new OS_ClaimProcessorVector API solves
      some SMP safety issues that the old API had
      * Removal of FPEAnchor; handlers now receive a private word pointer in
      R12, which will make it easier for us to remove FPEAnchor in future
      (this set of changes only partially removes it)
      * Future-proofing FPEmulator against changes/improvements to the stack
      flattening process; with the new API, the kernel is now responsible for
      flattening the stacks and raising any error that the handler wants to
      raise. E.g. in an SMP-friendly OS we'll be want the stack flattening
      process to be capable of unlocking any semaphores/mutexes that the
      aborted code had held
    • Jeffrey Lee's avatar
      Add some test code · 89223d8a
      Jeffrey Lee authored
      A selection of BASIC programs for testing different FP exceptions, and
      data aborts/FPEmulator_Abort.
    • Jeffrey Lee's avatar
      Define stack frame layout · bf831b55
      Jeffrey Lee authored
  2. 28 Jan, 2022 1 commit
  3. 03 Jul, 2021 2 commits
    • Robert Sprowson's avatar
      [515] Fix for loop converting packed decimal infinity/NaNs · 2ef58365
      Robert Sprowson authored
      On encountering an exponent > &4100 (or > &FE0000 for extended packed) to consider as a NaN or infinity, the emulation ends up in LDFConvert_Packed_NaNInf.
      However, this is written as a leaf function and returns with MOV PC,LR when the singular caller of it doesn't expect a return so the LR value is actually still pointing at the last BL around line 1926. This creates an infinite loop.
      Escape the loop by popping the true return value which was stacked on entry.
      Version 4.38. Tagged as 'FPASC-4_38'
    • Robert Sprowson's avatar
      [516] Return divide by zero for non integer -ve powers of 0 · dec27b4a
      Robert Sprowson authored
      Return +INF and a divide by zero exception for things like 0^-0.5 principally to match what is expected by the C standard, and also so BASIC64 matches the result for 1/SQR(0) too.
  4. 12 Nov, 2019 1 commit
  5. 12 Oct, 2019 1 commit
  6. 12 Apr, 2018 1 commit
    • Ben Avison's avatar
      Updated to build using shared makefiles · a7292e74
      Ben Avison authored
        Makefile rewritten. All the changes elsewhere reflect the fact that
        CoreDir, VeneerDir and FileExt are now passed in from the makefile,
        since that has visibility of filespec differences between OSes.
      Version 4.36. Not tagged
  7. 12 Dec, 2017 1 commit
    • Jeffrey Lee's avatar
      Avoid self-modification for 26bit RAM builds · 26ba350a
      Jeffrey Lee authored
        riscos/Makefile - tweak FPEAnchor handling so that 26bit RAM builds use the legacy low FPEAnchor location instead of storing FPEAnchor locally. This results in a read-only module that can be used in custom ROMs, and saves a few bytes of space.
        Tested via building PlingSystem and checking FPEAnchorType is set correctly
      Version 4.36. Tagged as 'FPASC-4_36'
  8. 13 Apr, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix handling of instructions that fail the condition code check (take 2) · d82d14eb
      Jeffrey Lee authored
        coresrc/s/fpeundef - Fix FPEUndefHandler to make sure FPEReturn is called with Rwp pointing to the current context, not the global workspace. If the instruction which failed the condition code check was followed by one which passes the check, we'd end up trying to interpret the global workspace as a FP context, leading to unpredictable results (e.g. workspace corruption if the instruction writes to a register)
        Tested on Raspberry Pi 3
        Fixes issue seen where "ADFLTD F1,F1,F0 : MVFS F0,F1" was corrupting the FPE context pointer due to MVFS writing to F0, causing a crash on all following FP instructions
        Also likely to fix issue reported on forums:
      Version 4.35. Tagged as 'FPASC-4_35'
  9. 02 Mar, 2016 1 commit
    • Ben Avison's avatar
      Added options files to allow FPEmulator binaries in !System to be built using... · 00cf51ef
      Ben Avison authored
      Added options files to allow FPEmulator binaries in !System to be built using standard Machine identifiers.
        This is necessitated by the fact that from version 4.34, we include
        Hdr:CPU.Arch to decide whether to adapt to architectural changes in ARMv5
        and ARMv7, and that header file uses the Machine build switch.
      Retagged as 'FPASC-4_34'
  10. 29 Feb, 2016 3 commits
    • Ben Avison's avatar
      Bugfix to ARMv8 support · 7ed1405a
      Ben Avison authored
        Previously would abort if an untaken conditional FPA instruction was
        followed by another FPA instruction due to workspace pointer corruption.
        Re-ordered things so that this no longer happens.
        !Draw now works on Raspberry Pi 3
      Retagged as 'FPASC-4_34'
    • Ben Avison's avatar
      Another tweak for ARMv8 compatibility · 8e7c29ab
      Ben Avison authored
        Untaken WFCEQ instruction on module finalisation caused undefined
        instruction to be generated during OS_Reset (e.g. Ctrl-Break).
      Retagged as 'FPASC-4_34'
    • Ben Avison's avatar
      Support ARMv8 (and potentially some ARMv7) cores, and a bugfix. · 8377f0c4
      Ben Avison authored
        * In ARMv7 onwards, the undefined instruction processor vector can be
          entered for untaken conditional architecturally undefined instructions
          (and for these purposes, all FPA instructions can be considered
          architecturally undefined) so we now need to perform the condition code
          check in software even for the first FPA instruction in a run.
        * There were a few cases where the FPEmulator module itself does some
          untaken FPA instructions (to access a hardware FPA) before its undefined
          instruction handler is installed. These have been replaced with
          conditional branches over on the opposite condition.
        * Related bugfix: since ARMv5, the "NV" condition code space has been
          considered to represent different instruction encodings and because
          there were never any MCR2, CDP2 etc instructions for the FPA
          coprocessor, these cause the CPU to take the undefined instruction
          processor vector. But due to the nature of the previous condition code
          checks in our undefined instruction handler, an NV instruction that was
          first in a run of FPA instructions would always be executed, while one
          that was later in a run of FPA instructions would never be. This has
          now been changed so that they all generate an undefined instruction
          exception on ARMv5 onwards, wherever they are found.
        Tested on Raspberry Pi 3.
      Version 4.34. Tagged as 'FPASC-4_34'
  11. 04 Nov, 2015 1 commit
    • ROOL's avatar
      Extra target · be163f25
      ROOL authored
        Clone of Cortex-A8 target, for Cortex-A7/A15/A17.
        Submission from Willi Theiss.
        Tagged as FPASC-4_33-1 since existing binaries unchanged.
  12. 02 Feb, 2015 1 commit
    • Ben Avison's avatar
      Add Raspberry Pi 2 support · d5049d39
      Ben Avison authored
        The Raspberry Pi ROM now joins the IOMD ROM in supporting multiple
        architectures, in this case ARMv6 and ARMv7. This has been achieved by
        creating a new machine type specific for Raspberry Pi. The old ARM11ZF
        machine type remains for builds that are ARM11-only.
      Version 4.33. Tagged as 'FPASC-4_33'
  13. 31 May, 2013 1 commit
    • Jeffrey Lee's avatar
      Fix interaction with undefined instruction environment handler in pre-RISC OS 3.5 builds · da6e0a95
      Jeffrey Lee authored
        Code restructuring performed in FPASC-4_12 resulted in an unintentional change in behaviour on ARM2/ARM3 systems when FPEmulator attempts to pass on an abort to the next claimant of the undefined instruction vector.
        Specifically, FPEmulator's startup code was making a note of the address of the current undef environment handler, instead of the address of the pointer to the current handler. This meant that if OS_ChangeEnvironment was used to change the handler once FPEmulator had been loaded, the new handler would never get called - only the old handler would get called.
        On later systems this bug didn't occur as (a) the kernel has a veneer around the undef environment handler (instead of branching straight to the current claimant from the undef vector), and (b) OS_ClaimProcessorVector tells FPEmulator directly where to go next instead of the module having to try and guess for itself.
        File changes:
        - vensrc/riscos/start: Adjust handling of "LDR PC,xxx" undef vector so that the address being loaded from is cached instead of the contents of the address. Construct special code to use when the FPEmulator context is disabled and we want to immediately pass along the abort.
        - vensrc/riscos/globalws: Reserve workspace for storing the passalong code
        Tested on RISC OS 3.1 under ArcEm
        ARM3 detection routines which rely on the undef environment handler now work correctly instead of failing with undefined instruction errors
        No impact on builds targeting RISC OS 3.5+ as all changes are wrapped in [ :LNOT: Arm600 ]
      Version 4.32. Tagged as 'FPASC-4_32'
  14. 27 Jan, 2013 1 commit
    • Robert Sprowson's avatar
      IOMD moved to distinct machine · 2ddd6e61
      Robert Sprowson authored
      Comments updated in CortexA8/CortexA9/STB55/STB5cx/Tungsten.
      Machine '32' offers SoftOnly now.
      Removed fpemedusa and Phoebe.
      Removed some proliferating !MkROM obey files.
      Version 4.31. Tagged as 'FPASC-4_31'
  15. 10 May, 2012 1 commit
  16. 02 Jan, 2012 1 commit
  17. 12 Sep, 2011 1 commit
  18. 06 Aug, 2011 1 commit
    • Jeffrey Lee's avatar
      Update to work with zero page relocation · 19a98c14
      Jeffrey Lee authored
        Unlike most modules which can just store the zero page pointers in their workspace, FPEmulator is a bit trickier since the zero page pointers are needed from within abort handlers and other places where the module workspace pointer is hard to come by (in fact, FPEmulator uses FPEAnchor to store the module workspace pointer)
        So rather than break/rework lots of perfectly good code, there are now three different FPEmulator builds available, selected via the new FPEAnchorType option:
        * FPEAnchorType=Low will select a build suitable for machines with FPEAnchor at its original location in zero page. This is the default for ROM builds.
        * FPEAnchorType=High will select a build suitable for the FPEAnchor location (&ffff0ff4) that's used with zero page relocation. Machines with relocated zero page must specify this option in their components file.
        * FPEAnchorType=Local will select a build suitable for softloading. Rather than rely on using a zero page location for storing the workspace pointer, the module just stores it within itself. This option is selected automatically for RAM builds and can't be overriden via the components file.
        File changes:
        riscos/Makefile - Reworked makefile to support the new options
        riscos/FPEMacros - Updated AdrWS macro to work with FPEAnchorType=Local
        riscos/options - For non-local builds, declare the appropriate value for FPEAnchor
        riscos/start - Use appropriate FPEAnchor initialisation code
        All 3 configs tested (ROM builds on BB-xM, RAM softload on Iyonix)
      Version 4.29. Tagged as 'FPASC-4_29'
  19. 23 Jun, 2010 1 commit
  20. 22 May, 2010 7 commits
    • Ben Avison's avatar
      Fix interrupt hole on post-indexed load from r13 in non-USR modes · 1d182c17
      Ben Avison authored
        Emulation of instructions like LDFD were doing writeback to r13 with
        interrupts disabled but then re-enabling interrupts before actually
        reading memory, thereby leaving a window for an interrupt to be handled and
        corrupt the unprotected stack memory below r13.
        Fixes ROOL ticket #225.
        Changes originally by mwuerthner and committed by srevill on 2009-12-04.
      Tagged as 'FPASC-4_28'
    • Ben Avison's avatar
      Fixed an error in "UseCLZ" case · 7da0e8cd
      Ben Avison authored
        Broke certain denormalised cases of multiply, divide and remainder.
        Problem originally reported on Iyonix discussion group (failed Paranoia tesst).
        Changes originally committed by kbracey on 2004-09-21.
      Tagged as 'FPASC-4_23'
    • Ben Avison's avatar
      Multiple fixes · 9d4798d6
      Ben Avison authored
        * Denormalised numbers now held consistently in their nominal precision.
          MVF/MNF/ABS of a denormalised number without a change of precision
          treated specially, much like signalling NaNs. This prevents spurious
          underflow traps if they're enabled. Previously
               ; Underflow traps on
               LDFS    F0,DenormalisedSingle
               MVFS    F0,F0
               ; Underflow traps off
               LDFD    F0,SmallestNormalDouble
               MUFD    F0,F0,#0.5
               ; Turn underflow traps on
               STFD    F0,xxx
          would have generated traps.
        * LDFP/STFP rearrangement of NaN significands reinstated, as DDT
          can now make use of it.
        * Typos in over/underflow code for LDFP corrected.
        * Experimental dynamic rounding controls added to FPSR (for emulator
          only). Currently disabled; does not affect LDFP or STFP yet.
        Changes originally committed by kbracey on 2004-01-26.
      Tagged as 'FPASC-4_21'
    • Ben Avison's avatar
      Bug fix, and optimisation for XScale · dce7dc2f
      Ben Avison authored
        * Bug fix in STFP - minor error at bottom of word.
        * New switch to allow use of CLZ.
        Changes originally committed by kbracey on 2003-02-21.
      Tagged as 'FPASC-4_20'
    • Ben Avison's avatar
      Two changes to Generated NaN handling in ARM's core · 294e81b9
      Ben Avison authored
        * Generated NaNs were always negative - they were supposed to have a sign
          based on the operands. As a side effect, some internal routines were not
          obeying their advertised API - this has been corrected.
        * Generated NaNs no longer contained a reason code - this was a deliberate
          ARM change, but I'm going to have a philosophical disagreement and reverse
        Changes originally committed by kbracey on 2002-03-04.
      Tagged as 'FPASC-4_18'
    • Ben Avison's avatar
      Support for processors which feature Thumb mode. · 50bb8c9f
      Ben Avison authored
        Added check to make sure we ignore undefined instruction exceptions generated
        while in Thumb state.
        Changes originally committed by kbracey on 2001-05-31.
        This fix was originally applied to an earlier version of ARM's code and has
        been rebased at ARM's version 1.13 for licensing reasons.
        However, since this was the last change before ARM version 1.13 was merged
        into the RISC OS source tree (on 2001-07-25), it is also representative of
        the the RISC OS sources at that date, barring licence header differences.
      Tagged as 'Thumb-fix' and 'FPASC-4_16'
    • Ben Avison's avatar
      Add Use64bitMultiply option. · b7f7d326
      Ben Avison authored
        ARMv4 architecture (e.g. StrongARM) gains UMULL instruction which enables
        faster calculations at the expense of ARM 2/3/6/7 compatibility.
        Changes originally by kbracey, committed 1998-03-27 by mstphens.
        This fix was originally applied to an earlier version of ARM's code and has
        been rebased at ARM's version 1.13 for licensing reasons.
      Tagged as 'UMULL-fix'
  21. 21 May, 2010 2 commits
    • Ben Avison's avatar
      Workaround for pre-rev 3 SA110 chips. · 3b620adc
      Ben Avison authored
        These had a silicon bug in STM^ instructions - enable workaround by defining
        This fix was originally applied to an earlier version of ARM's code and has
        been rebased at ARM's version 1.13 for licensing reasons.
      Tagged as 'StrongARM-fix'
    • Ben Avison's avatar
      Initial import on a vendor branch for ARM's BSD-licenced releases of the FPASC. · 827b1609
      Ben Avison authored
      This is version 1.13. The original distribution archive is in doc/fpe400.zip.
      The coresrc subdirectory is the only part of the official distribution used
      in the RISC OS implementation, and is rearranged to use a "s" subdirectory
      rather than a ".s" suffix as is customary for RISC OS builds.
  22. 04 Dec, 2009 1 commit
  23. 30 Apr, 2009 1 commit
    • Ben Avison's avatar
      Change to build options. · c3137b50
      Ben Avison authored
        Machine=32 is now built so that it doesn't use UMULL. This is because we
        now require it to operate on ARMv3 Risc PCs and A7000(+).
        Untested, but should be low risk.
      Version 4.27. Tagged as 'FPASC-4_27'