From: hp Date: Mon, 10 Jun 2002 22:23:03 +0000 (+0000) Subject: * config/mmix/mmix.h: Improve comments. X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=1265932f4354eec49d275b0fae4a5fcd86b97152;p=pf3gnuchains%2Fgcc-fork.git * config/mmix/mmix.h: Improve comments. (CPP_SPEC, CPP_PREDEFINES): Don't define. (TARGET_CPU_CPP_BUILTINS): Define. (CANONICALIZE_COMPARISON): Don't define, replace with comment. (PREDICATE_CODES) <"mmix_reg_or_8bit_or_256_operand">: Remove unused predicate. * config/mmix/mmix.c (MMIX_OUTPUT_REGNO): Add cast to avoid compiler warning. (mmix_constant_address_p): Remove another redundant test before case. (mmix_canonicalize_comparison): Remove unused function. (mmix_print_operand_address): Don't test and adjust for operand in non-canonical format. (mmix_reg_or_8bit_or_256_operand): Remove unused predicate. (mmix_gen_compare_reg): Don't use CANONICALIZE_COMPARISON. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54474 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 13dbbfa7233..1bfeb34b021 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2002-06-10 Hans-Peter Nilsson + + * config/mmix/mmix.h: Improve comments. + (CPP_SPEC, CPP_PREDEFINES): Don't define. + (TARGET_CPU_CPP_BUILTINS): Define. + (CANONICALIZE_COMPARISON): Don't define, replace with comment. + (PREDICATE_CODES) <"mmix_reg_or_8bit_or_256_operand">: Remove + unused predicate. + * config/mmix/mmix.c (MMIX_OUTPUT_REGNO): Add cast to avoid + compiler warning. + (mmix_constant_address_p): Remove another + redundant test before case. + (mmix_canonicalize_comparison): Remove unused function. + (mmix_print_operand_address): Don't test and adjust for operand in + non-canonical format. + (mmix_reg_or_8bit_or_256_operand): Remove unused predicate. + (mmix_gen_compare_reg): Don't use CANONICALIZE_COMPARISON. + 2002-06-10 Zack Weinberg * config/m32r/m32r.h: Don't define SELECT_CC_MODE. diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 6e66c9f8d06..038a67a2fcd 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -71,8 +71,8 @@ Boston, MA 02111-1307, USA. */ increasing rL and clearing unused (unset) registers with lower numbers. */ #define MMIX_OUTPUT_REGNO(N) \ (TARGET_ABI_GNU \ - || (N) < MMIX_RETURN_VALUE_REGNUM \ - || (N) > MMIX_LAST_STACK_REGISTER_REGNUM \ + || (int) (N) < MMIX_RETURN_VALUE_REGNUM \ + || (int) (N) > MMIX_LAST_STACK_REGISTER_REGNUM \ ? (N) : ((N) - MMIX_RETURN_VALUE_REGNUM \ + cfun->machine->highest_saved_stack_register + 1)) @@ -1454,10 +1454,6 @@ mmix_constant_address_p (x) /* When using "base addresses", anything constant goes. */ int constant_ok = TARGET_BASE_ADDRESSES != 0; - if (code == CONSTANT_P_RTX || code == HIGH) - /* FIXME: Don't know how to dissect these. Avoid them for now. */ - return constant_ok; - switch (code) { case LABEL_REF: @@ -1620,37 +1616,6 @@ mmix_select_cc_mode (op, x, y) return CCmode; } -/* CANONICALIZE_COMPARISON. - FIXME: Check if the number adjustments trig. */ - -void -mmix_canonicalize_comparison (codep, op0p, op1p) - RTX_CODE * codep; - rtx * op0p ATTRIBUTE_UNUSED; - rtx * op1p; -{ - /* Change -1 to zero, if possible. */ - if ((*codep == LE || *codep == GT) - && GET_CODE (*op1p) == CONST_INT - && *op1p == constm1_rtx) - { - *codep = *codep == LE ? LT : GE; - *op1p = const0_rtx; - } - - /* Fix up 256 to 255, if possible. */ - if ((*codep == LT || *codep == LTU || *codep == GE || *codep == GEU) - && GET_CODE (*op1p) == CONST_INT - && INTVAL (*op1p) == 256) - { - /* FIXME: Remove when I know this trigs. */ - fatal_insn ("oops, not debugged; fixing up value:", *op1p); - *codep = *codep == LT ? LE : *codep == LTU ? LEU : *codep - == GE ? GT : GTU; - *op1p = GEN_INT (255); - } -} - /* REVERSIBLE_CC_MODE. */ int @@ -2360,14 +2325,6 @@ mmix_print_operand_address (stream, x) rtx x1 = XEXP (x, 0); rtx x2 = XEXP (x, 1); - /* Try swap the order. FIXME: Do we need this? */ - if (! REG_P (x1)) - { - rtx tem = x1; - x1 = x2; - x2 = tem; - } - if (REG_P (x1)) { fprintf (stream, "%s,", reg_names[MMIX_OUTPUT_REGNO (REGNO (x1))]); @@ -2787,20 +2744,6 @@ mmix_reg_or_8bit_operand (op, mode) && CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')); } -/* True if this is a register or an int 0..256. We include 256, - because it can be canonicalized into 255 for comparisons, which is - currently the only use of this predicate. - FIXME: Check that this happens and does TRT. */ - -int -mmix_reg_or_8bit_or_256_operand (op, mode) - rtx op; - enum machine_mode mode; -{ - return mmix_reg_or_8bit_operand (op, mode) - || (GET_CODE (op) == CONST_INT && INTVAL (op) == 256); -} - /* Returns zero if code and mode is not a valid condition from a compare-type insn. Nonzero if it is. The parameter op, if non-NULL, is the comparison of mode is CC-somethingmode. */ @@ -2860,8 +2803,6 @@ mmix_gen_compare_reg (code, x, y) if (! REG_P (x) && ! REG_P (y)) x = force_reg (mode, x); - CANONICALIZE_COMPARISON (code, x, y); - /* If it's not quite right yet, put y in a register. */ if (! REG_P (y) && (GET_CODE (y) != CONST_INT diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index d553aea418c..4ac2c2fa3a4 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -105,14 +105,6 @@ struct machine_function GTY(()) /* Node: Driver */ -/* When both ABI:s work, this is how we tell them apart in code. The - GNU abi is implied the default. Also implied in TARGET_DEFAULT. */ -#define CPP_SPEC \ - "%{mabi=gnu:-D__MMIX_ABI_GNU__\ - %{mabi=mmixware:\ - %eoptions -mabi=mmixware and -mabi=gnu are mutually exclusive}}\ - %{!mabi=gnu:-D__MMIX_ABI_MMIXWARE__}" - /* User symbols are in the same name-space as built-in symbols, but we don't need the built-in symbols, so remove those and instead apply stricter operand checking. Don't warn when expanding insns. */ @@ -148,7 +140,18 @@ extern const char *mmix_cc1_ignored_option; /* Node: Run-time Target */ /* Define __LONG_MAX__, since we're advised not to change glimits.h. */ -#define CPP_PREDEFINES "-D__mmix__ -D__MMIX__ -D__LONG_MAX__=9223372036854775807L" +#define TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__mmix__"); \ + builtin_define ("__MMIX__"); \ + builtin_define ("__LONG_MAX__=9223372036854775807L"); \ + if (TARGET_ABI_GNU) \ + builtin_define ("__MMIX_ABI_GNU__"); \ + else \ + builtin_define ("__MMIX_ABI_MMIXWARE__"); \ + } \ + while (0) extern int target_flags; @@ -167,7 +170,9 @@ extern int target_flags; a constant pool in global registers, code offseting from those registers (automatically causing a request for a suitable constant base address register) without having to know the specific register or the - specific offset. */ + specific offset. The setback is that there's a limited number of + registers, and you'll not find out until link time whether you + should've compiled with -mno-base-addresses. */ #define TARGET_MASK_BASE_ADDRESSES 128 /* FIXME: Get rid of this one. */ @@ -855,8 +860,13 @@ typedef struct { int regs; int lib; int now_varargs; } CUMULATIVE_ARGS; #define SELECT_CC_MODE(OP, X, Y) \ mmix_select_cc_mode (OP, X, Y) -#define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \ - mmix_canonicalize_comparison (&(CODE), &(OP0), &(OP1)); +/* A definition of CANONICALIZE_COMPARISON that changed LE and GT + comparisons with -1 to LT and GE respectively, and LT, LTU, GE or GEU + comparisons with 256 to 255 and LE, LEU, GT and GTU has been + ineffective; the code path for performing the changes did not trig for + neither the GCC test-suite nor ghostscript-6.52 nor Knuth's mmix.tar.gz + itself (core GCC functionality supposedly handling it) with sources + from 2002-06-06. */ #define REVERSIBLE_CC_MODE(MODE) \ mmix_reversible_cc_mode (MODE) @@ -999,8 +1009,8 @@ typedef struct { int regs; int lib; int now_varargs; } CUMULATIVE_ARGS; /* Node: Macros for Initialization */ -/* We're compiling to ELF and linking to MMO; all ELF features that GCC - care for are there. FIXME: Are they? */ +/* We're compiling to ELF and linking to MMO; fundamental ELF features + that GCC depend on are there. */ /* These must be constant strings, since they're used in crtstuff.c. */ #define INIT_SECTION_ASM_OP "\t.section .init,\"ax\" ! mmixal-incompatible" @@ -1127,8 +1137,6 @@ typedef struct { int regs; int lib; int now_varargs; } CUMULATIVE_ARGS; SUBREG, REG, PLUS}}, \ {"mmix_reg_or_constant_operand", \ {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ - {"mmix_reg_or_8bit_or_256_operand", \ - {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ {"mmix_reg_or_8bit_operand", \ {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ {"mmix_reg_or_0_operand", \