Polskie forum 3dfx
Retro Computers >> Hardware PC >> dorwałem Pentacza z fdiv bug :)
http://3dfx.pl/cgi-bin/yabb2/YaBB.pl?num=1460308888;post=4

Message started by sajmon on 10. Apr 2016 at 19:21

Title: Re: dorwa[ch322]em Pentacza z fdiv bug :)
Post by Neo on 11. Apr 2016 at 08:31
Callahan wrote on 10. Apr 2016 at 22:10:
B[ch322][ch261]d FDIV nie jest wydajno[ch347]ciowy.

No tak, racja - pomyli[ch322]o mi si[ch281] pewnie z b[ch322][ch281]dem w jednostce branch prediction we wczesnych Pentium. Ale wydawa[ch322]o mi si[ch281], [ch380]e gdzie[ch347] widzia[ch322]em co[ch347] o programowym obej[ch347]ciu poprawiaj[ch261]cym dok[ch322]adno[ch347][ch263] kosztem 15-20% wydajno[ch347]ci, ale mog[ch322]o to by[ch263] co[ch347] innego, bo teraz nie mog[ch281] tego nigdzie odkopa[ch263].

Update: Mam! Znalaz[ch322]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.

Polskie forum 3dfx » Powered by YaBB 2.7.00!
YaBB Forum Software © 2000-2024. All Rights Reserved.