This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch: fix ppc-e500 floating comparisons
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: geoffk at geoffk dot org
- Date: Sun, 11 Apr 2004 20:51:27 -0400
- Subject: patch: fix ppc-e500 floating comparisons
Floating comparisons on the E500 have been broken since about here:
http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00431.html
...I thought it was a simple fix, but I've run into a bunch of small
cases of bit-rot. I'll be committing small patchlets along the way to
get the toolchain back into shape. I'm trying to get all the obvious
stuff out of the way first.
This patch documents the unavailabilty of one pattern.
This patch disables conditional moves for floats on the E500. It
looks like we're triggering sCONDs a lot more and the e500 port is
falling on it's face.
Finally, I've removed the NE condition for
branch_positive_comparison_operator. Geoff had pointed out that this
(NE) was wrong, even on the E500. Of course, this brings about other
problems that I'll be fixing on subsequent patches.
Committed to mainline. Mark permitting, I'll get all these patches
into 3.4.1 when the branch opens up again.
Cheers.
Aldy
* config/rs6000/rs6000.md: Document why a pattern is not
available.
* config/rs6000/rs6000.c (rs6000_emit_cmove): Disable comparisons
of floats on the E500.
(branch_positive_comparison_operator): Do not allow NE even on the
E500.
Index: config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.301
diff -u -p -r1.301 rs6000.md
--- config/rs6000/rs6000.md 31 Mar 2004 04:29:13 -0000 1.301
+++ config/rs6000/rs6000.md 12 Apr 2004 00:43:55 -0000
@@ -13666,6 +13666,8 @@
"cc_reg_operand" "0,y")
(const_int 0)])
(const_int 0)))]
+ ;; This pattern is not available to SPE because the CR bits on an FP
+ ;; compare are different than traditional PPC.
"!TARGET_SPE"
"{crnor %E0,%j1,%j1|crnot %E0,%j1}"
[(set_attr "type" "cr_logical,delayed_cr")])
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.623
diff -u -p -r1.623 rs6000.c
--- config/rs6000/rs6000.c 12 Apr 2004 00:05:05 -0000 1.623
+++ config/rs6000/rs6000.c 12 Apr 2004 00:44:02 -0000
@@ -8376,7 +8376,6 @@ branch_positive_comparison_operator (rtx
code = GET_CODE (op);
return (code == EQ || code == LT || code == GT
- || (TARGET_E500 && TARGET_HARD_FLOAT && !TARGET_FPRS && code == NE)
|| code == LTU || code == GTU
|| code == UNORDERED);
}
@@ -10195,6 +10194,9 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx
return rs6000_emit_int_cmove (dest, op, true_cond, false_cond);
return 0;
}
+ else if (TARGET_E500 && TARGET_HARD_FLOAT && !TARGET_FPRS
+ && GET_MODE_CLASS (compare_mode) == MODE_FLOAT)
+ return 0;
/* Eliminate half of the comparisons by switching operands, this
makes the remaining code simpler. */