Neoverse N1 32 bit user mode CPSR bit 5 = 0
Pages: 1 2
Colin Ferris (399) 1809 posts |
Unless you want your prog to run on RO 3.1 hardware – why do need to use Teq PC,PC etc,? [Edit] Mrs/Msr etc emulator for ro 3.1 |
Stuart Swales (8827) 1349 posts |
26-bit mode lived on well past RISC OS 3.1, Colin! If you want to be 26/32 agnostic in today’s applications, you still need to do this sort of thing. Adding MRS etc. emulation to RISC OS 3.1-level hardware would really hobble FPE performance, wouldn’t it? RE possibly non-executing conditional instructions and FPEmulator: TEQ pc, pc LDMNEFD sp!,{?,pc}^ LDMFD sp!,{?,pc} Where needed, I think I’d always done this: TEQ r0, r0 ; iff needed TEQ pc, pc LDMEQFD sp!,{?,pc} ; 32-bit exit LDMFD sp!,{?,pc}^ ; 26-bit exit as I did think that this day might arrive. We can’t change unmaintained code, just patch at load/run-time, but might it be advisable to move maintained code over to one that is likely to continue working? Wouldn’t dropping out of FPEmulator to execute possibly non-executing conditional instructions slow code like CMFD Fn,#some_fp_value MOVEQ Rn,#some_integer_value FIXNED Rn,Fn (off top of head, so prob wrong syntax) |
Jeffrey Lee (213) 6048 posts |
AIUI the problem Timothy is mentioning with FPEmulator relates to this set of changes that were introduced to cope with the Pi 3, where FPA instructions which fail the condition check were triggering the undefined instruction handler (on older CPUs, only instructions which pass the condition check were capable of triggering an undef exception, so FPEmulator wasn’t expecting to see such an instruction and would end up emulating it instead of skipping it). To fix that, the entry to the undef handler was modified to skip over any instruction which fails the condition check. This is a bit over-aggressive because it could be hiding problems with non-FPA instructions which we’re interested in knowing about/dealing with. So the fix would be to have it confirm that it’s a FPA instruction before deciding whether to execute or skip it (and if it’s not an FPA instruction, pass it on to the next handler) |
Stuart Swales (8827) 1349 posts |
Ah, fairy nuff. I couldn’t remember whether FPEmulator was skipping over non-executable conditional instructions (whether FPA or not) to possibly find another FPA instruction that it might decode without having to go through the undefined instruction trap. |
Pages: 1 2