This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [MIPS] Hookize REGISTER_MOVE_COST and MEMORY_MOVE_COST
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Anatoly Sokolov <aesok at post dot ru>
- Cc: gcc-patches at gcc dot gnu dot org, echristo at apple dot com
- Date: Sat, 07 Aug 2010 13:40:36 +0100
- Subject: Re: [MIPS] Hookize REGISTER_MOVE_COST and MEMORY_MOVE_COST
- References: <868531388.20100807145612@post.ru>
Anatoly Sokolov <aesok@post.ru> writes:
> This patch removes obsolete REGISTER_MOVE_COST and MEMORY_MOVE_COST macros
> from the MIPS back end in the GCC and introduces equivalent
> TARGET_REGISTER_MOVE_COST and TARGET_MEMORY_MOVE_COST target hooks.
Thanks a lot for doing this. It's nice to see mips_rtx_cost_data
becoming private to mips.c.
> * config/mips/mips.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST):
> Remove macros.
> (mips_cost): Remove.
> (struct mips_rtx_cost_data): Moved to mips.c.
> * config/mips/mips-protos.h (mips_register_move_cost): Remove.
> * config/mips/mips.c (struct mips_rtx_cost_data): Moved from mips.h.
> (mips_cost): Make static.
> (mips_canonicalize_move_class): Change argument type to reg_class_t.
> Change result type to reg_class_t.
> (mips_move_to_gpr_cost, mips_move_from_gpr_cost): Change arguments
> type from enum reg_class to reg_class_t.
> (mips_register_move_cost): Make static. Change arguments
> type from enum reg_class to reg_class_t.
> (mips_memory_move_cost): New function.
> (TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.
The MIPS parts are OK with a couple of minor formatting niggles fixed (sorry):
> +static int mips_register_move_cost (enum machine_mode, reg_class_t, reg_class_t);
Line too long (by just 1 char).
> +/* Implement TARGET_MEMORY_MOVE_COST. */
> +
> +static int
> +mips_memory_move_cost (enum machine_mode mode, reg_class_t rclass, bool in)
> +{
> + return mips_cost->memory_latency
> + + memory_move_secondary_cost (mode, rclass, in);
Emacs brackets rule:
return (mips_cost->memory_latency
+ memory_move_secondary_cost (mode, rclass, in));
> +}
> +
> +
Excess blank line.
No need for a full retest for that, of course. If mips.o compiles,
it's fine.
Richard