From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,753ed1318517d414 X-Google-Attributes: gid111c93,public From: Subject: Re: floor() broken on Multia Date: 2000/03/06 Message-ID: <89uuvf$oo5$1@hyperion.triode.net.au>#1/1 X-Deja-AN: 593610613 References: <89mono$fhj$1@hyperion.triode.net.au> <89nq7b$of5$1@news.ihug.co.nz> <89p2ps$9u6$1@pulp.srv.ualberta.ca> X-Complaints-To: paulb@triode.net.au X-Trace: hyperion.triode.net.au 952303407 25349 203.63.235.2 (6 Mar 2000 00:43:27 GMT) Organization: Triode Internet User-Agent: tin/pre-1.4-19990216 ("Styrofoam") (UNIX) (Linux/2.2.13 (i686)) NNTP-Posting-Date: 6 Mar 2000 00:43:27 GMT Newsgroups: comp.os.linux.alpha > 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