home *** CD-ROM | disk | FTP | other *** search
- From: huck@aspen.NSA.HP.COM (Jerry Huck)
- Date: Thu, 13 Aug 1992 21:51:30 GMT
- Subject: Re: signal behaviour differs between hp9000 machines
- Message-ID: <2130058@aspen.NSA.HP.COM>
- Organization: HP Networked Systems Architecture - Cupertino, CA
- Path: sparky!uunet!wupost!sdd.hp.com!hpscdc!hplextra!hpcc05!aspen!huck
- Newsgroups: comp.sys.hp
- References: <1992Jul30.085325.26753@bohra.cpg.oz.au>
- Lines: 46
-
- In comp.sys.hp, cary@hpcuhe.cup.hp.com (Cary Coutant) writes:
-
- > On the /800 the divide instruction is restarted and another exception is
- > raised, resulting in an infinite loop.
-
- Are you sure it is the divide instruction that's restarted, or is it a
- subsequent floating-point instruction that uses the result of the divide?
- By the way, how did you arm the exceptions? On PA, floating-point
- exceptions are disabled by default.
-
- Because of the pipelined nature of the PA-RISC FPU, most exceptions are
- delayed. ...
-
- Cary gives an excellent description of the operation of the PA-RISC
- floating-point unit and I'ld like to add a little more detail to
- assist anyone writing such a signal handler.
-
- It's possible (even likely with a 720) that multiple exceptions are
- being reported by the floating-point unit. Sometimes it is a normal
- IEEE exception (if enabled), sometimes its an instruction that the
- chip is unable to execute (like NaN handling), and finally it can
- be an instruction where an earlier exception has created a data
- dependency. For example:
- fadd,dbl r4,r5 -> r6 <= overflow trap
- fsub,dbl r6,r7 -> r8
- fstw r8...
-
- A 720 will probably trap on the FSTW instruction with the FADD reporting
- OVERFLOW and the FSUB reporting UNIMPLEMENTED. So now the exception
- handler needs to creat a result for the FADD and then get that
- FSUB instruction to execute.
-
- So what does this all mean? When the 720 traps and raises the SIGFPE
- signal, the signal handler should deal with the first problem,
- clear that exception register, and then return. In the example, the
- T-bit in the status register will still be set, the FSTW will get
- restarted and immediately trap, the kernel exception handler will emulate
- the UNIMPLMENTED FSUB, clear that exception register, find no other
- exceptions, clear the T-bit, and then restart the FSTW (which can
- now procede. This simplifies the user's signal handler. You can
- assume that something needs to be handled, doing nothing to the
- exception registers is a sure infinite loop.
-
- Jerry Huck
- Hewlett-Packard
-
-