This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for IA64 floating point comparison


The test case gcc.dg/vect/no-trapping-math-2.c is failing on IA64 (HP-UX
and Linux) because it is generating a "fpcmp.unle" instruction which the
assembler doesn't understand.  However the assembler does understand
"fpcmp.ngt" and this has the desired semantics.  This patch maps the
unlt, unle, ungt, and unge instructions to the nge, ngt, nle, and nlt
comparison codes that the IA64 assembler understands.

  unlt (unordered or less than)             -> nge (not greater or equal)
  unle (unordered or less than or equal)    -> ngt (not greater than)
  ungt (unordered or greater than)          -> nge (not less or equal)
  unge (unordered or greater than or equal) -> ngt (not less than)

Tested on IA64 HP-UX and Linux.  It may be that this qualifies as
obvious but I wouldn't mind a review to make sure I didn't mess up the
mapping.

OK to checkin?

Steve Ellcey
sje@cup.hp.com


2007-01-31  Steve Ellcey  <sje@cup.hp.com>

	* config/ia64/ia64.c (ia64_print_operand): Fix compare strings.

Index: config/ia64/ia64.c
===================================================================
--- config/ia64/ia64.c	(revision 121370)
+++ config/ia64/ia64.c	(working copy)
@@ -4548,6 +4548,18 @@ ia64_print_operand (FILE * file, rtx x, 
 	case ORDERED:
 	  str = "ord";
 	  break;
+	case UNLT:
+	  str = "nge";
+	  break;
+	case UNLE:
+	  str = "ngt";
+	  break;
+	case UNGT:
+	  str = "nle";
+	  break;
+	case UNGE:
+	  str = "nlt";
+	  break;
 	default:
 	  str = GET_RTX_NAME (GET_CODE (x));
 	  break;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]