This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

x86: Correct register warning messages.


x86_64 support added entries to i386_regtab, and broke some hard-coded
constants.

gas/ChangeLog
	* config/tc-i386.c (md_assemble <REGISTER_WARNINGS>): Correct
	used register name.

include/opcode/ChangeLog
	* i386.h (REGNAM_AL, REGNAM_AX, REGNAM_EAX): Define.

Committing to trunk and branch.

Alan Modra
-- 
Linuxcare

Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.90
diff -u -p -r1.90 tc-i386.c
--- tc-i386.c	2001/03/13 04:37:12	1.90
+++ tc-i386.c	2001/03/19 11:16:47
@@ -1996,7 +1996,10 @@ md_assemble (line)
 		    if (!quiet_warnings
 			&& (i.tm.operand_types[op] & InOutPortReg) == 0)
 		      as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
-			       (i.op[op].regs - (i.types[op] & Reg16 ? 8 : 16))->reg_name,
+			       (i.op[op].regs
+				+ (i.types[op] & Reg16
+				   ? REGNAM_AL - REGNAM_AX
+				   : REGNAM_AL - REGNAM_EAX))->reg_name,
 			       i.op[op].regs->reg_name,
 			       i.suffix);
 #endif
@@ -2046,7 +2049,7 @@ md_assemble (line)
 #if REGISTER_WARNINGS
 		  else
 		    as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
-			     (i.op[op].regs + 8)->reg_name,
+			     (i.op[op].regs + REGNAM_EAX - REGNAM_AX)->reg_name,
 			     i.op[op].regs->reg_name,
 			     i.suffix);
 #endif
@@ -2117,7 +2120,7 @@ md_assemble (line)
 		  else
 #if REGISTER_WARNINGS
 		    as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
-			     (i.op[op].regs - 8)->reg_name,
+			     (i.op[op].regs + REGNAM_AX - REGNAM_EAX)->reg_name,
 			     i.op[op].regs->reg_name,
 			     i.suffix);
 #endif
Index: include/opcode/i386.h
===================================================================
RCS file: /cvs/src/src/include/opcode/i386.h,v
retrieving revision 1.28
diff -u -p -r1.28 i386.h
--- i386.h	2001/03/14 02:27:44	1.28
+++ i386.h	2001/03/19 11:16:51
@@ -1340,6 +1340,7 @@ static const reg_entry i386_regtab[] = {
   /* make %st first as we test for it */
   {"st", FloatReg|FloatAcc, 0, 0},
   /* 8 bit regs */
+#define REGNAM_AL 1		/* Entry in i386_regtab.  */
   {"al", Reg8|Acc, 0, 0},
   {"cl", Reg8|ShiftCount, 0, 1},
   {"dl", Reg8, 0, 2},
@@ -1365,6 +1366,7 @@ static const reg_entry i386_regtab[] = {
   {"r14b", Reg8, RegRex64|RegRex, 6},
   {"r15b", Reg8, RegRex64|RegRex, 7},
   /* 16 bit regs */
+#define REGNAM_AX 25
   {"ax", Reg16|Acc, 0, 0},
   {"cx", Reg16, 0, 1},
   {"dx", Reg16|InOutPortReg, 0, 2},
@@ -1382,6 +1384,7 @@ static const reg_entry i386_regtab[] = {
   {"r14w", Reg16, RegRex, 6},
   {"r15w", Reg16, RegRex, 7},
   /* 32 bit regs */
+#define REGNAM_EAX 41
   {"eax", Reg32|BaseIndex|Acc, 0, 0},  /* Must be in ax + 16 slot */
   {"ecx", Reg32|BaseIndex, 0, 1},
   {"edx", Reg32|BaseIndex, 0, 2},


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