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>
* i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends.
......
......@@ -330,10 +330,14 @@ yyprint (file, yychar, yylval)
if (TREE_CODE (t) == INTEGER_CST)
fprintf (file,
#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",
#else
" 0x%x%016x",
" 0x%llx%016llx",
#endif
#endif
#else
#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
......@@ -1965,12 +1969,12 @@ yylex ()
else if (TREE_UNSIGNED (char_type_node)
|| ((result >> (num_bits - 1)) & 1) == 0)
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)),
0);
else
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)),
-1);
TREE_TYPE (yylval.ttype) = integer_type_node;
......
......@@ -828,7 +828,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
rtx set = 0, src, dest;
rtx p;
#ifdef AUTO_INC_DEC
rtx, link;
rtx link;
#endif
int all_adjacent = (succ ? (next_active_insn (insn) == succ
&& next_active_insn (succ) == i3)
......@@ -10166,7 +10166,7 @@ simplify_comparison (code, pop0, pop1)
}
/* 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
"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
......
......@@ -4617,11 +4617,7 @@ write_test_expr (exp, flags)
/* Constant integer. */
case CONST_INT:
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
printf ("%d", XWINT (exp, 0));
#else
printf ("%ld", XWINT (exp, 0));
#endif
printf (HOST_WIDE_INT_PRINT_DEC, XWINT (exp, 0));
break;
/* A random C expression. */
......
......@@ -212,13 +212,11 @@ gen_exp (x)
else if (INTVAL (x) == STORE_FLAG_VALUE)
printf ("const_true_rtx");
else
printf (
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
"GEN_INT (%d)",
#else
"GEN_INT (%ld)",
#endif
INTVAL (x));
{
printf ("GEN_INT (");
printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
printf (")");
}
return;
case CONST_DOUBLE:
......
......@@ -325,13 +325,9 @@ match_rtx (x, path, fail_label)
printf (";\n");
}
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
printf (" if (XWINT (x, %d) != %d) goto L%d;\n",
i, XWINT (x, i), fail_label);
#else
printf (" if (XWINT (x, %d) != %ld) goto L%d;\n",
i, XWINT (x, i), fail_label);
#endif
printf (" if (XWINT (x, %d) != ", i);
printf (HOST_WIDE_INT_PRINT_DEC, XWINT (x, i));
printf (") goto L%d;\n", fail_label);
}
else if (fmt[i] == 's')
{
......
/* 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.
......@@ -508,6 +508,9 @@ add_to_sequence (pattern, last, position)
newpos[depth] = '1';
new = add_to_sequence (XEXP (pattern, 1), &new->success, newpos);
return new;
default:
break;
}
fmt = GET_RTX_FORMAT (code);
......@@ -1286,6 +1289,8 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sswitch (GET_MODE (x%d))\n", indents[indent], depth);
printf ("%s{\n", indents[indent + 2]);
indent += 4;
printf ("%sdefault:\n%sbreak;\n", indents[indent - 2],
indents[indent]);
printf ("%scase %smode:\n", indents[indent - 2],
GET_MODE_NAME (mode));
modemap[(int) mode] = 1;
......@@ -1301,6 +1306,8 @@ write_tree_1 (tree, prevpos, afterward, type)
printf ("%sswitch (GET_CODE (x%d))\n", indents[indent], depth);
printf ("%s{\n", indents[indent + 2]);
indent += 4;
printf ("%sdefault:\n%sbreak;\n", indents[indent - 2],
indents[indent]);
printf ("%scase ", indents[indent - 2]);
print_code (p->code);
printf (":\n");
......@@ -1351,13 +1358,9 @@ write_tree_1 (tree, prevpos, afterward, type)
must fit in 32 bit, thus it suffices to check only
for 1 << 31 . */
HOST_WIDE_INT offset = p->elt_zero_wide == -2147483647 - 1;
printf (
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
"XWINT (x%d, 0) == %d%s && ",
#else
"XWINT (x%d, 0) == %ld%s && ",
#endif
depth, p->elt_zero_wide + offset, offset ? "-1" : "");
printf ("XWINT (x%d, 0) == ", depth);
printf (HOST_WIDE_INT_PRINT_DEC, p->elt_zero_wide + offset);
printf ("%s && ", offset ? "-1" : "");
}
if (p->veclen)
printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen);
......@@ -1736,6 +1739,7 @@ main (argc, argv)
from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include <stdio.h>\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
......
......@@ -765,7 +765,11 @@ read_rtx (infile)
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
tmp_wide = atoi (tmp_char);
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
tmp_wide = atol (tmp_char);
#else
tmp_wide = atoq (tmp_char);
#endif
#endif
XWINT (return_rtx, i) = tmp_wide;
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