This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Floating point completer fix for PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 26 Sep 2004 15:43:28 -0400 (EDT)
- Subject: [committed] Floating point completer fix for PA
This changes the completers used for the comparison operations shown
below to not generate invalid exceptions when one of the operands is
a quiet NaN.
Tested on hppa-unknown-linux-gnu and hppa2.0w-hp-hpux11.11 with no
regressions (well I wouldn't have expected any since the invalid
exception is disabled by default). Committed to trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2004-09-26 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (print_operand): Use non-trapping completers for UNLE, UNLT,
UNGE, UNGT, UNEQ, UNORDERED and ORDERED comparisons.
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.278
diff -u -3 -p -r1.278 pa.c
--- config/pa/pa.c 18 Sep 2004 19:19:39 -0000 1.278
+++ config/pa/pa.c 22 Sep 2004 22:35:29 -0000
@@ -5102,7 +5102,10 @@ print_operand (FILE *file, rtx x, int co
}
return;
/* For floating point comparisons. Note that the output
- predicates are the complement of the desired mode. */
+ predicates are the complement of the desired mode. The
+ conditions for GT, GE, LT, LE and LTGT cause an invalid
+ operation exception if the result is unordered and this
+ exception is enabled in the floating-point status register. */
case 'Y':
switch (GET_CODE (x))
{
@@ -5121,19 +5124,19 @@ print_operand (FILE *file, rtx x, int co
case LTGT:
fputs ("!<>", file); break;
case UNLE:
- fputs (">", file); break;
+ fputs ("!?<=", file); break;
case UNLT:
- fputs (">=", file); break;
+ fputs ("!?<", file); break;
case UNGE:
- fputs ("<", file); break;
+ fputs ("!?>=", file); break;
case UNGT:
- fputs ("<=", file); break;
+ fputs ("!?>", file); break;
case UNEQ:
- fputs ("<>", file); break;
+ fputs ("!?=", file); break;
case UNORDERED:
- fputs ("<=>", file); break;
+ fputs ("!?", file); break;
case ORDERED:
- fputs ("!<=>", file); break;
+ fputs ("?", file); break;
default:
abort ();
}