Commit d40ba0b6 by Nick Clifton Committed by Nick Clifton

stormy16.md (CARRY_REG): New constant.

* config/stormy16/stormy16.md (CARRY_REG): New constant.
  Replace uses of the "y" register class with direct references to
  the CARRY_REG register.
  * config/stormy16/stormy16.c: Replace clobbers of a BImode scratch
  register with clobbers of the carry register.
  (xstormy16_secondary_reload_class): Do not return CARRY_REGS.
  (xstormy16_split_cbranch): Remove redundant carry parameter.
  (xstormy16_expand_arith): Likewise.
  * config/stormy16/stormy16.h (enum reg_class): Remove CARRY_REGS.
  (IRA_COVER_CLASSES, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
  REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Likewise.
  (CARRY_REGNUM): Define.
  * config/stormy16/stormy16-protos.h (xstormy16_split_cbranch):
  Update prototype.
  (xstormy16_expand_arith): Likewise.

From-SVN: r142309
parent e8ddcbf9
2008-12-01 Nick Clifton <nickc@redhat.com>
* config/stormy16/stormy16.md (CARRY_REG): New constant.
Replace uses of the "y" register class with direct references to
the CARRY_REG register.
* config/stormy16/stormy16.c: Replace clobbers of a BImode scratch
register with clobbers of the carry register.
(xstormy16_secondary_reload_class): Do not return CARRY_REGS.
(xstormy16_split_cbranch): Remove redundant carry parameter.
(xstormy16_expand_arith): Likewise.
* config/stormy16/stormy16.h (enum reg_class): Remove CARRY_REGS.
(IRA_COVER_CLASSES, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Likewise.
(CARRY_REGNUM): Define.
* config/stormy16/stormy16-protos.h (xstormy16_split_cbranch):
Update prototype.
(xstormy16_expand_arith): Likewise.
2008-12-01 Chen Liqin <liqin.chen@sunplusct.com> 2008-12-01 Chen Liqin <liqin.chen@sunplusct.com>
* config/score/score.h (IRA_COVER_CLASSES): Define. * config/score/score.h (IRA_COVER_CLASSES): Define.
...@@ -64,7 +64,7 @@ extern void xstormy16_expand_andqi3 (rtx *); ...@@ -64,7 +64,7 @@ extern void xstormy16_expand_andqi3 (rtx *);
#endif #endif
#if defined (HAVE_MACHINE_MODES) && defined (RTX_CODE) #if defined (HAVE_MACHINE_MODES) && defined (RTX_CODE)
extern void xstormy16_split_cbranch (enum machine_mode, rtx, rtx, rtx, rtx); extern void xstormy16_split_cbranch (enum machine_mode, rtx, rtx, rtx);
extern int short_memory_operand (rtx, enum machine_mode); extern int short_memory_operand (rtx, enum machine_mode);
extern int nonimmediate_nonstack_operand (rtx, enum machine_mode); extern int nonimmediate_nonstack_operand (rtx, enum machine_mode);
extern enum reg_class xstormy16_secondary_reload_class extern enum reg_class xstormy16_secondary_reload_class
...@@ -74,7 +74,7 @@ extern int xstormy16_legitimate_address_p (enum machine_mode, rtx, int); ...@@ -74,7 +74,7 @@ extern int xstormy16_legitimate_address_p (enum machine_mode, rtx, int);
extern void xstormy16_split_move (enum machine_mode, rtx, rtx); extern void xstormy16_split_move (enum machine_mode, rtx, rtx);
extern void xstormy16_expand_move (enum machine_mode, rtx, rtx); extern void xstormy16_expand_move (enum machine_mode, rtx, rtx);
extern void xstormy16_expand_arith (enum machine_mode, enum rtx_code, extern void xstormy16_expand_arith (enum machine_mode, enum rtx_code,
rtx, rtx, rtx, rtx); rtx, rtx, rtx);
extern const char * xstormy16_output_shift (enum machine_mode, enum rtx_code, extern const char * xstormy16_output_shift (enum machine_mode, enum rtx_code,
rtx, rtx, rtx); rtx, rtx, rtx);
extern int xstormy16_below100_symbol (rtx, enum machine_mode); extern int xstormy16_below100_symbol (rtx, enum machine_mode);
......
...@@ -214,7 +214,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx loc) ...@@ -214,7 +214,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx loc)
gen_rtx_IF_THEN_ELSE (VOIDmode, condition_rtx, gen_rtx_IF_THEN_ELSE (VOIDmode, condition_rtx,
loc_ref, pc_rtx)); loc_ref, pc_rtx));
cy_clobber = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (BImode)); cy_clobber = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (BImode, 16));
if (mode == HImode) if (mode == HImode)
vec = gen_rtvec (2, branch, cy_clobber); vec = gen_rtvec (2, branch, cy_clobber);
...@@ -240,7 +240,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx loc) ...@@ -240,7 +240,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx loc)
void void
xstormy16_split_cbranch (enum machine_mode mode, rtx label, rtx comparison, xstormy16_split_cbranch (enum machine_mode mode, rtx label, rtx comparison,
rtx dest, rtx carry) rtx dest)
{ {
rtx op0 = XEXP (comparison, 0); rtx op0 = XEXP (comparison, 0);
rtx op1 = XEXP (comparison, 1); rtx op1 = XEXP (comparison, 1);
...@@ -248,7 +248,7 @@ xstormy16_split_cbranch (enum machine_mode mode, rtx label, rtx comparison, ...@@ -248,7 +248,7 @@ xstormy16_split_cbranch (enum machine_mode mode, rtx label, rtx comparison,
rtx compare; rtx compare;
start_sequence (); start_sequence ();
xstormy16_expand_arith (mode, COMPARE, dest, op0, op1, carry); xstormy16_expand_arith (mode, COMPARE, dest, op0, op1);
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
...@@ -474,11 +474,6 @@ xstormy16_secondary_reload_class (enum reg_class rclass, ...@@ -474,11 +474,6 @@ xstormy16_secondary_reload_class (enum reg_class rclass,
&& ! reg_class_subset_p (rclass, EIGHT_REGS)) && ! reg_class_subset_p (rclass, EIGHT_REGS))
return EIGHT_REGS; return EIGHT_REGS;
/* When reloading a PLUS, the carry register will be required
unless the inc or dec instructions can be used. */
if (xstormy16_carry_plus_operand (x, mode))
return CARRY_REGS;
return NO_REGS; return NO_REGS;
} }
...@@ -978,7 +973,7 @@ struct xstormy16_stack_layout ...@@ -978,7 +973,7 @@ struct xstormy16_stack_layout
#define REG_NEEDS_SAVE(REGNUM, IFUN) \ #define REG_NEEDS_SAVE(REGNUM, IFUN) \
((df_regs_ever_live_p (REGNUM) && ! call_used_regs[REGNUM]) \ ((df_regs_ever_live_p (REGNUM) && ! call_used_regs[REGNUM]) \
|| (IFUN && ! fixed_regs[REGNUM] && call_used_regs[REGNUM] \ || (IFUN && ! fixed_regs[REGNUM] && call_used_regs[REGNUM] \
&& (REGNO_REG_CLASS (REGNUM) != CARRY_REGS) \ && (REGNUM != CARRY_REGNUM) \
&& (df_regs_ever_live_p (REGNUM) || ! current_function_is_leaf))) && (df_regs_ever_live_p (REGNUM) || ! current_function_is_leaf)))
/* Compute the stack layout. */ /* Compute the stack layout. */
...@@ -1967,13 +1962,12 @@ xstormy16_expand_call (rtx retval, rtx dest, rtx counter) ...@@ -1967,13 +1962,12 @@ xstormy16_expand_call (rtx retval, rtx dest, rtx counter)
(set DEST (CODE:MODE SRC0 SRC1)) (set DEST (CODE:MODE SRC0 SRC1))
using CARRY as a temporary. When CODE is COMPARE, a branch When CODE is COMPARE, a branch template is generated
template is generated (this saves duplicating code in (this saves duplicating code in xstormy16_split_cbranch). */
xstormy16_split_cbranch). */
void void
xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code, xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code,
rtx dest, rtx src0, rtx src1, rtx carry) rtx dest, rtx src0, rtx src1)
{ {
int num_words = GET_MODE_BITSIZE (mode) / BITS_PER_WORD; int num_words = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
int i; int i;
...@@ -2000,9 +1994,9 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code, ...@@ -2000,9 +1994,9 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code,
continue; continue;
if (firstloop) if (firstloop)
insn = gen_addchi4 (w_dest, w_src0, w_src1, carry); insn = gen_addchi4 (w_dest, w_src0, w_src1);
else else
insn = gen_addchi5 (w_dest, w_src0, w_src1, carry, carry); insn = gen_addchi5 (w_dest, w_src0, w_src1);
break; break;
case NEG: case NEG:
...@@ -2013,10 +2007,10 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code, ...@@ -2013,10 +2007,10 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code,
rtx branch, sub, clobber, sub_1; rtx branch, sub, clobber, sub_1;
sub_1 = gen_rtx_MINUS (HImode, w_src0, sub_1 = gen_rtx_MINUS (HImode, w_src0,
gen_rtx_ZERO_EXTEND (HImode, carry)); gen_rtx_ZERO_EXTEND (HImode, gen_rtx_REG (BImode, 16)));
sub = gen_rtx_SET (VOIDmode, w_dest, sub = gen_rtx_SET (VOIDmode, w_dest,
gen_rtx_MINUS (HImode, sub_1, w_src1)); gen_rtx_MINUS (HImode, sub_1, w_src1));
clobber = gen_rtx_CLOBBER (VOIDmode, carry); clobber = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (BImode, 16));
branch = gen_rtx_SET (VOIDmode, pc_rtx, branch = gen_rtx_SET (VOIDmode, pc_rtx,
gen_rtx_IF_THEN_ELSE (VOIDmode, gen_rtx_IF_THEN_ELSE (VOIDmode,
gen_rtx_EQ (HImode, gen_rtx_EQ (HImode,
...@@ -2032,9 +2026,9 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code, ...@@ -2032,9 +2026,9 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code,
&& GET_CODE (w_src1) == CONST_INT && INTVAL (w_src1) == 0) && GET_CODE (w_src1) == CONST_INT && INTVAL (w_src1) == 0)
continue; continue;
else if (firstloop) else if (firstloop)
insn = gen_subchi4 (w_dest, w_src0, w_src1, carry); insn = gen_subchi4 (w_dest, w_src0, w_src1);
else else
insn = gen_subchi5 (w_dest, w_src0, w_src1, carry, carry); insn = gen_subchi5 (w_dest, w_src0, w_src1);
break; break;
case IOR: case IOR:
......
...@@ -191,7 +191,6 @@ enum reg_class ...@@ -191,7 +191,6 @@ enum reg_class
R8_REGS, R8_REGS,
ICALL_REGS, ICALL_REGS,
GENERAL_REGS, GENERAL_REGS,
CARRY_REGS,
ALL_REGS, ALL_REGS,
LIM_REG_CLASSES LIM_REG_CLASSES
}; };
...@@ -200,7 +199,7 @@ enum reg_class ...@@ -200,7 +199,7 @@ enum reg_class
#define IRA_COVER_CLASSES \ #define IRA_COVER_CLASSES \
{ \ { \
GENERAL_REGS, CARRY_REGS, LIM_REG_CLASSES \ GENERAL_REGS, LIM_REG_CLASSES \
} }
#define REG_CLASS_NAMES \ #define REG_CLASS_NAMES \
...@@ -214,7 +213,6 @@ enum reg_class ...@@ -214,7 +213,6 @@ enum reg_class
"R8_REGS", \ "R8_REGS", \
"ICALL_REGS", \ "ICALL_REGS", \
"GENERAL_REGS", \ "GENERAL_REGS", \
"CARRY_REGS", \
"ALL_REGS" \ "ALL_REGS" \
} }
...@@ -229,17 +227,15 @@ enum reg_class ...@@ -229,17 +227,15 @@ enum reg_class
{ 0x00100 }, \ { 0x00100 }, \
{ 0x00300 }, \ { 0x00300 }, \
{ 0x6FFFF }, \ { 0x6FFFF }, \
{ 0x10000 }, \
{ (1 << FIRST_PSEUDO_REGISTER) - 1 } \ { (1 << FIRST_PSEUDO_REGISTER) - 1 } \
} }
#define REGNO_REG_CLASS(REGNO) \ #define REGNO_REG_CLASS(REGNO) \
((REGNO) == 0 ? R0_REGS \ ( (REGNO) == 0 ? R0_REGS \
: (REGNO) == 1 ? R1_REGS \ : (REGNO) == 1 ? R1_REGS \
: (REGNO) == 2 ? R2_REGS \ : (REGNO) == 2 ? R2_REGS \
: (REGNO) < 8 ? EIGHT_REGS \ : (REGNO) < 8 ? EIGHT_REGS \
: (REGNO) == 8 ? R8_REGS \ : (REGNO) == 8 ? R8_REGS \
: (REGNO) == 16 ? CARRY_REGS \
: (REGNO) <= 18 ? GENERAL_REGS \ : (REGNO) <= 18 ? GENERAL_REGS \
: ALL_REGS) : ALL_REGS)
...@@ -264,7 +260,6 @@ enum reg_class ...@@ -264,7 +260,6 @@ enum reg_class
: (CHAR) == 'd' ? R8_REGS \ : (CHAR) == 'd' ? R8_REGS \
: (CHAR) == 'e' ? EIGHT_REGS \ : (CHAR) == 'e' ? EIGHT_REGS \
: (CHAR) == 't' ? TWO_REGS \ : (CHAR) == 't' ? TWO_REGS \
: (CHAR) == 'y' ? CARRY_REGS \
: (CHAR) == 'z' ? ICALL_REGS \ : (CHAR) == 'z' ? ICALL_REGS \
: NO_REGS) : NO_REGS)
...@@ -362,15 +357,12 @@ enum reg_class ...@@ -362,15 +357,12 @@ enum reg_class
/* Register That Address the Stack Frame. */ /* Register That Address the Stack Frame. */
#define STACK_POINTER_REGNUM 15 #define STATIC_CHAIN_REGNUM 1
#define FRAME_POINTER_REGNUM 17
#define HARD_FRAME_POINTER_REGNUM 13 #define HARD_FRAME_POINTER_REGNUM 13
#define STACK_POINTER_REGNUM 15
#define ARG_POINTER_REGNUM 18 #define CARRY_REGNUM 16
#define FRAME_POINTER_REGNUM 17
#define STATIC_CHAIN_REGNUM 1 #define ARG_POINTER_REGNUM 18
/* Eliminating the Frame Pointer and the Arg Pointer */ /* Eliminating the Frame Pointer and the Arg Pointer */
......
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