Callahan wrote on 10. Apr 2016 at 22:10:
Błąd FDIV nie jest wydajnościowy. No tak, racja - pomyliło mi się pewnie z błędem w jednostce branch prediction we wczesnych Pentium. Ale wydawało mi się, że gdzieś widziałem coś o programowym obejściu poprawiającym dokładność kosztem 15-20% wydajności, ale mogło to być coś innego, bo teraz nie mogę tego nigdzie odkopać.
Update: Mam! Znalazłem w pomocy do Delphi:
Quote:Pentium safe FDIV operations
Type Switch
Syntax {$U+} or {$U-}
{$SAFEDIVIDE ON} or {$SAFEDIVIDE OFF}
Default {$U-}
Scope Local
The $U directive controls generation of floating-point code that guards against the flawed FDIV instruction exhibited by certain early Pentium processors.
Windows 95, Windows NT 3.51, and later contain code which corrects the Pentium FDIV bug system-wide.In the {$U+} state, all floating-point divisions are performed using a runtime library routine. The first time the floating-point division routine is invoked, it checks whether the processor's FDIV instruction works correctly, and updates the TestFDIV variable (declared in the System unit) accordingly. For subsequent floating-point divide operations, the value stored in TestFDIV is used to determine what action to take.
Value Meaning
-1 FDIV instruction has been tested and found to be flawed.
0 FDIV instruction has not yet been tested.
1 FDIV instruction has been tested and found to be correct.
For processors that do not exhibit the FDIV flaw, {$U+} results in only a slight performance degradation.
For a flawed Pentium processor, floating-point divide operations may take up to three times longer in the {$U+} state, but they will always produce correct results.In the {$U-} state, floating-point divide operations are performed using in-line FDIV instructions. This results in optimum speed and code size, but may produce incorrect results on flawed Pentium processors. You should use the {$U-} state only in cases where you are certain that the code is not running on a flawed Pentium processor.