aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-08-21 13:29:16 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-08-21 13:29:16 -0400
commitd784886d82b27fd421bb26d227d103c6dc9240f8 (patch)
treece66daf359b35c57e87ad1166ee45a2b90095028 /gcc/config/i386
parentba2fcc7febbbbe423d727f713c1b4806e3121180 (diff)
downloadgcc-d784886d82b27fd421bb26d227d103c6dc9240f8.zip
gcc-d784886d82b27fd421bb26d227d103c6dc9240f8.tar.gz
gcc-d784886d82b27fd421bb26d227d103c6dc9240f8.tar.bz2
(arithmetic_comparison_operator): New function.
(print_operand): Take into account that overflow flag is not set the same as after a compare instruction. From-SVN: r10268
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f31ee1a..68aabfb 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1400,6 +1400,25 @@ expander_call_insn_operand (op, mode)
return 1;
return 0;
}
+
+/* Return 1 if OP is a comparison operator that can use the condition code
+ generated by an arithmetic operation. */
+
+int
+arithmetic_comparison_operator (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ enum rtx_code code;
+
+ if (mode != VOIDmode && mode != GET_MODE (op))
+ return 0;
+ code = GET_CODE (op);
+ if (GET_RTX_CLASS (code) != '<')
+ return 0;
+
+ return (code != GT && code != LE);
+}
/* Returns 1 if OP contains a symbol reference */
@@ -2380,13 +2399,13 @@ print_operand (file, x, code)
case NE: fputs ("jne", file); return;
case EQ: fputs ("je", file); return;
case GE: fputs ("jns", file); return;
- case GT: fputs ("jg", file); return;
- case LE: fputs ("jle", file); return;
case LT: fputs ("js", file); return;
- case GEU: fputs ("jae", file); return;
- case GTU: fputs ("ja", file); return;
- case LEU: fputs ("jbe", file); return;
- case LTU: fputs ("jb", file); return;
+ case GEU: fputs ("jmp", file); return;
+ case GTU: fputs ("jne", file); return;
+ case LEU: fputs ("je", file); return;
+ case LTU: fputs ("#branch never", file); return;
+
+ /* no matching branches for GT nor LE */
}
abort ();