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

Re: [MiNT] GCC Fast Math



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2011-02-09 11:36, Vincent Rivière wrote:
> Vincent Rivière wrote:
>> GCC has internal flags when using -m68060 (68060 only) or -m68020-60
>> (68020 without instructions unfriendly to other processors).
> 
> I was wrong.
> 
> -m68020-60 is friendly to processors from 68020 to 68060, but it *does* use 
> the FPU instructions missing on the 68060, such as fsin.
> 
> http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/M680x0-Options.html#index-m68020_002d60-1465
> 
> So this is not so friendly :-\

But it is the proper way.  An unimplemented coprocessor instruction,
e.g. fsin, will trap exception #11 "Unimplemented Instruction Exception"
(M68060 User's Manual, chapter 6.5 Floating Point Exceptions, pp. 6-19)
which will be taken care of the - hopefully - installed M68060SP: "The
M68060SP emulates the unimplemented floating-point instruction in
software, maintaining user-object-code compatibility."  Meaning that it
does not matter if -ffast-math or -m68060 or -m68881 is used.  The FPU
emulation takes place at the exception level and is completely detached
from the software executing an FPU instruction.  The software has - only
by monitoring the execution time - no real knowledge if the FPU
instruction was executed in hardware (FPU) or by the M68060SP.

My interpretation:
- - M68060SP should always be installed on M68060 systems.
- - Compilers compiling for M68060 should always generated FPU
instructions, nothing else.

Cheers,
	T.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)

iEYEARECAAYFAk1S7/8ACgkQMiyRSD9s+zVePQCfVf4lItyzcr1GpcOO0e3S1sik
EWcAn0NaCTPKTEwTufBHgTpvFx2/NgGh
=eK2+
-----END PGP SIGNATURE-----