Commit 76d31c63 by Jeff Law

rtl.c (read_rtx): Use atol/atoq based upon disposition of HOST_WIDE_INT.

        * rtl.c (read_rtx): Use atol/atoq based upon disposition of
        HOST_WIDE_INT.
        * genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC
        as needed.
        * genemit.c (gen_exp): Likewise.
        * genpeep.c (match_rtx): Likewise.
        * genrecog.c (write_tree_1): Likewise.
        * c-lex.c (yyprint): Use proper format string based upon
        disposition of HOST_BITS_PER_WIDE_INT.
        (yylex): Put casts in right place for args to build_int_2.
        * combine.c: Fix typos in Jan27 changes.

From-SVN: r17544
parent 1b7555bd
Thu Jan 29 00:25:35 1998 David S. Miller <davem@tanya.rutgers.edu>
Jeffrey A Law (law@cygnus.com)
* rtl.c (read_rtx): Use atol/atoq based upon disposition of
HOST_WIDE_INT.
* genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC
as needed.
* genemit.c (gen_exp): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (write_tree_1): Likewise.
* c-lex.c (yyprint): Use proper format string based upon
disposition of HOST_BITS_PER_WIDE_INT.
(yylex): Put casts in right place for args to build_int_2.
Thu Jan 29 00:24:29 1998 Jeffrey A Law (law@cygnus.com)
* combine.c: Fix typos in Jan27 changes.
Thu Jan 29 00:07:49 1998 Ollivier Robert <roberto@keltia.freenix.fr> Thu Jan 29 00:07:49 1998 Ollivier Robert <roberto@keltia.freenix.fr>
* i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends. * i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends.
......
...@@ -330,10 +330,14 @@ yyprint (file, yychar, yylval) ...@@ -330,10 +330,14 @@ yyprint (file, yychar, yylval)
if (TREE_CODE (t) == INTEGER_CST) if (TREE_CODE (t) == INTEGER_CST)
fprintf (file, fprintf (file,
#if HOST_BITS_PER_WIDE_INT == 64 #if HOST_BITS_PER_WIDE_INT == 64
#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
" 0x%x%016x",
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
" 0x%lx%016lx", " 0x%lx%016lx",
#else #else
" 0x%x%016x", " 0x%llx%016llx",
#endif
#endif #endif
#else #else
#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
...@@ -1965,12 +1969,12 @@ yylex () ...@@ -1965,12 +1969,12 @@ yylex ()
else if (TREE_UNSIGNED (char_type_node) else if (TREE_UNSIGNED (char_type_node)
|| ((result >> (num_bits - 1)) & 1) == 0) || ((result >> (num_bits - 1)) & 1) == 0)
yylval.ttype yylval.ttype
= build_int_2 (result & ((unsigned HOST_WIDE_INT) ~0 = build_int_2 (result & (~(unsigned HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)), >> (HOST_BITS_PER_WIDE_INT - num_bits)),
0); 0);
else else
yylval.ttype yylval.ttype
= build_int_2 (result | ~((unsigned HOST_WIDE_INT) ~0 = build_int_2 (result | ~(~(unsigned HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)), >> (HOST_BITS_PER_WIDE_INT - num_bits)),
-1); -1);
TREE_TYPE (yylval.ttype) = integer_type_node; TREE_TYPE (yylval.ttype) = integer_type_node;
......
...@@ -828,7 +828,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc) ...@@ -828,7 +828,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
rtx set = 0, src, dest; rtx set = 0, src, dest;
rtx p; rtx p;
#ifdef AUTO_INC_DEC #ifdef AUTO_INC_DEC
rtx, link; rtx link;
#endif #endif
int all_adjacent = (succ ? (next_active_insn (insn) == succ int all_adjacent = (succ ? (next_active_insn (insn) == succ
&& next_active_insn (succ) == i3) && next_active_insn (succ) == i3)
...@@ -10166,7 +10166,7 @@ simplify_comparison (code, pop0, pop1) ...@@ -10166,7 +10166,7 @@ simplify_comparison (code, pop0, pop1)
} }
/* Now make any compound operations involved in this comparison. Then, /* Now make any compound operations involved in this comparison. Then,
check for an outmost SUBREG on OP0 that isn't doing anything or is check for an outmost SUBREG on OP0 that is not doing anything or is
paradoxical. The latter case can only occur when it is known that the paradoxical. The latter case can only occur when it is known that the
"extra" bits will be zero. Therefore, it is safe to remove the SUBREG. "extra" bits will be zero. Therefore, it is safe to remove the SUBREG.
We can never remove a SUBREG for a non-equality comparison because the We can never remove a SUBREG for a non-equality comparison because the
......
...@@ -4617,11 +4617,7 @@ write_test_expr (exp, flags) ...@@ -4617,11 +4617,7 @@ write_test_expr (exp, flags)
/* Constant integer. */ /* Constant integer. */
case CONST_INT: case CONST_INT:
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT printf (HOST_WIDE_INT_PRINT_DEC, XWINT (exp, 0));
printf ("%d", XWINT (exp, 0));
#else
printf ("%ld", XWINT (exp, 0));
#endif
break; break;
/* A random C expression. */ /* A random C expression. */
......
...@@ -212,13 +212,11 @@ gen_exp (x) ...@@ -212,13 +212,11 @@ gen_exp (x)
else if (INTVAL (x) == STORE_FLAG_VALUE) else if (INTVAL (x) == STORE_FLAG_VALUE)
printf ("const_true_rtx"); printf ("const_true_rtx");
else else
printf ( {
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT printf ("GEN_INT (");
"GEN_INT (%d)", printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
#else printf (")");
"GEN_INT (%ld)", }
#endif
INTVAL (x));
return; return;
case CONST_DOUBLE: case CONST_DOUBLE:
......
...@@ -325,13 +325,9 @@ match_rtx (x, path, fail_label) ...@@ -325,13 +325,9 @@ match_rtx (x, path, fail_label)
printf (";\n"); printf (";\n");
} }
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT printf (" if (XWINT (x, %d) != ", i);
printf (" if (XWINT (x, %d) != %d) goto L%d;\n", printf (HOST_WIDE_INT_PRINT_DEC, XWINT (x, i));
i, XWINT (x, i), fail_label); printf (") goto L%d;\n", fail_label);
#else
printf (" if (XWINT (x, %d) != %ld) goto L%d;\n",
i, XWINT (x, i), fail_label);
#endif
} }
else if (fmt[i] == 's') else if (fmt[i] == 's')
{ {
......
/* Generate code from machine description to recognize rtl as insns. /* Generate code from machine description to recognize rtl as insns.
Copyright (C) 1987, 88, 92, 93, 94, 1995 Free Software Foundation, Inc. Copyright (C) 1987, 88, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -508,6 +508,9 @@ add_to_sequence (pattern, last, position) ...@@ -508,6 +508,9 @@ add_to_sequence (pattern, last, position)
newpos[depth] = '1'; newpos[depth] = '1';
new = add_to_sequence (XEXP (pattern, 1), &new->success, newpos); new = add_to_sequence (XEXP (pattern, 1), &new->success, newpos);
return new; return new;
default:
break;
} }
fmt = GET_RTX_FORMAT (code); fmt = GET_RTX_FORMAT (code);
...@@ -1286,6 +1289,8 @@ write_tree_1 (tree, prevpos, afterward, type) ...@@ -1286,6 +1289,8 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sswitch (GET_MODE (x%d))\n", indents[indent], depth); printf ("%sswitch (GET_MODE (x%d))\n", indents[indent], depth);
printf ("%s{\n", indents[indent + 2]); printf ("%s{\n", indents[indent + 2]);
indent += 4; indent += 4;
printf ("%sdefault:\n%sbreak;\n", indents[indent - 2],
indents[indent]);
printf ("%scase %smode:\n", indents[indent - 2], printf ("%scase %smode:\n", indents[indent - 2],
GET_MODE_NAME (mode)); GET_MODE_NAME (mode));
modemap[(int) mode] = 1; modemap[(int) mode] = 1;
...@@ -1301,6 +1306,8 @@ write_tree_1 (tree, prevpos, afterward, type) ...@@ -1301,6 +1306,8 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sswitch (GET_CODE (x%d))\n", indents[indent], depth); printf ("%sswitch (GET_CODE (x%d))\n", indents[indent], depth);
printf ("%s{\n", indents[indent + 2]); printf ("%s{\n", indents[indent + 2]);
indent += 4; indent += 4;
printf ("%sdefault:\n%sbreak;\n", indents[indent - 2],
indents[indent]);
printf ("%scase ", indents[indent - 2]); printf ("%scase ", indents[indent - 2]);
print_code (p->code); print_code (p->code);
printf (":\n"); printf (":\n");
...@@ -1351,13 +1358,9 @@ write_tree_1 (tree, prevpos, afterward, type) ...@@ -1351,13 +1358,9 @@ write_tree_1 (tree, prevpos, afterward, type)
must fit in 32 bit, thus it suffices to check only must fit in 32 bit, thus it suffices to check only
for 1 << 31 . */ for 1 << 31 . */
HOST_WIDE_INT offset = p->elt_zero_wide == -2147483647 - 1; HOST_WIDE_INT offset = p->elt_zero_wide == -2147483647 - 1;
printf ( printf ("XWINT (x%d, 0) == ", depth);
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT printf (HOST_WIDE_INT_PRINT_DEC, p->elt_zero_wide + offset);
"XWINT (x%d, 0) == %d%s && ", printf ("%s && ", offset ? "-1" : "");
#else
"XWINT (x%d, 0) == %ld%s && ",
#endif
depth, p->elt_zero_wide + offset, offset ? "-1" : "");
} }
if (p->veclen) if (p->veclen)
printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen); printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen);
...@@ -1736,6 +1739,7 @@ main (argc, argv) ...@@ -1736,6 +1739,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n"); from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n"); printf ("#include \"config.h\"\n");
printf ("#include <stdio.h>\n");
printf ("#include \"rtl.h\"\n"); printf ("#include \"rtl.h\"\n");
printf ("#include \"insn-config.h\"\n"); printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n"); printf ("#include \"recog.h\"\n");
......
...@@ -765,7 +765,11 @@ read_rtx (infile) ...@@ -765,7 +765,11 @@ read_rtx (infile)
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
tmp_wide = atoi (tmp_char); tmp_wide = atoi (tmp_char);
#else #else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
tmp_wide = atol (tmp_char); tmp_wide = atol (tmp_char);
#else
tmp_wide = atoq (tmp_char);
#endif
#endif #endif
XWINT (return_rtx, i) = tmp_wide; XWINT (return_rtx, i) = tmp_wide;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment