-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native ARM Co Pro: won't run FPA code e.g. BASIC64 AKA FBAS135 #46
Comments
Would be good to trap the FPA instructions a bit better and give a more meaningful error. I favour a new BBC basic with VFP support as you all know by now. |
The ARM Eval system includes the original floating point emulation code (fpe) on disk 3: This does "install" on the Native ARM, but BAS135F still fails. I think the source code for FPE is BSD licensed, and is here: This merits further exploration/experimentation. Dave |
Sorry Dave can you point me to the source code for BAS135 / FBAS135. I wonder if I can hack some VFP support in using a mixture of C for the hard stuff and assembler for the simple stuff. (My maths is not up to much so I will not be coding sine and cosine in assembler any time soon). |
@fordp2002 -- it's still in the old PiTubeClient git repo: |
Thanks. Looks like "[ FP=0" is the main text to search for! |
Why not have two ARM co-pros; one 24/32-bit with with trap handlers for any missing instructions (including FPE for FPA) for compatibility with early ARMs including the ARM Evaluation System software and another pure native (even perhaps a 64-bit with a suitable pi)? |
Steven, I'm probably not understanding what you are suggesting... There already are two ARM Co Pros:
|
@hoglet67, clearly I'm not keeping up with developments. My point was "Co Pro 15" doesn't need to emulate FPA since no 32-bit** code will ever use it (except for possible rebuilds of bas135!), but it is useful for Co Pro 12. But I guess that's redundant especially if the MAME sourced emulation includes FPA plus it doesn't need instruction traps anyway since it's all emulation! ** AFAIK only one 32-bit addressing capable ARM(v3) ever had an FPA, the ARM7500FE |
Looking through the BAS135 code linked, the FPA doesn't actually seem to be used for anything. The only actual FPA instruction I can find is that initial WFS. For example, searching for "ADF" (add float) only hits in the assembler token table. So you could probably get FBAS135 to work on a modern ARM by just commenting (or patching) out that WFS instruction. |
There is now a version of BBC Basic called BASICVFP that uses VFP: Here's a disc image that includes it: (BASICVF is the compressed module and XBASICV is the uncompressed module) I tried running this, but it crashed, because it also uses FPA instructions:
Looking at the source: This is here at the WFS instruction here:
WFS is an FPA instruction to write the floating point status registers. (It's the same failure that started this thread!) So to run this on a Pi, we would still need an FPA emulator. Shame.... |
On 8 Apr, 2021, at 5:50 pm, David Banks ***@***.***> wrote:
WFS is an FPA instruction to write the floating point status registers.
(It's the same failure that started this thread!)
So to run this on a Pi, we would still need an FPA emulator.
From the blog post:
"The initial version of BASICVFP is expected to rely on FPA/FPEmulator for implementing the trig/power operations that are not supported by VFP. Future versions may provide more optimal routines, e.g. based on the routines used by Steve Drain’s “Float” module."
I assume that once these routines are implemented via the VFP, the remaining links to FPA-based infrastructure will go away. In RiscOS, the FPA instructions just trigger traps to the emulator.
- Jonathan Morton
|
Running FBAS135 results in the Pi hitting a native exception, because the Pi supports VFP for floating point but code for earlier ARMs uses FPA. See here.
The offending instruction is "WFS r0" which is a write to the floating point status register.
This has been mentioned on stardot, see here.
[Thanks to Dave for explaining this]
The text was updated successfully, but these errors were encountered: