home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,948 of 4,675   
   Terje Mathisen to Rick C. Hodgin   
   Re: I'm looking for a mathematical libra   
   19 Sep 19 08:21:51   
   
   From: terje.mathisen@nospicedham.tmsw.no   
      
   Rick C. Hodgin wrote:   
   > On 9/18/2019 7:50 PM, Bart wrote:   
   >> On 18/09/2019 13:05, Rick C. Hodgin wrote:   
   >>> I searched for it but couldn't find it.  There used to be an 8087.asm   
   >>> app that worked with DOS.  It would install a software emulator for   
   >>> the 8086/8088 CPUs so it would work with native x87 FPU instructions.   
   >>> I may still have it on one of my Programmer's Heaven CDs from back in   
   >>> the BBS days.   
   >>>   
   >>> It was fully IEEE-754 compliant and could be adapted.  In fact, IIRC,   
   >>> a version of that program was used to find the famous Pentium FDIV   
   >>> bug, as the software version was reporting correctly, and the Pentium   
   >>> was reporting incorrectly, over a particular range of inputs.   
   >>   
   >> If emulating 8087 then that puts extra demands on the emulation   
   >> library, especially if emulating its internal 64-bit calculations.   
   >   
   > Yes.  The x86 CPU has a feature to allow software emulation of the   
   > full x87 instruction set.  Whenever an x87 instruction is encountered   
   > in x87 emulation mode, it signals an interrupt which dispatches to a   
   > handler.  There the software simulates the operation, and then iret   
   > back and it keeps going.  Slow, but it provides an easy x87 operation   
   > when all you have is an 8086 or 8088.   
      
   The faster option was to compile the program so that each 8087   
   instruction was compiled into a CALL to the emulator routine:   
      
   If the 8087 hw was available, the emulator would patch the call site   
   into the actual 8087 opcodes plus any NOPs needed to fill up the   
   typically 3-byte call. If the opcode was in fact longer than the call,   
   then the call would in fact be padded so that it could be replaced.   
      
   Since all this code was always single-threading there was no issue with   
   patching running code, no risk of overwriting stuff that was currently   
   running somewhere.   
      
   Terje   
      
   --   
   -    
   "almost all programming can be viewed as an exercise in caching"   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca