Commit fb7e77d7 by Toon Moene Committed by Toon Moene

expr.h: Adjust prototypes for have_add2_insn, have_sub2_insn.

2001-07-09  Toon Moene  <toon@moene.indiv.nluug.nl>

	* expr.h: Adjust prototypes for have_add2_insn, have_sub2_insn.
	* optabs.c (have_add2_insn): Check whether the add insn chosen
	really accepts the operands.  (have_sub2_insn): Ditto for sub insn.
	* reload1.c (reload_cse_move2add): Adjust calls of have_add2_insn.

From-SVN: r43874
parent 44cec300
2001-07-09 Toon Moene <toon@moene.indiv.nluug.nl>
* expr.h: Adjust prototypes for have_add2_insn, have_sub2_insn.
* optabs.c (have_add2_insn): Check whether the add insn chosen
really accepts the operands. (have_sub2_insn): Ditto for sub insn.
* reload1.c (reload_cse_move2add): Adjust calls of have_add2_insn.
*************** extern rtx gen_add2_insn PARAMS ((rtx, r
Mon Jul 9 13:26:40 2001 Jeffrey A Law (law@cygnus.com)
* Makefile.in (OBJS): Add ssa-ccp.o
......
......@@ -841,8 +841,8 @@ int can_conditionally_move_p PARAMS ((enum machine_mode mode));
extern rtx gen_add2_insn PARAMS ((rtx, rtx));
extern rtx gen_sub2_insn PARAMS ((rtx, rtx));
extern rtx gen_move_insn PARAMS ((rtx, rtx));
extern int have_add2_insn PARAMS ((enum machine_mode));
extern int have_sub2_insn PARAMS ((enum machine_mode));
extern int have_add2_insn PARAMS ((rtx, rtx));
extern int have_sub2_insn PARAMS ((rtx, rtx));
/* Return the INSN_CODE to use for an extend operation. */
extern enum insn_code can_extend_p PARAMS ((enum machine_mode,
......
......@@ -3765,10 +3765,28 @@ gen_add2_insn (x, y)
}
int
have_add2_insn (mode)
enum machine_mode mode;
have_add2_insn (x, y)
rtx x, y;
{
return add_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing;
int icode;
if (GET_MODE (x) == VOIDmode)
abort ();
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
if (icode == CODE_FOR_nothing)
return 0;
if (! ((*insn_data[icode].operand[0].predicate)
(x, insn_data[icode].operand[0].mode))
|| ! ((*insn_data[icode].operand[1].predicate)
(x, insn_data[icode].operand[1].mode))
|| ! ((*insn_data[icode].operand[2].predicate)
(y, insn_data[icode].operand[2].mode)))
return 0;
return 1;
}
/* Generate and return an insn body to subtract Y from X. */
......@@ -3791,10 +3809,28 @@ gen_sub2_insn (x, y)
}
int
have_sub2_insn (mode)
enum machine_mode mode;
have_sub2_insn (x, y)
rtx x, y;
{
return sub_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing;
int icode;
if (GET_MODE (x) == VOIDmode)
abort ();
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
if (icode == CODE_FOR_nothing)
return 0;
if (! ((*insn_data[icode].operand[0].predicate)
(x, insn_data[icode].operand[0].mode))
|| ! ((*insn_data[icode].operand[1].predicate)
(x, insn_data[icode].operand[1].mode))
|| ! ((*insn_data[icode].operand[2].predicate)
(y, insn_data[icode].operand[2].mode)))
return 0;
return 1;
}
/* Generate the body of an instruction to copy Y into X.
......
......@@ -9161,7 +9161,7 @@ reload_cse_move2add (first)
if (new_src == const0_rtx)
success = validate_change (insn, &SET_SRC (pat), reg, 0);
else if (rtx_cost (new_src, PLUS) < rtx_cost (src, SET)
&& have_add2_insn (GET_MODE (reg)))
&& have_add2_insn (reg, new_src))
success = validate_change (insn, &PATTERN (insn),
gen_add2_insn (reg, new_src), 0);
reg_set_luid[regno] = move2add_luid;
......@@ -9212,7 +9212,7 @@ reload_cse_move2add (first)
= validate_change (next, &SET_SRC (set), reg, 0);
else if ((rtx_cost (new_src, PLUS)
< COSTS_N_INSNS (1) + rtx_cost (src3, SET))
&& have_add2_insn (GET_MODE (reg)))
&& have_add2_insn (reg, new_src))
success
= validate_change (next, &PATTERN (next),
gen_add2_insn (reg, new_src), 0);
......
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