diff mbox

[MIPS] Fix operands for microMIPS SW16, SH16 and SB16

Message ID 87zjjrxb11.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford April 12, 2014, 7:27 a.m. UTC
Matthew Fortune <Matthew.Fortune@imgtec.com> writes:
> Hi Catherine/Richard,
>
> I think there may be some impact on register move costs by introducing
> this class.

Yeah, I was worried about that too.  I'm going to do some code comparison
tests for SE and MIPS16 to see what happens.

> Is it worth having mips_canonicalize_move_class return M16_REGS for
> M16_STORE_REGS to reduce the effect on costings? Given the extra
> register is only $0 then this would seem mostly acceptable albeit
> slightly strange.

This will happen automatically, since M16_STORE_REGS is just M16_REGS
without $16.  (M16_STORE_REGS doesn't include $0, since that's handled
as a constant instead.)

However:


this bit isn't right.  We should leave entry 0 alone and change the
M16_REGS entries for every register except $16.

Thanks,
Richard
diff mbox

Patch

Index: config/mips/mips.c
===================================================================
--- config/mips/mips.c	(revision 209307)
+++ config/mips/mips.c	(working copy)
@@ -648,7 +648,7 @@  static mips_one_only_stub *mips16_set_fcsr_stub;
 
 /* Index R is the smallest register class that contains register R.  */
 const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = {
-  LEA_REGS,	LEA_REGS,	M16_REGS,	V1_REG,
+  M16_STORE_REGS, LEA_REGS,	M16_REGS,	V1_REG,
   M16_REGS,	M16_REGS,	M16_REGS,	M16_REGS,
   LEA_REGS,	LEA_REGS,	LEA_REGS,	LEA_REGS,
   LEA_REGS,	LEA_REGS,	LEA_REGS,	LEA_REGS,