[comp.sys.mac.programmer] F Emulator, Just what the hey is it

wolf@mel.cipl.uiowa.edu (08/08/90)

Me again....

What is the "F Emulator" error mean?  I've gotten it a few times and I was
wondering.

oster@well.sf.ca.us (David Phillip Oster) (08/10/90)

68000 instructions that begin with the hex code 0xFxxx are reserved for 
coporcessor chips. If you don't have a coprocessor, then you get a software
interrupt to an interrupt routine that is supposed to emulate the coprocessor.
If the 0xFxxx instruction is in fact ransom garbage that the processor is
being asked to execute, then the emulation routine will just give up. Since
the processor is already executing garbage, Apple decied the only safe thing
to do was System Error.
-- 
-- David Phillip Oster - Note new signature. Old one has gone Bye Bye.
-- oster@well.sf.ca.us = {backbone}!well!oster

topping@anaconda.cis.ohio-state.edu (brian e topping) (08/10/90)

In article <19493@well.sf.ca.us> oster@well.sf.ca.us (David Phillip Oster) writes:
>68000 instructions that begin with the hex code 0xFxxx are reserved for 
>coporcessor chips. If you don't have a coprocessor, then you get a software
>interrupt to an interrupt routine that is supposed to emulate the coprocessor.

Why then was SANE implemented as it was?  It seems that it would be better
to have SANE respond to the interrrupts, then there would be no need for
different versions of programs like Wings depending on whether or not you have
an 881.

>-- David Phillip Oster - Note new signature. Old one has gone Bye Bye.

Brian Topping
<topping@cis.ohio-state.edu>

billkatt@mondo.engin.umich.edu (billkatt) (08/11/90)

In article <82893@tut.cis.ohio-state.edu> brian e topping <topping@cis.ohio-state.edu> writes:
>In article <19493@well.sf.ca.us> oster@well.sf.ca.us (David Phillip Oster) writes:
>>68000 instructions that begin with the hex code 0xFxxx are reserved for 
>>coporcessor chips. If you don't have a coprocessor, then you get a software
>>interrupt to an interrupt routine that is supposed to emulate the coprocessor.

Says who?  I don't recall reading and documentation on the 680x0's which says
you must or even should emulate a math coprocessor if you don't have one.
Clearly, it is a good idea, especially since more than one program will bomb
on Apple's new Macs with 68030's (020's?) and no math coprocessor, simply
because some programs assume 68030's and 68881/2's always go together.  But
Apple didn't do anything WRONG by not emulating one.

>
>Why then was SANE implemented as it was?  It seems that it would be better
>to have SANE respond to the interrrupts, then there would be no need for
>different versions of programs like Wings depending on whether or not you have
>an 881.

SANE is more accurate than the 881/882.  SANE uses 80-bit numbers instead of
96-bit numbers.  SANE has routines for converting to/from ASCII strings, the
881 only does number crunching, how you get the numbers in and out are your
problem. SANE just wasn't meant as a replacement for the 881, it was
meant as a totally different method of approaching math processing.  

=============================================================================
Steve Bollinger                                                    ____/|
909 Church St. Apt C                                               \ o.O|
Ann Arbor, Mi. 48104                                                =(_)=
(313)-662-4073 -home (313)-763-3070 -work                             U     
billkatt@mondo.engin.umich.edu                              -ACK ACK ACK ACK!
                                                              "thhhhppppttt!"

topping@iroquois.cis.ohio-state.edu (brian e topping) (08/13/90)

In article <1990Aug10.184535.11051@caen.engin.umich.edu> billkatt@mondo.engin.umich.edu (billkatt) writes:
>In article <82893@tut.cis.ohio-state.edu> brian e topping <topping@cis.ohio-state.edu> writes:
>>In article <19493@well.sf.ca.us> oster@well.sf.ca.us (David Phillip Oster) writes:
>>>68000 instructions that begin with the hex code 0xFxxx are reserved for 
>>>coporcessor chips. If you don't have a coprocessor, then you get a software
>>>interrupt to an interrupt routine that is supposed to emulate the coprocessor.
>
>Says who?  I don't recall reading and documentation on the 680x0's which says
>you must or even should emulate a math coprocessor if you don't have one.
>Clearly, it is a good idea, especially since more than one program will bomb
>on Apple's new Macs with 68030's (020's?) and no math coprocessor, simply
>because some programs assume 68030's and 68881/2's always go together.  But
>Apple didn't do anything WRONG by not emulating one.

True, but it ALSO doesn't say anywhere that must or should include an A
line emulator.  Without this, the toolbox would be quite a different animal.
I didn't say they did anything wrong, I am just wondering why they didn't
make it a bear for people who really need the speed of the 881/2 and want
to be compatible between machines.


>SANE is more accurate than the 881/882.  SANE uses 80-bit numbers instead of
>96-bit numbers.  SANE has routines for converting to/from ASCII strings, the
>881 only does number crunching, how you get the numbers in and out are your
>problem. SANE just wasn't meant as a replacement for the 881, it was
>meant as a totally different method of approaching math processing.  

I tend to differ here also.  It was indeed a replacement for the 881, as
they are both IEEE 754 conformant methods of doing math.  The fact that
things are different between the two is a given considering different
programmers worked on them under different constraints.  96/8 = 16, which
is the same size of a 030 block move.  Coincidence?  I doubt it.

I am not saying that accuracy is not important, but I doubt that IEEE would
have specified a standard that was insufficient.  (This may also show my
unfamiliarity with how IEEE works.)  There are a lot of routines the 881
does that SANE does not.  Whatever the 881 does should have been emulated,
the rest put into the _FP68K trap like they are now.  Really, what is going
on now is F line emulation (881 functions) through the A line emulator
(A Traps and _FP68K).


>Steve Bollinger                                                    ____/|

Brian Topping
<topping@cis.ohio-state.edu>

bayes@hpislx.HP.COM (Scott Bayes) (08/31/90)

One reason for not doing your software math through an F-line emulator
unless you have to:

It can be significantly slower than using stack or register-based calls
on the library.  Consider that to emulate an FMOVE, the exception needs
to be raised and processed, putting a lot of junk on the stack, the
stack then examined to see what was happening when the exception was
raised, that operation performed in emulation, then the stack cleaned up
with an RTE or facsimile.  Of course you haven't done any math yet,
you've only set up one of the operands.

Contrast this to 2 or 3 move.l instructions to register or stack
required to set up a floating argument for the library.

Scott Bayes
Hewlett-Packard Co