Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: michal@gortel.phys.ualberta.ca (Michal Jaegermann)
Subject: Re: floor() broken on Multia
Date: 2000/03/03	[thread overview]
Message-ID: <89p2ps$9u6$1@pulp.srv.ualberta.ca> (raw)
In-Reply-To: 89nq7b$of5$1@news.ihug.co.nz

Ryan C. Price (pricerc@ihug.co.nz) wrote:
: Hasn't the Multia's CPU (21066) got reduced FP functionality ? This may have
: something to do with the problem.

All of this sounds exactly like the problem which was described
recently.  Here is the original message:


 From: Carsten Jacobi <carsten@jakes.kawo1.rwth-aachen.de>
 Date: Sun, 20 Feb 2000 23:19:40 +0100 (CET)
 Subject: [PATCH] Trapping for Alpha EV4 machines


 I have found a bug. I just don't know whether to blame the kernel or
 my processor, but now it works.
 The problem is, that EV4 machines seam to behave differently than
 EV5/6 during an illegal opcode or FP forced software handling trap. At
 least the code in arch/alpha/kernel/traps.c assumes that the PC is
 incremented when the exception handler is executed. This is not the case
 on my EV4-machine, and programs that used trapping math instructions (I
 got him on "cvttq/svm") just stuck:
 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!
 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-) ).
 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 ... ;-)

 Carsten

 PS.: I definitely know that the second call in the patchfile to
 "alpha_fp_emul" is corrected by the patch. I hope my change to the first
 call in the patch file is correct too, but I am not sure ...

 --------------------------------------

 Carsten Jacobi
 Kastanienweg 6, App.1317
 52074 Aachen

 Tel.: +49 241 878117
 Fax : +49 241 878189
 ISDN: +49 241 878190
 E-Mail: carsten@jakes.kawo1.rwth-aachen.de

--- linux/arch/alpha/kernel/traps.c.old	Tue Jan  4 19:12:11 2000
+++ linux/arch/alpha/kernel/traps.c	Sun Feb 20 19:45:06 2000
@@ -336,9 +336,14 @@
 		/* Software-completion summary bit is set, so try to
 		   emulate the instruction.  */
 		if (!amask(AMASK_PRECISE_TRAP)) {
+#ifdef CONFIG_ALPHA_EV4
+			if (alpha_fp_emul(regs.pc))
+				return;
+#else
 			/* 21264 (except pass 1) has precise exceptions.  */
 			if (alpha_fp_emul(regs.pc - 4))
 				return;
+#endif
 		} else {
 			if (alpha_fp_emul_imprecise(&regs, write_mask))
 				return;
@@ -417,8 +422,13 @@
 			/* EV4 does not implement anything except normal
 			   rounding.  Everything else will come here as
 			   an illegal instruction.  Emulate them.  */
-			if (alpha_fp_emul(regs.pc - 4))
+			if (alpha_fp_emul(regs.pc))
+			{
+				/* Increment the PC so that the program in
+				   user space continues */
+				regs.pc += 4;
 				return;
+			}
 		}
 		send_sig(SIGILL, current, 1);
 		break;

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.

   Michal



  reply	other threads:[~2000-03-03  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 [this message]
2000-03-06  5:00     ` telford
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