Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: <telford@xenon.triode.net.au>
Subject: Re: floor() broken on Multia
Date: 2000/03/06	[thread overview]
Message-ID: <89uuvf$oo5$1@hyperion.triode.net.au> (raw)
In-Reply-To: 89p2ps$9u6$1@pulp.srv.ualberta.ca

>  1. The exception handler tried to handle the instruction that preceeded
>  the instruction which caused the exception.
>  2. After the handling the PC was still pointing to the same insn so that
>  the exception was caused over and over again.
>  Thus the process using such an insn ate up the whole CPU power and didn't
>  process!

This sounds exactly like the symptoms I was getting.

>  Unfortunately this instruction was located in the libgtk so that every
>  program using gtk didn't work on my machine (Thanks tux now they do run
>  8-) ).

That would probably be because the libgtk used floor() somewhere and the
inline assembly code ended up compiled into libgtk.

>  Ok, anybody with an EV4-Alpha (for example Jensen) who shares the same
>  experience with me? Or do I have a very exclusive/unique 21064 in my
>  chassis ... ;-)

Looks like the EV4 in the Multia behaves the same way.

[snip the patch]

> Try the patch above and see if this will change anything.  It sounds
> like it might.

> Reports of a failure or success are very welcome.

I upgraded from 2.2.12 to 2.2.14 and I also put the patch into the
kernel (see previous message for patch details). That does fix the problem,
I can compile with floor() and get correct behaviour (no hang).
I haven't tested all the extreme cases to see that floor() is exactly right
but for all the obvious cases it does the expected thing.

So just to repeat, the patch does work.

I tried a few apps that I had previously compiled and which were hanging
on me and they worked too. Interestingly, the other kludge solution that
involved replacing floor() with round-off is probably FASTER on an EV4
chip than the inline assembly. The reason being that even though the kludge
solution is longer, it doesn't evoke a kernel trap (which is vastly slower).
Then again, the EV4 is pretty slow to begin with, I can understand why libc
would be optimised to work best with the newest machines. Just maybe some
conditional code in the bits/mathinline.h file would be a nice touch so that
it gets the best results all round... maybe something like:

#ifdef __alpha_ev4__

__MATH_INLINE double __floor( double x )
{
	return(( double )( int )(( x < 0 ) ? d1 - nextafter( 1, 0 ) : d1 ));
}
/* correct use of nextafter() ?? */

#else /* __alpha_ev4__ */

/* normal definition here */

#endif /* __alpha_ev4__ */

Anyhow, the difference is probably not worth worrying about (though these
little things add up after a while).

	- Tel


PS: I heard that 2.2.15pre10 works abd 2.2.15pre13 is broken again
    so someone is playing with this code



  reply	other threads:[~2000-03-06  5:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-02  5:00 floor() broken on Multia telford
2000-03-03  5:00 ` Ryan C. Price
2000-03-03  5:00   ` Michal Jaegermann
2000-03-06  5:00     ` telford [this message]
2000-03-03  5:00 ` Tony Hammitt
2000-03-03  5:00   ` telford
2000-03-03  5:00     ` Tony Hammitt
2000-03-06  5:00       ` Ryan C. Price
2000-03-03  5:00 ` telford
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox