Commit aea8fc97 by Nick Clifton Committed by Nick Clifton

rx-modes.def: New file.

        * config/rx/rx-modes.def: New file.
        * config/rx/rx.h (FIRST_PSEUDO_REGISTER): Increase to 17.
        (CC_REGNUM): Define.
        (FIXED_REGISTERS, CALL_USED_REGISTERS, REGISTER_NAMES): Add cc
        register.
        (CC_NO_CARRY, NOTICE_UPDATE_CC): Delete.
        (SELECT_CC_MODE): Define.
        * config/rx/rx.md (CC_REG): Define.  Update all patterns to use
        (reg:CC CC_REG) instead of (cc0).
        (attr "cc"): Delete.
        (cbranchsi4): Do not split compare and branch here. Instead move
        it to...
        (cbranchsi4_<code>): ... here.  New patterns.
        (cmpsi): Call rx-compare_redundant to find out if it is necessary
        to emit the compare instruction.
        * config/rx/rx.c (rx_gen-cond_branch_template): Remove tests of
        cc_status flags.
        (rx_get_stack_layout): Iterate up to before CC_REGNUM not
        FIRST_PSEUDO_REGNUM.
        (rx_expand_prologue, rx_expand_epilogue): Likewise.
        (rx_notice_update_cc): Delete.
        (rx_cc_modes_compatible): New function.
        (flags_needed_for_conditional): New function.
        (flags_from_mode): New function.
        (rx_compare_redundant): New function - scans backwards through
        insn list to find out if condition flags are already set
        correctly.
        (TARGET_CC_MODES_COMPATIBLE): Define.
        * config/rx/rx-protos.h (rx_compare_redundant): Prototype.

        * config/rx/rx.h (BRANCH_COST): Define.
        (REGISTER_MOVE_COST): Define.
        * config/rx/predicates (rx_source_operand): Allow all constant
        types.
        * config/rx/rx.md (addsi3): Add alternative for swapped operands.
        (tstsi4): New pattern.
        * config/rx/rx.c (rx_memory_move_cost): Define.
        (TARGET_MEMORY_MOVE_COST): Define.

From-SVN: r161592
parent 6662d794
2010-06-30 Nick Clifton <nickc@redhat.com>
* config/rx/rx-modes.def: New file.
* config/rx/rx.h (FIRST_PSEUDO_REGISTER): Increase to 17.
(CC_REGNUM): Define.
(FIXED_REGISTERS, CALL_USED_REGISTERS, REGISTER_NAMES): Add cc
register.
(CC_NO_CARRY, NOTICE_UPDATE_CC): Delete.
(SELECT_CC_MODE): Define.
* config/rx/rx.md (CC_REG): Define. Update all patterns to use
(reg:CC CC_REG) instead of (cc0).
(attr "cc"): Delete.
(cbranchsi4): Do not split compare and branch here. Instead move
it to...
(cbranchsi4_<code>): ... here. New patterns.
(cmpsi): Call rx-compare_redundant to find out if it is necessary
to emit the compare instruction.
* config/rx/rx.c (rx_gen-cond_branch_template): Remove tests of
cc_status flags.
(rx_get_stack_layout): Iterate up to before CC_REGNUM not
FIRST_PSEUDO_REGNUM.
(rx_expand_prologue, rx_expand_epilogue): Likewise.
(rx_notice_update_cc): Delete.
(rx_cc_modes_compatible): New function.
(flags_needed_for_conditional): New function.
(flags_from_mode): New function.
(rx_compare_redundant): New function - scans backwards through
insn list to find out if condition flags are already set
correctly.
(TARGET_CC_MODES_COMPATIBLE): Define.
* config/rx/rx-protos.h (rx_compare_redundant): Prototype.
* config/rx/rx.h (BRANCH_COST): Define.
(REGISTER_MOVE_COST): Define.
* config/rx/predicates (rx_source_operand): Allow all constant
types.
* config/rx/rx.md (addsi3): Add alternative for swapped operands.
(tstsi4): New pattern.
* config/rx/rx.c (rx_memory_move_cost): Define.
(TARGET_MEMORY_MOVE_COST): Define.
2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree.h (block_may_fallthru): Declare here.
......
......@@ -50,9 +50,9 @@
;; and a restricted subset of memory addresses are allowed.
(define_predicate "rx_source_operand"
(match_code "const_int,reg,mem")
(match_code "const_int,const_double,const,symbol_ref,label_ref,reg,mem")
{
if (CONST_INT_P (op))
if (CONSTANT_P (op))
return rx_is_legitimate_constant (op);
if (! MEM_P (op))
......
/* Definitions of target machine for GNU compiler, for ARM.
Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
More major hacks by Richard Earnshaw (rearnsha@arm.com)
Minor hacks by Nick Clifton (nickc@cygnus.com)
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
CC_MODE (CC_ZS);
CC_MODE (CC_ZSO);
CC_MODE (CC_ZSC);
......@@ -31,6 +31,7 @@ extern int rx_initial_elimination_offset (int, int);
extern void rx_set_optimization_options (void);
#ifdef RTX_CODE
extern bool rx_compare_redundant (rtx);
extern void rx_emit_stack_popm (rtx *, bool);
extern void rx_emit_stack_pushm (rtx *);
extern void rx_expand_epilogue (bool);
......
......@@ -207,7 +207,7 @@ enum reg_class
#define BASE_REG_CLASS GR_REGS
#define INDEX_REG_CLASS GR_REGS
#define FIRST_PSEUDO_REGISTER 16
#define FIRST_PSEUDO_REGISTER 17
#define REGNO_REG_CLASS(REGNO) ((REGNO) < FIRST_PSEUDO_REGISTER \
? GR_REGS : NO_REGS)
......@@ -219,6 +219,7 @@ enum reg_class
#define STATIC_CHAIN_REGNUM 8
#define TRAMPOLINE_TEMP_REGNUM 9
#define STRUCT_VAL_REGNUM 15
#define CC_REGNUM 16
/* This is the register which is used to hold the address of the start
of the small data area, if that feature is being used. Note - this
......@@ -245,12 +246,12 @@ enum reg_class
#define FIXED_REGISTERS \
{ \
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 \
}
#define CALL_USED_REGISTERS \
{ \
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 \
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 \
}
#define CONDITIONAL_REGISTER_USAGE \
......@@ -351,7 +352,7 @@ typedef unsigned int CUMULATIVE_ARGS;
#define REGISTER_NAMES \
{ \
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" \
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "cc" \
};
#define ADDITIONAL_REGISTER_NAMES \
......@@ -609,9 +610,6 @@ typedef unsigned int CUMULATIVE_ARGS;
they contain are always computed between two same-section symbols. */
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#define CC_NO_CARRY 0400
#define NOTICE_UPDATE_CC(EXP, INSN) rx_notice_update_cc (EXP, INSN)
extern int rx_float_compare_mode;
/* This is a version of REG_P that also returns TRUE for SUBREGs. */
......@@ -646,3 +644,16 @@ extern int rx_float_compare_mode;
/* This macro is used to decide when RX FPU instructions can be used. */
#define ALLOW_RX_FPU_INSNS (TARGET_USE_FPU)
#define BRANCH_COST(SPEED,PREDICT) 1
#define REGISTER_MOVE_COST(MODE,FROM,TO) 2
#define SELECT_CC_MODE(OP,X,Y) \
(GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CC_ZSmode : \
(GET_CODE (X) == PLUS || GET_CODE (X) == MINUS ? CC_ZSCmode : \
(GET_CODE (X) == ABS ? CC_ZSOmode : \
(GET_CODE (X) == AND || GET_CODE (X) == NOT || GET_CODE (X) == IOR \
|| GET_CODE (X) == XOR || GET_CODE (X) == ROTATE \
|| GET_CODE (X) == ROTATERT || GET_CODE (X) == ASHIFTRT \
|| GET_CODE (X) == LSHIFTRT || GET_CODE (X) == ASHIFT ? CC_ZSmode : \
CCmode))))
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