Page 1 of 4
Getting software to work on 68LC060
Posted: 26 Aug 2020 21:26
by alenppc
The 68LC060 (rev4) is super cheap right now, it clocks really high (same as rev6), it would be a shame not being able to use it. But how to get software to run on it?
Unfortunately almost everything crashes, including Stephen's own CPUSPEED command. The forced FPU code is coming out of somewhere but I can't figure out from where. What's really weird is that the same setup runs fine on 030 without FPU, so it's probably some component of AmigaOS that detects an 040+ and forces FPU instructions. But which part?
Re: Getting software to work on 68LC060
Posted: 26 Aug 2020 22:53
by amimjf
Hi,
I guess this might be obvious, but the OS can't force FPU instructions unless they are generated by the compiler or present in inline assembly. Likewise if the program loads a dynamic library or links against a static library that has no FPU instructions there are none for the FPU to execute. Question is where are FPU instructions coming from ?
An FPU instruction on an LC will probably produce an illigal instruction trap in a debugger.
Combination of a resident debugger like COP and SnoopDOS will let you see where the FPU instruction is loaded from.
At a guess some library is deciding 060 is always full, as that was always the case on historical accelerators.
Re: Getting software to work on 68LC060
Posted: 26 Aug 2020 23:01
by terriblefire
The 680x0 series can trap all unrecognised instructions and emulate them.
Because AmigaOS is stupid you have to create separate binaries for 6888x emulation (via a library), real 68881/2 and 68040/68060 FPU. All three are different need different binaries. IMHO the code should always do the same and the OS should handle the absence of an FPU. I'd call this hardfloat on ARM.
Either that or the runtime linker should patch up things at runtime. But the current state of not having a single binary that can run on all setups is very irrirating.
My cpuspeed C code does float math so it needs to be recompiled for no-fpu. I'll get around to it.
Re: Getting software to work on 68LC060
Posted: 26 Aug 2020 23:22
by alenppc
Ok I get the explanation for cpuspeed, makes sense. But what doesn’t make sense is all the other software happily crashing away while the same software runs without issue on the 030 without fpu.
Re: Getting software to work on 68LC060
Posted: 26 Aug 2020 23:32
by amimjf
Well if you compile for no-fpu and don't link against any libraries that have fpu code in them it will work on any 060.
Problem of course is that most/all 060 exe's where compiled for FPU, not even sure if you can specify 060 + no-fpu code generation in most compilers as it was never a historically available combination.
Simplest option would probably be an LC aware 060 library that handled trapped 060 fpu instructions and emulated them in software, just like standard 060 libraries do with 040 instructions not present on the 060.
Problem is that it would be pretty slow for any fpu intensive stuff
Re: Getting software to work on 68LC060
Posted: 27 Aug 2020 07:46
by terriblefire
amimjf wrote: 26 Aug 2020 23:32
Well if you compile for no-fpu and don't link against any libraries that have fpu code in them it will work on any 060
It doesnt thought. Tried it.. its infuriating.
Re: Getting software to work on 68LC060
Posted: 27 Aug 2020 11:50
by juz400
Could this be of any help in your diagnosis?
I think it might be for the missing FPU instructions from 68882 though.
http://aminet.net/package/dev/debug/FPSPSnoop
This debugging tool intercepts the traps generated by a 68040 or 68060
processor as soon as it detects an instruction that is valid, but not
implemented in hardware. It is the job of the 68040 or 68060.library to
emulate these instructions in software. FPSPSnoop disassembles these
instructions, and prints the user status of the CPU and FPU at the
time the emulation is entered.
Re: Getting software to work on 68LC060
Posted: 27 Aug 2020 13:19
by terriblefire
Try this... its compiled as -lmieee
cpuspeed.zip
Re: Getting software to work on 68LC060
Posted: 27 Aug 2020 14:03
by supaduper
Just tried CPUSPEED LC on an LC 060 on the TF360 and it all looks good here fella
Re: Getting software to work on 68LC060
Posted: 27 Aug 2020 15:18
by 32Bits
This is great news. Thanks for the recompile will test with my LC.