* fp exceptions
@ 1999-06-20 20:37 glenn murphy
1999-06-20 21:17 ` Wes Bauske
0 siblings, 1 reply; 10+ messages in thread
From: glenn murphy @ 1999-06-20 20:37 UTC (permalink / raw)
To: axp-list
I'm sorry if any of my questions are FAQs. I'm just learning to program,
and I get a lot of floating point exceptions at runtime with code that
runs fine on x86 systems. I'm using a 21064 (cabriolet) with RedHat 5.2.
Is this something specific to the 21064 that I need a compiler option for?
Is this a problem with egcs 1.0.3 that comes with RHL 5.2? If I upgrade
egcs, do I need to upgrade all the libs as well? Any help would be
greatly appreciated.
Glenn
gpmurphy@mcs.net
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: fp exceptions
1999-06-20 20:37 fp exceptions glenn murphy
@ 1999-06-20 21:17 ` Wes Bauske
0 siblings, 0 replies; 10+ messages in thread
From: Wes Bauske @ 1999-06-20 21:17 UTC (permalink / raw)
To: axp-list
glenn murphy wrote:
>
> I'm sorry if any of my questions are FAQs. I'm just learning to program,
> and I get a lot of floating point exceptions at runtime with code that
> runs fine on x86 systems. I'm using a 21064 (cabriolet) with RedHat 5.2.
> Is this something specific to the 21064 that I need a compiler option for?
> Is this a problem with egcs 1.0.3 that comes with RHL 5.2? If I upgrade
> egcs, do I need to upgrade all the libs as well? Any help would be
> greatly appreciated.
>
Well, there are a couple things to do. First, run the program
under gdb and see why you get the FP exception. It is quite
likely that you are accessing something you shouldn't be. The
Intels don't show the problem because they force the bad numbers
to zero or FLOATMAX, and happily continue on with the calculation.
Now, sometimes this fixup is quite reasonable to do and so you
let it go but Alphas are a bit more picky in that they expect all
FP values to be normalized. So, it you think the results of your gdb
run/examination are acceptable (meaning you don't want to fix the
code to eliminate the problem) then you might try -mieee to force
the Alphas to slow down and handle the oddball numbers in SW rather
than HW. This still might not work if your FP exception is in a
library routine though, like exp().
Wes
^ permalink raw reply [flat|nested] 10+ messages in thread
* FP Exceptions
2001-04-23 18:52 compiling kernel 2.4.3 Uncle George
@ 2001-05-01 3:23 ` T. Daniel Crawford
2001-05-01 5:30 ` Greg Lindahl
2001-05-01 10:56 ` Uncle George
0 siblings, 2 replies; 10+ messages in thread
From: T. Daniel Crawford @ 2001-05-01 3:23 UTC (permalink / raw)
To: axp-list
Thanks to Uncle George for a good explanation of what's happens when
floating-point exceptions occur; I believe I'm beginning to understand some
of the basic issues involved in denorm handling.
The problem I'm running into is when denorms are generated within optimized
libraries like CXML (specifically the BLAS routines). I've tried to
compile Kazushige Goto's BLAS codes with -fpe3 to try to eliminate these
FPE problems, but to no avail. (His DGEMM functions use some hand-coded
assembler, however, so my -fpe3 flags may make no difference there.) So,
I'm still up against a wall.
In addition, what I still don't understand is the difference in FPE handling
between Tru64 and Linux. My denorm problems are not occuring under Tru64,
even with the code compiled without the -fpe3 flag. For those few of us
here on the axp-list who are new to this subject, can anyone explain this?
If knowledgeable people are looking for assistance in tracking down these
problems, I would be more than willing to help.
Furthermore, I fear that even if I can get rid of the exceptions through
-fpe3 or something similar, the performance hit will be so great that I'll
have to give up Linux in favor of Tru64 after all.
-Daniel
--
T. Daniel Crawford Department of Chemistry
crawdad@vt.edu Virginia Tech
www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255
--------------------
PGP Public Key at: http://www.chem.vt.edu/chem-dept/crawford/publickey.txt
On Mon, 23 Apr 2001, Uncle George wrote:
> FP operations are pipelined, and are at various stages of execution. Without the
> -mieee ( gcc - "C" compile ) switch the FPU processes instructions till a trap
> occures, then Kaos happens The kernel does not know where exactly the failure
> occured.
>
> With -mieee the compiler places limits on the operations that can occure in the
> pipeline, and if a limit is exceeded, the compiler will place a pause ( trapb )
> instruction till the FPU has been drained & ALL possible TRAPS have been processed.
> So long as things are in a proper sequence, the kernel kan attempt to fix the error.
> Because it know how to backtrace/backstep
>
> The problems I am having is with -mieee & a trap & not having the right number
> returned as a part of the fix-up. The numerical number will also happen with any
> compiler, as it is a kernel bug
> /gat
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 3:23 ` FP Exceptions T. Daniel Crawford
@ 2001-05-01 5:30 ` Greg Lindahl
2001-05-01 10:56 ` Uncle George
1 sibling, 0 replies; 10+ messages in thread
From: Greg Lindahl @ 2001-05-01 5:30 UTC (permalink / raw)
To: axp-list
On Mon, Apr 30, 2001 at 11:23:50PM -0400, T. Daniel Crawford wrote:
> The problem I'm running into is when denorms are generated within optimized
> libraries like CXML (specifically the BLAS routines).
One problem with the compaq libraries is that they all apparently
generate denorms, which is a pain when you call exp() and want zero
and get back a denorm.
I was under the impression that Goto's routines should return zero
instead of denorms. If not, you can ask him about it.
> I've tried to
> compile Kazushige Goto's BLAS codes with -fpe3 to try to eliminate these
> FPE problems, but to no avail.
Because they're assembler, they won't respect that flag. At best
you'll get undefined behavior.
> In addition, what I still don't understand is the difference in FPE handling
> between Tru64 and Linux. My denorm problems are not occuring under Tru64,
If you can generate an example, and prove that the library is the
guilty party, Compaq would probably see it as a bug. However such bugs
have sometimes turned out to be kernel bugs in the past, so both
avenues have to be explored...
-- g
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 3:23 ` FP Exceptions T. Daniel Crawford
2001-05-01 5:30 ` Greg Lindahl
@ 2001-05-01 10:56 ` Uncle George
2001-05-01 11:52 ` T. Daniel Crawford
1 sibling, 1 reply; 10+ messages in thread
From: Uncle George @ 2001-05-01 10:56 UTC (permalink / raw)
To: axp-list
for linux 2.4.3 in arch/alpha/math-emu/math ( approx line 215 ) have a try with this
change. This should fix a conversion of a single FP denorm, into a double.
/gat
\
> case FOP_FNC_CVTxS:
> /* It is irritating that DEC encoded CVTST with
> SRC == T_floating. It is also interesting that
> the bit used to tell the two apart is /U... */
> if (insn & 0x2000) {
> FP_CONV(S,D,1,1,SR,DB);
> goto pack_s;
> } else {
> /* CVTST need do nothing else but copy the
> bits and repack. */
> /* Not exactly,
> * Conversion is from single -> double
> * so vb needs to be in a 32 bit
> * float form, and UNPACK'ed as such! */
> vb = alpha_read_fp_reg_s(fb);
> FP_UNPACK_SP(SB, &vb);
> DR_c = SB_c;
> DR_s = SB_s;
> DR_e = SB_e;
> DR_f = SB_f << ( 52 - 23 );
>
> goto pack_d;
> }
>
>
>
>
> The problem I'm running into is when denorms are generated within optimized
> libraries like CXML (specifically the BLAS routines). I've tried to
> c
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 10:56 ` Uncle George
@ 2001-05-01 11:52 ` T. Daniel Crawford
2001-05-01 12:23 ` Uncle George
0 siblings, 1 reply; 10+ messages in thread
From: T. Daniel Crawford @ 2001-05-01 11:52 UTC (permalink / raw)
To: axp-list
On Tue, 1 May 2001, Uncle George wrote:
> for linux 2.4.3 in arch/alpha/math-emu/math ( approx line 215 ) have a try with this
> change. This should fix a conversion of a single FP denorm, into a double.
> /gat
When compiling 2.4.3 on your alpha, did run into compilation problems
related to conflicting declarations of pmd_alloc() and pte_alloc()?
-Daniel
--
T. Daniel Crawford Department of Chemistry
crawdad@vt.edu Virginia Tech
www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255
--------------------
PGP Public Key at: http://www.chem.vt.edu/chem-dept/crawford/publickey.txt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 11:52 ` T. Daniel Crawford
@ 2001-05-01 12:23 ` Uncle George
2001-05-01 12:26 ` T. Daniel Crawford
0 siblings, 1 reply; 10+ messages in thread
From: Uncle George @ 2001-05-01 12:23 UTC (permalink / raw)
To: axp-list
yup, u are not alone. I would just edit the 2.4.x kernel that u have. It seems like the
kernel is in flux for the alpha series :-{
/gat
BTW my problem with the 2.4.x kernel was with the failure of pppoe ( dsl ) to work :-/
"T. Daniel Crawford" wrote:
> On Tue, 1 May 2001, Uncle George wrote:
>
> > for linux 2.4.3 in arch/alpha/math-emu/math ( approx line 215 ) have a try with this
> > change. This should fix a conversion of a single FP denorm, into a double.
> > /gat
>
> When compiling 2.4.3 on your alpha, did run into compilation problems
> related to conflicting declarations of pmd_alloc() and pte_alloc()?
>
> -Daniel
>
> --
> T. Daniel Crawford Department of Chemistry
> crawdad@vt.edu Virginia Tech
> www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255
> --------------------
> PGP Public Key at: http://www.chem.vt.edu/chem-dept/crawford/publickey.txt
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 12:23 ` Uncle George
@ 2001-05-01 12:26 ` T. Daniel Crawford
2001-05-01 13:03 ` Uncle George
2001-05-02 12:10 ` Uncle George
0 siblings, 2 replies; 10+ messages in thread
From: T. Daniel Crawford @ 2001-05-01 12:26 UTC (permalink / raw)
To: axp-list
On Tue, 1 May 2001, Uncle George wrote:
> yup, u are not alone. I would just edit the 2.4.x kernel that u have. It seems like the
> kernel is in flux for the alpha series :-{
> /gat
>
> BTW my problem with the 2.4.x kernel was with the failure of pppoe ( dsl ) to work :-/
>
Yup, I added your patch to my 2.4.2 kernel and it compiles. After I get
back from my class this morning I'll give it a shot.
Your DSL connection depends on lots of FP math?
Also, should I get lots of warnings like:
math.c: In function `alpha_fp_emul':
math.c:204: warning: right shift count is negative
math.c:204: warning: left shift count >= width of type
math.c:220: warning: left shift count is negative
math.c:245: warning: statement with no effect
math.c:265: warning: right shift count >= width of type
math.c:265: warning: right shift count >= width of type
math.c:269: warning: right shift count >= width of type
math.c:269: warning: right shift count >= width of type
math.c:277: warning: statement with no effect
math.c:277: warning: statement with no effect
math.c:277: warning: statement with no effect
math.c:284: warning: statement with no effect
math.c:284: warning: statement with no effect
math.c:284: warning: statement with no effect
math.c:99: warning: `SR_c' might be used uninitialized in this function
math.c:99: warning: `SR_s' might be used uninitialized in this function
math.c:99: warning: `SR_e' might be used uninitialized in this function
math.c:99: warning: `SR_f' might be used uninitialized in this function
math.c:100: warning: `DR_c' might be used uninitialized in this function
math.c:100: warning: `DR_s' might be used uninitialized in this function
math.c:100: warning: `DR_e' might be used uninitialized in this function
math.c:100: warning: `DR_f' might be used uninitialized in this function
when I compile math.c?
-Daniel
--
T. Daniel Crawford Department of Chemistry
crawdad@vt.edu Virginia Tech
www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255
--------------------
PGP Public Key at: http://www.chem.vt.edu/chem-dept/crawford/publickey.txt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 12:26 ` T. Daniel Crawford
@ 2001-05-01 13:03 ` Uncle George
2001-05-02 12:10 ` Uncle George
1 sibling, 0 replies; 10+ messages in thread
From: Uncle George @ 2001-05-01 13:03 UTC (permalink / raw)
To: axp-list
"T. Daniel Crawford" wrote:
> On Tue, 1 May 2001, Uncle George wrote:
> Your DSL connection depends on lots of FP math?
its encrypted :} ( just kiddin )
>
>
> Also, should I get lots of warnings like:
>
> math.c: In function `alpha_fp_emul':
> math.c:204: warning: right shift count is negative
> m
probably ( 99% confident ) not :-/ later to see why math.c is peeved.
/gat
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FP Exceptions
2001-05-01 12:26 ` T. Daniel Crawford
2001-05-01 13:03 ` Uncle George
@ 2001-05-02 12:10 ` Uncle George
1 sibling, 0 replies; 10+ messages in thread
From: Uncle George @ 2001-05-02 12:10 UTC (permalink / raw)
To: axp-list, T. Daniel Crawford
It appears to be a problem to be a problem with the linux 2.4.2 kernels makefile scripts .
the "CFLAGS +=" in arch/alpha/math-emu/Makefile is not being picked up so that the -w
flag is appended to the other CFLAGS options :-/ The -w flag inhibits the publishing of
the warning messages.
Otherwise removing the -w in a 2.2.17 build, also gives u these warmings.
/gat
"T. Daniel Crawford" wrote:
> On Tue, 1 May 2001, Uncle George wrote:
>
> >
>
> Also, should I get lots of warnings like:
>
> math.c: In function `alpha_fp_emul':
> math.c:204: warning: right shift count is negative
> math.c:204: warning: left shift count >= width of type
> math.c:220: warning: left shift count is negative
> math.c:245: warning: statement with no effect
> math.c:265: warning: right shift count >= width of type
> math.c:265: warning: right shift count >= width of type
> math.c:269: warning: right shift count >= width of type
> math.c:269: warning: right shift count >= width of type
> math.c:277: warning: statement with no effect
> math.c:277: warning: statement with no effect
> math.c:277: warning: statement with no effect
> math.c:284: warning: statement with no effect
> math.c:284: warning: statement with no effect
> math.c:284: warning: statement with no effect
> math.c:99: warning: `SR_c' might be used uninitialized in this function
> math.c:99: warning: `SR_s' might be used uninitialized in this function
> math.c:99: warning: `SR_e' might be used uninitialized in this function
> math.c:99: warning: `SR_f' might be used uninitialized in this function
> math.c:100: warning: `DR_c' might be used uninitialized in this function
> math.c:100: warning: `DR_s' might be used uninitialized in this function
> math.c:100: warning: `DR_e' might be used uninitialized in this function
> math.c:100: warning: `DR_f' might be used uninitialized in this function
>
> when I compile math.c?
>
> -Daniel
>
> --
> T. Daniel Crawford Department of Chemistry
> crawdad@vt.edu Virginia Tech
> www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255
> --------------------
> PGP Public Key at: http://www.chem.vt.edu/chem-dept/crawford/publickey.txt
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2001-05-02 12:10 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-20 20:37 fp exceptions glenn murphy
1999-06-20 21:17 ` Wes Bauske
-- strict thread matches above, loose matches on Subject: below --
2001-04-23 18:52 compiling kernel 2.4.3 Uncle George
2001-05-01 3:23 ` FP Exceptions T. Daniel Crawford
2001-05-01 5:30 ` Greg Lindahl
2001-05-01 10:56 ` Uncle George
2001-05-01 11:52 ` T. Daniel Crawford
2001-05-01 12:23 ` Uncle George
2001-05-01 12:26 ` T. Daniel Crawford
2001-05-01 13:03 ` Uncle George
2001-05-02 12:10 ` Uncle George
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox