Linux PARISC architecture development
 help / color / mirror / Atom feed
From: "Jim Hull" <jim.hull@hp.com>
To: "'Randolph Chung'" <randolph@tausq.org>,
	"'John David Anglin'" <dave@hiauly1.hia.nrc.ca>
Cc: <parisc-linux@parisc-linux.org>
Subject: RE: [parisc-linux] Re: floating point exception error
Date: Fri, 10 Jan 2003 10:08:29 -0800	[thread overview]
Message-ID: <003101c2b8d3$477c8bb0$6763f40f@cup.hp.com> (raw)
In-Reply-To: <20030110075441.GD31470@tausq.org>

Randolph wrote:

> i looked at this some more.. it's not that the fcnv instruction is not
> implemented by the processor, but we seem to be falling into 
> one of the overflow/underflow cases... if you adjust the value being 
> converted (say remove one of the zeros), the program works without
trapping.
> 
> page 10-9 of the pa20 arch manual gives the conditions under which a
> floating point conversion op will cause an unimplemented exception.
> however my reading of the text is that an exception is only generated
if
> the overflow/underflow exceptions are enabled. i've tried explicitly 
> calling feclearexcept(FE_ALL_EXCEPT) before doing the fp op but it
still 
> causes the unimplemented exception trap.
> The kernel debugs seem to indicate the O/U exceptions are not set as 
> well....

Actually, the important architectural statement is this one, on p. 10-8:

  If an implementation chooses not to execute an instruction, the
  instruction signals an unimplemented exception.  An unimplemented
  exception always causes a delayed trap on a later floating-point
  instruction.  It does not change the Status Register Flag bits and
  cannot be disabled.

What p. 10-9 is describing are the conditions under which the processor
is *required* to "go unimplemented" (i.e., to take an unimplemented
exception).  But what p. 10-8 says is that the processor is *allowed* to
"go unimplemented" on any FP instruction at any time for any reason.

A totally unrealistic, but still allowed, implementation would be for
all multiply-add instructions to "go unimplemented" on Tuesdays, and all
multiply-subtract instructions to do so on Thursdays.  A more realistic
example would be for a processor to "go unimplemented" for certain hard
corner-case combinations of operands and/or rounding modes.

In the particular case of the fcnv-unsigned-to-float instruction being
discussed in this thread, all PA-8xxx processors "go unimplemented" if
the MSB is 1 in the source operand.  This explains why the trap
disappears when you "remove one of the zeros" from the operand.

What it does not explain is why the original message reported a
difference between a PA-8600 and a PA-8700.  According to every internal
HP processor document and PA-RISC FP designer I've been able to track
down, this area of the design hasn't been changed since the original
PA-8000, so there shouldn't be any differences in behavior.

Can someone repeat the experiment on PA-8600 and a PA-8700 machine that
are configured identically (kernel, glibc, test program, etc.)?

 -- Jim
    HP PA-RISC/IPF Processor Architect

  reply	other threads:[~2003-01-10 18:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 21:13 [parisc-linux] ["CSA Test Drive" <TestDrive@compaq.com>] FW: Some issues Bdale Garbee
2002-12-11 22:03 ` John David Anglin
2002-12-11 22:44   ` Carlos O'Donell
2002-12-11 23:05     ` John David Anglin
2002-12-11 23:17       ` Carlos O'Donell
2002-12-12  6:50       ` Randolph Chung
2002-12-12 12:15         ` Matthew Wilcox
2003-01-10  7:54       ` [parisc-linux] Re: floating point exception error Randolph Chung
2003-01-10 18:08         ` Jim Hull [this message]
2003-01-10 18:35           ` Randolph Chung
2003-01-10 18:48           ` John David Anglin
2003-01-10 22:30             ` Jim Hull
2003-01-11  6:16               ` Randolph Chung
2003-01-11  7:10                 ` Grant Grundler
2003-01-11 18:31                 ` John David Anglin
2003-01-12  8:37                   ` Randolph Chung
2003-01-13 15:58                     ` jsoe0708
2003-01-13 16:57                       ` Randolph Chung
2003-01-13 17:16                         ` jsoe0708
2003-01-13 17:16                           ` Randolph Chung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003101c2b8d3$477c8bb0$6763f40f@cup.hp.com' \
    --to=jim.hull@hp.com \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=parisc-linux@parisc-linux.org \
    --cc=randolph@tausq.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox