[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] [Atari-coldfire] VBCC issues



Hi,

(As this is also of general interest, I'm CCing it to
mint mailing list.  When you reply, please do it only
to one of the addresses, whichever is more suitable.)

On torstai 08 marraskuu 2012, Eero Tamminen wrote:
> Actually, the problem was 16-bit compilation.
> 
> Frank Wille (VBCC 68k backend maintainer) debugged it
> and there was extension missing for a 16-bit value.
> 
> Apparently 16-bit support in VBCC isn't tested much.

GCC built (m68k) GEMlib seems to work fine with VBCC
which makes it much more suitable for Atari programs,
but I bumbled into another VBCC issue...

Because (according to Frank) VBCC "regsused" declaration doesn't
work quite as expected e.g. in tos.h bindings, one should build
Atari code using them with VBCC so that d2 and a2 are declared
as scratch registers (= can be overwritten by called functions):
	-d2scratch -a2scratch

However, this confuses VBCC m68k backend double and "long long"
argument passing; it uses a pair of registers for them and if
only one of the pair is declared as scratched, VBCC may still
think it valid.

E.g. if calling sin() & cos() after each other for the same value,
with optimizations enabled and when using libm that's compiled
with d2 declared as scratch register, the result for latter
function call will be incorrect.


Happily, passing doubles or long longs is very rare in Atari
code.  And until the 16-bit extension bug is fixed, I would
suggest VBCC users just to use 32-bit.


> Btw. Vincent mentioned earlier that VBCC can build ColdFire
> binaries, but I understood from Frank that that's actually
> pretty much untested too, or at least he didn't get any
> feedback VBCC ColdFire support (and doesn't have such
> a device himself).
> 
> Has somebody actually built SW for ColdFire with VBCC
> and did it work OK on Firebee?

Anybody?

	- Eero

> PS. I've built PUNSSi with VBCC for 68k and I could do
> CF build with it too & mail it if somebody's interested
> to test.  As you've noticed, PUNSSi's good test-case
> both for C-compiler & assembler. ;-)