Liste des Groupes | Revenir à c arch |
On Mon, 13 May 2024 21:16:48 +0000, MitchAlsup1 wrote:This only works when each FP instruction is at least as long as a function call. This particular approach was standard on PCs more or less from the very beginning (i.e. 1981++):
Emulation is slow when trap overhead is large and not-slow when trapI think it was a particular version of the old Mac OS, from around 1990 or
overhead is small.
so, that implemented a really amazing hack. Some 32-bit machines had
hardware floating-point, others didn’t. So developers of numerics-
intensive apps had to build two versions of their code, one with the
floating-point instructions, the other with calls to Apple’s SANE library.
The hack involved running code built to use hardware floating-point
instructions, on hardware that didn’t have them. The instructions were of
course trapped and emulated. But more than that, the system would patch
the instruction that caused the trap, turning it into a direct call into
the emulation routine. So after the first execution, each such instruction
would run much faster. Until the code got unloaded from RAM and the patch
was lost, of course.
Les messages affichés proviennent d'usenet.