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

Re: [MiNT] GCC Fast Math



Miro Kropáček wrote:
Hm, this is really strange then. So I use -m68060 and gcc will use
emulated instructions with -f/fast/-math?

I don't know, you will have to make your own tests.

Btw I'd be very interested to know to what situations this -m68060
option applies, i.e. where is an option to branch according to
-m68020-60 and -m68060.

GCC has internal flags when using -m68060 (68060 only) or -m68020-60
(68020 without instructions unfriendly to other processors).
This can be tested by user programs through defines. I don't know them
off the top of my head.

A useful option: you can list all the defines predefined by GCC like
this (test.c can be empty):
gcc test.c -E -dM

There are a lot of defines in GCC 4.x, you can use different CPU options and use diff on the result to see what changes.

Unless -ffast-math is used, everything is handled in libm (including
inlining)

Either math inlining occurs in the user sources, or there are calls to
libm, but there is no inlining inside libm... But there is inline assembler.

Oh, I remember for sure, PML (which is very old) uses fsin.d and all the other 68881 instructions inside its inline assembler when compiled with -m68020-60. This is not good for 68060.

And btw #2, we've discussed this on ACP forum but it might be of
interest to others too: while looking into gcc manual pages, it
states __HAVE_68881__ is defined /only/ for -mhard-float and
-m68881, i.e. mint target is wrong here ! (-m68060 defines it, too,
probably because of multilib configuration -m68020-60 ~ -m68060?)

If I didn't make any mistake in the config file, those CPU defines are
not tweaked by the MiNT patch. They are the standard GCC ones. I use a
standard m68k-elf toolchain as a reference. If you think something is
wrong, you should report that to the GCC team.

--
Vincent Rivière