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]

Patch: Chunking when !CGEN_INT_INSN_P


Hi,

This patch is required for an internal port.  The idea is to enable
proper chunking for endianness conversions during assembly when
CGEN_INT_INSN_P is false.

Please let me know if it's ok to commit.

Thanks,
John


[opcodes]
2001-09-05  John Healy  <jhealy@redhat.com>

        * cgen-ibld.in (insert_1): Use cgen_get_insn_value and
        cgen_put_insn_value instead of bfd_get bits and bfd_set bits.


Index: opcodes/cgen-ibld.in
===================================================================
RCS file: /cvs/cvsfiles/devo/opcodes/cgen-ibld.in,v
retrieving revision 1.16
diff -c -3 -p -r1.16 cgen-ibld.in
*** cgen-ibld.in	2001/08/12 20:02:31	1.16
--- cgen-ibld.in	2001/09/05 19:51:32
*************** 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 */

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