Board index » delphi » PIII (Over 500 Mhz) Floating Point Exceptions Hell

PIII (Over 500 Mhz) Floating Point Exceptions Hell

After racking my limited mental resources on a different project I found
the following problem
when using code like the following on any PIII equipped systems we have
with a MHZ rating greater
then the 500's we have at most desks.

The following runs perfectly on Pentium 233's, Pentium II 400 and 600's,
PIII 500's
(Generates an error and displays the messagebox), but the 733 and 800
blow with BSOD
even taking down the compiler with it.

procedure TForm1.Button1Click(Sender: TObject);
VAR
  X, Y, Z: Real;
begin
  X:=0;
  Y:=0;
  Z:=0;

  try
    Z:=(X / Y);
  except
    ShowMessage('HUM');
  end;

end;

Could someone enlighten me?  Everyone raves how great the FP performace
is on the PIII's and
I cannot find any errors of them having flawed FP units.  I am using D3
C/S patched 3.02, and
tried the same code w/ D5 trial and it fails.

Please email me at ad...@coldtech.com as I don't usualy frequent this
newsgroup.

 

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Hi,

I have encountered similar problems in one of my projects. After posting my
problem on the newsgroups I got several useful replies many of wich
suggesting a possible problem with video drivers. And while I'm sure that
the problem comes from that general area, I haven't been able to pinpoint
the component that causes the problem. I've stripped a computer with this
problem, ran it with the bare essentials and then changed the bare
essentials, but the error persisted.

Even if I was able to find the solution on one computer, it wouldn't do much
for me since it's very hard and time consuming to track down the hardware
problem. I now know of over 30 computers with this problem, and the number
is growing daily. All of them fairly new and apparently all applications,
except the ones compiled in Delphi work fine. So it's not really a viable
option to spend hours and hours looking for a problem that only crashes
Delphi programs. I reported this problem to Borland or Inprise and in the
meantime I replaced all try ... except statements with an if ... then.

I spent close to a week trying out all sorts of suggestions people gave me.
The only one that came close to a solution was somebody who suggested that I
use the Set8087CW($133F ); statement. I experimented a bit with that and,
indeed, it prevented the crash, but it also skipped the exception, seeing as
that control word disables them.

So no real solution I'm afraid...

Phil,

"Michael Mitchell" <m...@coldtech.com> schreef in bericht
news:39E3331F.373E@coldtech.com...

Quote
> After racking my limited mental resources on a different project I found
> the following problem
> when using code like the following on any PIII equipped systems we have
> with a MHZ rating greater
> then the 500's we have at most desks.

> The following runs perfectly on Pentium 233's, Pentium II 400 and 600's,
> PIII 500's
> (Generates an error and displays the messagebox), but the 733 and 800
> blow with BSOD
> even taking down the compiler with it.

> procedure TForm1.Button1Click(Sender: TObject);
> VAR
>   X, Y, Z: Real;
> begin
>   X:=0;
>   Y:=0;
>   Z:=0;

>   try
>     Z:=(X / Y);
>   except
>     ShowMessage('HUM');
>   end;

> end;

> Could someone enlighten me?  Everyone raves how great the FP performace
> is on the PIII's and
> I cannot find any errors of them having flawed FP units.  I am using D3
> C/S patched 3.02, and
> tried the same code w/ D5 trial and it fails.

> Please email me at ad...@coldtech.com as I don't usualy frequent this
> newsgroup.

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Quote
Michael Mitchell wrote:

> I am using D3
> C/S patched 3.02, and
> tried the same code w/ D5 trial and it fails.

I have never faced that problem, and I wonder if it is a Pentium III
specific problem only? I can't reprocuce it with AMD Duron 700 or
750 MHz processors. My test code was compiled with D3.

With several runs, the test always reports "HUM", and then continues
normally.

Quote
> Could someone enlighten me?  Everyone raves how great the FP performace
> is on the PIII's and

The problem maybe is not purely specific to a high floating point
speed. The Duron processors beat the equivalent P-III processors
in nearly every Windows or float benchmark:
http://www.amd.com/products/cpg/duron/benchmarks/benchmarks.html

This does not mean I would suggest just to skip all the P-III customers,
and sell only to those who are running AMD processors:)

Markku Nevalainen

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Quote
Michael Mitchell <m...@coldtech.com> wrote in message

news:39E3331F.373E@coldtech.com...

Quote
> After racking my limited mental resources on a different project I
> found the following problem when using code like the following on
> any PIII equipped systems we have with a MHZ rating greater then
> the 500's we have at most desks.

> The following runs perfectly on Pentium 233's, Pentium II 400 and
> 600's, PIII 500's
> (Generates an error and displays the messagebox), but the 733 and
> 800 blow with BSOD even taking down the compiler with it.

> procedure TForm1.Button1Click(Sender: TObject);
> VAR
>   X, Y, Z: Real;
> begin
>   X:=0;
>   Y:=0;
>   Z:=0;

>   try
>     Z:=(X / Y);
>   except
>     ShowMessage('HUM');
>   end;

> end;

> Could someone enlighten me?  Everyone raves how great the FP
> performace is on the PIII's and I cannot find any errors of them
> having flawed FP units.  I am using D3 C/S patched 3.02, and
> tried the same code w/ D5 trial and it fails.

> Please email me at ad...@coldtech.com as I don't usualy frequent
> this newsgroup.

Just two points that may be worth mentioning...

Type REAL is a software implementation of floating point and does
not use the hardware FPU.

When trying your example (using Real or Extended), compiler optimisation
effectively removed the calculation (since nothing
is done with the result) and so nothing happened.  Switching
the optimisation off produced the expected HUM on my PIII 533MHz.

Lester

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Dear Lester Hanger,

you are absolutely right concerning the meaning of "real" for Delphi while
using D1, maybe D2, D3, but at least since D5 (which has been also tested by
Michael Mitchell) the meaning of "Real" is by default equal to double (you
can change this new meaning by use of {$REALCOMPATIBILITY ON} or declare the
variable with Real48) and thus uses the FPU also.

Lester Hanger schrieb:

Quote
> Michael Mitchell <m...@coldtech.com> wrote in message
> > I am using D3 C/S patched 3.02, and
> > tried the same code w/ D5 trial and it fails.
> >Just two points that may be worth mentioning...

> Type REAL is a software implementation of floating point and does
> not use the hardware FPU.

> Lester

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Dear Michael Mitchell,

Actually I heared of a similar problem in a german newsgroup. The reason for
this behaviour was found to be due to IDE devices which where connected to
an ATA66-Promise instead of the onboard ATA33, while both onboard IDE
channels were empty. When both IDE devices were connected to the onboard IDE
channels the problem was solved.
Someone told us to look in comp.lang.pascal.delphi.misc for the posting
titeled "try..except different behavior on NT and Win95" which describes
this phenomenon.

Yours,

Daniel Spangenberg

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Hi,

The problem in the posting "try..except different behavior on NT and Win95"
concerned an eOutofMemory exception. The problem here is the EZeroDivide
exception. Maybe the two problems are connected, but I encounter the problem
on such a wide range of computers that I'm not completely sure. Furthermore,
customers don't seem to have problems with other applications, just the ones
compiled in Delphi that cause an EZeroDivide exception.

Phil,

"Daniel Spangenberg" <spang...@rz.uni-duesseldorf.de> schreef in bericht
news:39E42CDF.7E8B6299@rz.uni-duesseldorf.de...

Quote
> Dear Michael Mitchell,

> Actually I heared of a similar problem in a german newsgroup. The reason
for
> this behaviour was found to be due to IDE devices which where connected to
> an ATA66-Promise instead of the onboard ATA33, while both onboard IDE
> channels were empty. When both IDE devices were connected to the onboard
IDE
> channels the problem was solved.
> Someone told us to look in comp.lang.pascal.delphi.misc for the posting
> titeled "try..except different behavior on NT and Win95" which describes
> this phenomenon.

> Yours,

> Daniel Spangenberg

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Quote
"Philip Blond" <pblo...@e-officedirect.com> wrote in message

news:HI_E5.3490$s31.79194@afrodite.telenet-ops.be...

Quote
> Hi,

> The problem in the posting "try..except different behavior on NT and
Win95"
> concerned an eOutofMemory exception. The problem here is the EZeroDivide
> exception. Maybe the two problems are connected, but I encounter the
problem
> on such a wide range of computers that I'm not completely sure.
Furthermore,
> customers don't seem to have problems with other applications, just the
ones
> compiled in Delphi that cause an EZeroDivide exception.

One might (IMO, safely) assume that other applications are not using
try/except but testing for zero before attempting the division. Thus while
Delphi code can be used to exhibit the problem I doubt that there is
anything specific in Delphi code that contributes to it. It does seem that
there are some "interesting" side effects with various driver combinations
in W95/98.

Re:PIII (Over 500 Mhz) Floating Point Exceptions Hell


Quote
In article <39e3a521$0$...@hades.is.co.za>, Lester Hanger wrote:

>Just two points that may be worth mentioning...

>Type REAL is a software implementation of floating point and does
>not use the hardware FPU.

No. He also had the problem under FPC, and FPC maps the REAL type to the
double type. (and afaik so do newer Delphi's)

Other Threads