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]
Other format: [Raw text]

[applied mips patch] one last mips32r2 style fixup.


One last mips32r2 style fixup.  (i was waiting for my other mips-dis.c
print_insn_args() change to go in before putting this in, which is why
it didn't go in w/ the other m32r2 fixes earlier.)  Applied as
"obvious."

The new code is a bit easier to read, plus does the better thing of
using +A to calculate the LSB for the calculation in +B.  Mmm, the
benefits of doing all the operands in one fn call.  8-)

Tested as usual.


cgd
==
[ opdoces/ChangeLog]
2003-01-02  Chris Demetriou  <cgd@broadcom.com>

	* mips-dis.c (print_insn_args): Use position extracted by "+A"
	to calculate size for "+B".  Redo code for "+C" so it shares
	the same style as "+A" and "+B" now do.

Index: mips-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/mips-dis.c,v
retrieving revision 1.39
diff -u -p -r1.39 mips-dis.c
--- mips-dis.c	2 Jan 2003 21:07:00 -0000	1.39
+++ mips-dis.c	2 Jan 2003 21:58:47 -0000
@@ -672,6 +672,9 @@ print_insn_args (d, l, pc, info)
      struct disassemble_info *info;
 {
   int op, delta;
+  unsigned int lsb, msb, msbd;
+
+  lsb = 0;
 
   for (; *d != '\0'; d++)
     {
@@ -697,21 +700,18 @@ print_insn_args (d, l, pc, info)
 	      return;
 
 	    case 'A':
-	      (*info->fprintf_func) (info->stream, "0x%x",
-				     (l >> OP_SH_SHAMT) & OP_MASK_SHAMT);
+	      lsb = (l >> OP_SH_SHAMT) & OP_MASK_SHAMT;
+	      (*info->fprintf_func) (info->stream, "0x%x", lsb);
 	      break;
 	
 	    case 'B':
-	      (*info->fprintf_func) (info->stream, "0x%x",
-				     (((l >> OP_SH_INSMSB) & OP_MASK_INSMSB)
-				      - ((l >> OP_SH_SHAMT) & OP_MASK_SHAMT)
-				      + 1));
+	      msb = (l >> OP_SH_INSMSB) & OP_MASK_INSMSB;
+	      (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1);
 	      break;
 
 	    case 'C':
-	      (*info->fprintf_func) (info->stream, "0x%x",
-				     (((l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD)
-				      + 1));
+	      msbd = (l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD;
+	      (*info->fprintf_func) (info->stream, "0x%x", msbd + 1);
 	      break;
 
 	    case 'D':




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