This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] MIPS: Two classes associated with the "e" constraint


Hello,

 I've noticed the "e" constraint is bound to two register classes,
M16_NA_REGS and LEA_REGS, with obviously only one being active.  Here's an
obvious fix, allocating a new constraint for LEA_REGS, the newer of the
two classes.  But AFAICT "e" isn't used to refer to M16_NA_REGS anymore, 
so perhaps this meaning can simply be removed.

2004-02-27  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>

	* config/mips/mips.c (override_options): Use "w" instead of "e" as 
	a constraint for LEA_REGS.
	gcc/config/mips/mips.md (movdi_internal2): Likewise.
	(movsi_internal): Likewise.

 The patch is probably obviously correct, but I did a quick test by
building a cross-compiler for the mips64el-linux target and building a
Linux kernel with it (not a very extensive test, I'm afraid, given Linux
is built with "-fno-pic"...).

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

gcc-3.4-20031107-mips-lea_regs.patch
diff -up --recursive --new-file gcc-3.4-20031107.macro/gcc/config/mips/mips.c gcc-3.4-20031107/gcc/config/mips/mips.c
--- gcc-3.4-20031107.macro/gcc/config/mips/mips.c	2003-11-07 08:14:32.000000000 +0000
+++ gcc-3.4-20031107/gcc/config/mips/mips.c	2004-02-27 22:34:37.000000000 +0000
@@ -4842,7 +4842,7 @@ override_options (void)
   mips_char_to_class['c'] = (TARGET_ABICALLS ? PIC_FN_ADDR_REG :
 			     TARGET_MIPS16 ? M16_NA_REGS :
 			     GR_REGS);
-  mips_char_to_class['e'] = LEA_REGS;
+  mips_char_to_class['w'] = LEA_REGS;
   mips_char_to_class['j'] = PIC_FN_ADDR_REG;
   mips_char_to_class['y'] = GR_REGS;
   mips_char_to_class['z'] = ST_REGS;
diff -up --recursive --new-file gcc-3.4-20031107.macro/gcc/config/mips/mips.md gcc-3.4-20031107/gcc/config/mips/mips.md
--- gcc-3.4-20031107.macro/gcc/config/mips/mips.md	2003-11-07 08:14:32.000000000 +0000
+++ gcc-3.4-20031107/gcc/config/mips/mips.md	2004-02-27 22:35:08.000000000 +0000
@@ -4351,7 +4351,7 @@ dsrl\t%3,%3,1\n\
    (set_attr "length"	"8,8,8,8,12,*,*,8")])
 
 (define_insn "movdi_internal2"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,e,d,m,*f,*f,*f,*d,*m,*x,*d,*x,*B*C*D,*B*C*D,*d,*m")
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,w,d,m,*f,*f,*f,*d,*m,*x,*d,*x,*B*C*D,*B*C*D,*d,*m")
 	(match_operand:DI 1 "move_operand" "d,U,T,m,dJ,*f,*d*J,*m,*f,*f,*J,*x,*d,*d,*m,*B*C*D,*B*C*D"))]
   "TARGET_64BIT && !TARGET_MIPS16
    && (register_operand (operands[0], DImode)
@@ -4477,7 +4477,7 @@ dsrl\t%3,%3,1\n\
 ;; in FP registers (off by default, use -mdebugh to enable).
 
 (define_insn "movsi_internal"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,e,d,m,*f,*f,*f,*d,*m,*d,*z,*x,*d,*x,*B*C*D,*B*C*D,*d,*m")
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,w,d,m,*f,*f,*f,*d,*m,*d,*z,*x,*d,*x,*B*C*D,*B*C*D,*d,*m")
 	(match_operand:SI 1 "move_operand" "d,U,T,m,dJ,*f,*d*J,*m,*f,*f,*z,*d,J,*x,*d,*d,*m,*B*C*D,*B*C*D"))]
   "!TARGET_MIPS16
    && (register_operand (operands[0], SImode)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]