diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-07 02:23:42 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-07 02:23:42 +0000 |
commit | a7cc195f790136b5b4e9e0bddcc99de03149e1f1 (patch) | |
tree | 272ff451c0f5e3b65cd727409933c9d1f5119570 /gcc/genopinit.c | |
parent | 6d2bcb24a901d8ed522851bc6946e8a995fea423 (diff) | |
download | gcc-a7cc195f790136b5b4e9e0bddcc99de03149e1f1.tar.gz |
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2)
(LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2)
(LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf)
(LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf)
(LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf)
(LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi)
(LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi)
(LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti)
(LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi)
(LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi)
(LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti)
(extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc)
(extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc)
(truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc)
(trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc)
(floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc)
(floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc)
(floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc)
(floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc)
(fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc)
(fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc)
(fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc)
(fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc)
(fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc)
(fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc)
(fixunstfti_libfunc): Delete.
* optabs.h (struct optab_handlers): Break out of struct optab.
(struct convert_optab, convert_optab, enum convert_optab_index,
convert_optab_table, sext_optab, zext_optab, trunc_optab,
sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab,
sfloat_optab, ufloat_optab): New.
(set_conv_libfunc): Prototype.
(GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast.
(trunc_optab): Renamed btrunc_optab.
* builtins.c (expand_builtin_mathfn): Update to match.
* optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete.
(convert_optab_table, new_convert_optab, init_convert_optab)
(init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs)
(set_conv_libfunc): New.
(can_extend_p, gen_extend_insn, can_fix_p, can_float_p)
(expand_float, expand_fix): Use new conversion optabs,
not old insn code tables or long chains of ifs.
(init_optabs): No need to clear old insn code tables.
Initialize the new optabs, not the old libfunc array entries.
Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* genopinit.c: Initialize conversion optabs, not the
former insn code tables. Remove unnecessary casts.
Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here.
* expr.c (convert_move): Remove redundant check that
to_real==from_real. Use the conversion optabs instead
of long chains of tests of modes. Move partial-integer-mode
interconversion above all integer conversion. Do not recurse
on a value forced into a register in the original mode.
* config/gofast.h, config/frv/frv.c, config/ia64/ia64.c
* config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c
* config/sparc/sparc.c: Use set_conv_libfunc to adjust entries
in new conversion optabs; do not reference the old libfunc
array entries. No need to include libfuncs.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72178 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genopinit.c')
-rw-r--r-- | gcc/genopinit.c | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/gcc/genopinit.c b/gcc/genopinit.c index a0728faf09b..cded6e3e0a3 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -59,32 +59,33 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA upper-case forms of the comparison, respectively. */ static const char * const optabs[] = -{ "extendtab[$B][$A][0] = CODE_FOR_$(extend$a$b2$)", - "extendtab[$B][$A][1] = CODE_FOR_$(zero_extend$a$b2$)", - "fixtab[$A][$B][0] = CODE_FOR_$(fix$F$a$I$b2$)", - "fixtab[$A][$B][1] = CODE_FOR_$(fixuns$F$a$b2$)", - "fixtrunctab[$A][$B][0] = CODE_FOR_$(fix_trunc$F$a$I$b2$)", - "fixtrunctab[$A][$B][1] = CODE_FOR_$(fixuns_trunc$F$a$I$b2$)", - "floattab[$B][$A][0] = CODE_FOR_$(float$I$a$F$b2$)", - "floattab[$B][$A][1] = CODE_FOR_$(floatuns$I$a$F$b2$)", +{ "sext_optab->handlers[$B][$A].insn_code = CODE_FOR_$(extend$a$b2$)", + "zext_optab->handlers[$B][$A].insn_code = CODE_FOR_$(zero_extend$a$b2$)", + "sfix_optab->handlers[$B][$A].insn_code = CODE_FOR_$(fix$F$a$I$b2$)", + "ufix_optab->handlers[$B][$A].insn_code = CODE_FOR_$(fixuns$F$a$b2$)", + "sfixtrunc_optab->handlers[$B][$A].insn_code = CODE_FOR_$(fix_trunc$F$a$I$b2$)", + "ufixtrunc_optab->handlers[$B][$A].insn_code = CODE_FOR_$(fixuns_trunc$F$a$I$b2$)", + "sfloat_optab->handlers[$B][$A].insn_code = CODE_FOR_$(float$I$a$F$b2$)", + "ufloat_optab->handlers[$B][$A].insn_code = CODE_FOR_$(floatuns$I$a$F$b2$)", + "trunc_optab->handlers[$B][$A].insn_code = CODE_FOR_$(trunc$a$b2$)", "add_optab->handlers[$A].insn_code = CODE_FOR_$(add$P$a3$)", - "addv_optab->handlers[(int) $A].insn_code =\n\ - add_optab->handlers[(int) $A].insn_code = CODE_FOR_$(add$F$a3$)", - "addv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(addv$I$a3$)", + "addv_optab->handlers[$A].insn_code =\n\ + add_optab->handlers[$A].insn_code = CODE_FOR_$(add$F$a3$)", + "addv_optab->handlers[$A].insn_code = CODE_FOR_$(addv$I$a3$)", "sub_optab->handlers[$A].insn_code = CODE_FOR_$(sub$P$a3$)", - "subv_optab->handlers[(int) $A].insn_code =\n\ - sub_optab->handlers[(int) $A].insn_code = CODE_FOR_$(sub$F$a3$)", - "subv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(subv$I$a3$)", + "subv_optab->handlers[$A].insn_code =\n\ + sub_optab->handlers[$A].insn_code = CODE_FOR_$(sub$F$a3$)", + "subv_optab->handlers[$A].insn_code = CODE_FOR_$(subv$I$a3$)", "smul_optab->handlers[$A].insn_code = CODE_FOR_$(mul$P$a3$)", - "smulv_optab->handlers[(int) $A].insn_code =\n\ - smul_optab->handlers[(int) $A].insn_code = CODE_FOR_$(mul$F$a3$)", - "smulv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(mulv$I$a3$)", + "smulv_optab->handlers[$A].insn_code =\n\ + smul_optab->handlers[$A].insn_code = CODE_FOR_$(mul$F$a3$)", + "smulv_optab->handlers[$A].insn_code = CODE_FOR_$(mulv$I$a3$)", "umul_highpart_optab->handlers[$A].insn_code = CODE_FOR_$(umul$a3_highpart$)", "smul_highpart_optab->handlers[$A].insn_code = CODE_FOR_$(smul$a3_highpart$)", "smul_widen_optab->handlers[$B].insn_code = CODE_FOR_$(mul$a$b3$)$N", "umul_widen_optab->handlers[$B].insn_code = CODE_FOR_$(umul$a$b3$)$N", "sdiv_optab->handlers[$A].insn_code = CODE_FOR_$(div$a3$)", - "sdivv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(div$V$I$a3$)", + "sdivv_optab->handlers[$A].insn_code = CODE_FOR_$(div$V$I$a3$)", "udiv_optab->handlers[$A].insn_code = CODE_FOR_$(udiv$I$a3$)", "sdivmod_optab->handlers[$A].insn_code = CODE_FOR_$(divmod$a4$)", "udivmod_optab->handlers[$A].insn_code = CODE_FOR_$(udivmod$a4$)", @@ -108,13 +109,13 @@ static const char * const optabs[] = "pow_optab->handlers[$A].insn_code = CODE_FOR_$(pow$a3$)", "atan2_optab->handlers[$A].insn_code = CODE_FOR_$(atan2$a3$)", "neg_optab->handlers[$A].insn_code = CODE_FOR_$(neg$P$a2$)", - "negv_optab->handlers[(int) $A].insn_code =\n\ - neg_optab->handlers[(int) $A].insn_code = CODE_FOR_$(neg$F$a2$)", - "negv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(negv$I$a2$)", + "negv_optab->handlers[$A].insn_code =\n\ + neg_optab->handlers[$A].insn_code = CODE_FOR_$(neg$F$a2$)", + "negv_optab->handlers[$A].insn_code = CODE_FOR_$(negv$I$a2$)", "abs_optab->handlers[$A].insn_code = CODE_FOR_$(abs$P$a2$)", - "absv_optab->handlers[(int) $A].insn_code =\n\ - abs_optab->handlers[(int) $A].insn_code = CODE_FOR_$(abs$F$a2$)", - "absv_optab->handlers[(int) $A].insn_code = CODE_FOR_$(absv$I$a2$)", + "absv_optab->handlers[$A].insn_code =\n\ + abs_optab->handlers[$A].insn_code = CODE_FOR_$(abs$F$a2$)", + "absv_optab->handlers[$A].insn_code = CODE_FOR_$(absv$I$a2$)", "sqrt_optab->handlers[$A].insn_code = CODE_FOR_$(sqrt$a2$)", "floor_optab->handlers[$A].insn_code = CODE_FOR_$(floor$a2$)", "ceil_optab->handlers[$A].insn_code = CODE_FOR_$(ceil$a2$)", @@ -229,7 +230,7 @@ gen_insn (rtx insn) look through the modes in reverse order, in case EXTRA_CC_MODES was used and CC is a prefix of the CC modes (as it should be). */ - for (i = ((int) MAX_MACHINE_MODE) - 1; i >= 0; i--) + for (i = (MAX_MACHINE_MODE) - 1; i >= 0; i--) { for (p = GET_MODE_NAME(i), q = np; *p; p++, q++) if (TOLOWER (*p) != *q) @@ -303,16 +304,15 @@ gen_insn (rtx insn) putchar (TOLOWER (*np)); break; case 'A': - printf ("(int) %smode", GET_MODE_NAME(m1)); + printf ("%smode", GET_MODE_NAME(m1)); break; case 'B': - printf ("(int) %smode", GET_MODE_NAME(m2)); + printf ("%smode", GET_MODE_NAME(m2)); break; case 'c': printf ("%s", GET_RTX_NAME(op)); break; case 'C': - printf ("(int) "); for (np = GET_RTX_NAME(op); *np; np++) putchar (TOUPPER (*np)); break; @@ -368,7 +368,17 @@ from the machine description file `md'. */\n\n"); gen_insn (desc); } - printf ("}\n"); + puts ("\ +\n\ +#ifdef FIXUNS_TRUNC_LIKE_FIX_TRUNC\n\ + /* This flag says the same insns that convert to a signed fixnum\n\ + also convert validly to an unsigned one. */\n\ + for (i = 0; i < NUM_MACHINE_MODES; i++)\n\ + for (j = 0; j < NUM_MACHINE_MODES; j++)\n\ + ufixtrunc_optab->handlers[i][j].insn_code\n\ + = sfixtrunc_optab->handlers[i][j].insn_code;\n\ +#endif\n\ +}"); fflush (stdout); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); |