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


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

Chunking For Ports With CGEN_INT_INSN_P = 0


Hi,

I'd like to commit the following patch.  It only affects ports where
CGEN_INT_INSN_P is 0.  Currently that's only the fr30  port.  Testing
showed no regressions.

John


2001-09-28  John Healy  <jhealy@redhat.com>

        * cgen-ibld.in (insert_1): Switched bfd_get_bits and bfd_set_bits
        calls to cgen_get_insn_value and cgen_put_insn_value calls.
        (extract_1): Switched bfd_get_bits call to cgen_get_insn_value call.


Index: opcodes/cgen-ibld.in
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-ibld.in,v
retrieving revision 1.10
diff -c -3 -p -r1.10 cgen-ibld.in
*** cgen-ibld.in	2001/08/12 20:16:29	1.10
--- cgen-ibld.in	2001/09/28 19:36:26
*************** insert_1 (cd, value, start, length, word
*** 78,84 ****
    int shift;
    int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG;
  
!   x = bfd_get_bits (bufp, word_length, big_p);
  
    /* Written this way to avoid undefined behaviour.  */
    mask = (((1L << (length - 1)) - 1) << 1) | 1;
--- 78,84 ----
    int shift;
    int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG;
  
!   x = cgen_get_insn_value (cd, bufp, word_length);
  
    /* Written this way to avoid undefined behaviour.  */
    mask = (((1L << (length - 1)) - 1) << 1) | 1;
*************** insert_1 (cd, value, start, length, word
*** 88,94 ****
      shift = (word_length - (start + length));
    x = (x & ~(mask << shift)) | ((value & mask) << shift);
  
!   bfd_put_bits ((bfd_vma) x, bufp, word_length, big_p);
  }
  
  #endif /* ! CGEN_INT_INSN_P */
--- 88,94 ----
      shift = (word_length - (start + length));
    x = (x & ~(mask << shift)) | ((value & mask) << shift);
  
!   cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
  }
  
  #endif /* ! CGEN_INT_INSN_P */
*************** extract_1 (cd, ex_info, start, length, w
*** 365,371 ****
    int shift;
    int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG;
  
!   x = bfd_get_bits (bufp, word_length, big_p);
  
    if (CGEN_INSN_LSB0_P)
      shift = (start + 1) - length;
--- 365,371 ----
    int shift;
    int big_p = CGEN_CPU_INSN_ENDIAN (cd) == CGEN_ENDIAN_BIG;
  
!   x = cgen_get_insn_value (cd, bufp, word_length);
  
    if (CGEN_INSN_LSB0_P)
      shift = (start + 1) - length;

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