This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
An i386 conditonal move patch
- To: egcs-patches at cygnus dot com
- Subject: An i386 conditonal move patch
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sun, 21 Jun 1998 17:20:16 -0700 (PDT)
- Cc: john at feith dot com
No conditional move patterns on x86 affect cc0. Also I added a sanity
check for output_fp_conditional_move. Check JUMP_INSN for conditional
move in output_fp_cc0_set doesn't make any senses. I removed it.
--
H.J. Lu (hjl@gnu.org)
---
Fri Jun 19 08:04:03 1998 H.J. Lu (hjl@gnu.org)
* config/i386/i386.c (notice_update_cc): All conditional moves
don't affect cc0.
(output_fp_conditional_move): Abort for LT, LE, GE, and GT
signed integer comparisons.
(output_int_conditional_move): Use "enum rtx_code" for code
type.
(output_fp_cc0_set): Don't check JUMP_INSN for conditional
move.
Index: config/i386/i386.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.1.1.23
diff -u -p -r1.1.1.23 i386.c
--- i386.c 1998/06/21 16:39:33 1.1.1.23
+++ i386.c 1998/06/21 16:46:31
@@ -3584,8 +3597,7 @@ notice_update_cc (exp)
if (REG_P (SET_DEST (exp))
&& (REG_P (SET_SRC (exp)) || GET_CODE (SET_SRC (exp)) == MEM
|| GET_RTX_CLASS (GET_CODE (SET_SRC (exp))) == '<'
- || (GET_CODE (SET_SRC (exp)) == IF_THEN_ELSE
- && GET_MODE_CLASS (GET_MODE (SET_DEST (exp))) == MODE_INT)))
+ || GET_CODE (SET_SRC (exp)) == IF_THEN_ELSE))
{
if (cc_status.value1
&& reg_overlap_mentioned_p (SET_DEST (exp), cc_status.value1))
@@ -4125,8 +4160,7 @@ output_fp_cc0_set (insn)
{
next = next_cc0_user (insn);
- if (GET_CODE (next) == JUMP_INSN
- && GET_CODE (PATTERN (next)) == SET
+ if (GET_CODE (PATTERN (next)) == SET
&& SET_DEST (PATTERN (next)) == pc_rtx
&& GET_CODE (SET_SRC (PATTERN (next))) == IF_THEN_ELSE)
code = GET_CODE (XEXP (SET_SRC (PATTERN (next)), 0));
@@ -4151,8 +4185,7 @@ output_fp_cc0_set (insn)
if (next == NULL_RTX)
abort ();
- if (GET_CODE (next) == JUMP_INSN
- && GET_CODE (PATTERN (next)) == SET
+ if (GET_CODE (PATTERN (next)) == SET
&& SET_DEST (PATTERN (next)) == pc_rtx
&& GET_CODE (SET_SRC (PATTERN (next))) == IF_THEN_ELSE)
code = GET_CODE (XEXP (SET_SRC (PATTERN (next)), 0));
@@ -5134,6 +5167,13 @@ output_fp_conditional_move (which_altern
int which_alternative;
rtx operands[];
{
+ enum rtx_code code = GET_CODE (operands[1]);
+
+ /* It should never happen. */
+ if (!(cc_prev_status.flags & CC_IN_80387)
+ && (code == GT || code == LE || code == GE || code == LT))
+ abort ();
+
switch (which_alternative)
{
case 0:
@@ -5164,7 +5204,7 @@ output_int_conditional_move (which_alter
int which_alternative;
rtx operands[];
{
- int code = GET_CODE (operands[1]);
+ enum rtx_code code = GET_CODE (operands[1]);
enum machine_mode mode;
rtx xops[4];