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]

[patch][rfa]: Decoding insns > 32 bits in length


Hi,

The attached patch adresses decoding of insns which are longer than 32
bits.

The patch to opcodes/cgen-ibld.in fixes a problem which was affecting
the fr30 port and an internal port I'm working on. The patch is an
obvious improvement, since 'x' is now at least initialized and decodes
correctly for fr30 and the internal port.

The patch to cgen/utils-gen.scm corrects the length argument in the
generated calls to EXTRACT_MSB0_UINT in <target>-decode.cxx for SID
cpus. The old code looks to be computing the number of bits remaining
the word after the current field, when what is required is the number
of bits from the field which are in the current word. Tested on an
internal port. As far as I can tell, this does not affect any other
ports.

ok to commit these?

Dave
Index: cgen/utils-gen.scm
===================================================================
RCS file: /cvs/cvsfiles/devo/cgen/utils-gen.scm,v
retrieving revision 1.15
diff -c -p -r1.15 utils-gen.scm
*** cgen/utils-gen.scm	2001/01/06 12:06:18	1.15
--- cgen/utils-gen.scm	2001/11/05 22:50:25
***************
*** 136,144 ****
  				       0
  				       (- start word-start)))
  		   ", "
! 		   (number->string (if (< end word-end)
! 				       (- word-end end)
! 				       word-length))
  		   ") << "
  		   (number->string (if (> end word-end)
  				       (- end word-end)
--- 136,144 ----
  				       0
  				       (- start word-start)))
  		   ", "
! 		   (number->string (if (<= end word-end)
! 				       length
! 				       (- word-end start)))
  		   ") << "
  		   (number->string (if (> end word-end)
  				       (- end word-end)
Index: opcodes/cgen-ibld.in
===================================================================
RCS file: /cvs/cvsfiles/devo/opcodes/cgen-ibld.in,v
retrieving revision 1.21
diff -c -p -r1.21 cgen-ibld.in
*** opcodes/cgen-ibld.in	2001/10/13 08:52:56	1.21
--- opcodes/cgen-ibld.in	2001/11/05 22:50:58
*************** extract_1 (cd, ex_info, start, length, w
*** 373,383 ****
  {
    unsigned long x;
    int shift;
- #if 0
-   int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG;
- 
    x = cgen_get_insn_value (cd, bufp, word_length);
- #endif
    if (CGEN_INSN_LSB0_P)
      shift = (start + 1) - length;
    else
--- 373,379 ----

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