+2020-06-02 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * mep.opc (print_slot_insn): Pass the insn endianness to
+ cgen_get_insn_value.
+
2020-05-28 Jose E. Marchesi <jose.marchesi@oracle.com>
David Faust <david.faust@oracle.com>
CGEN_INSN_INT insn_value;
CGEN_EXTRACT_INFO ex_info;
- insn_value = cgen_get_insn_value (cd, buf, 32);
+ insn_value = cgen_get_insn_value (cd, buf, 32, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
read_insn, since the incoming buffer is already read (and possibly
+2020-06-04 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * cgen.c (gas_cgen_finish_insn): Pass the endianness to
+ cgen_put_insn_value.
+ (gas_cgen_md_apply_fix): Likewise.
+ (gas_cgen_md_apply_fix): Likewise.
+ * config/tc-bpf.c (md_apply_fix): Pass data endianness to
+ cgen_put_insn_value.
+ * config/tc-mep.c (mep_check_ivc2_scheduling): Pass endianness to
+ cgen_put_insn_value.
+
2020-06-04 Alan Modra <amodra@gmail.com>
* testsuite/config/default.exp: Remove global directive outside
/* If we're recording insns as numbers (rather than a string of bytes),
target byte order handling is deferred until now. */
#if CGEN_INT_INSN_P
- cgen_put_insn_value (gas_cgen_cpu_desc, (unsigned char *) f, length, *buf);
+ cgen_put_insn_value (gas_cgen_cpu_desc, (unsigned char *) f, length, *buf,
+ gas_cgen_cpu_desc->insn_endian);
#else
memcpy (f, buf, byte_len);
#endif
{
CGEN_INSN_INT insn_value =
cgen_get_insn_value (cd, (unsigned char *) where,
- CGEN_INSN_BITSIZE (insn));
+ CGEN_INSN_BITSIZE (insn),
+ cd->insn_endian);
/* ??? 0 is passed for `pc'. */
errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields,
&insn_value, (bfd_vma) 0);
cgen_put_insn_value (cd, (unsigned char *) where,
- CGEN_INSN_BITSIZE (insn), insn_value);
+ CGEN_INSN_BITSIZE (insn), insn_value,
+ cd->insn_endian);
}
#else
/* ??? 0 is passed for `pc'. */
this code is executed only once per instruction. */
where = fixP->fx_frag->fr_literal + fixP->fx_where;
cgen_put_insn_value (gas_cgen_cpu_desc, (unsigned char *) where + 1, 8,
- target_big_endian ? 0x01 : 0x10);
+ target_big_endian ? 0x01 : 0x10,
+ gas_cgen_cpu_desc->endian);
/* Fallthrough. */
case BPF_OPERAND_DISP16:
/* The PC-relative displacement fields in jump instructions
#if CGEN_INT_INSN_P
cgen_put_insn_value (gas_cgen_cpu_desc, (unsigned char *) temp, 32,
- m->buffer[0]);
+ m->buffer[0], gas_cgen_cpu_desc->insn_endian);
#else
memcpy (temp, m->buffer, byte_len);
#endif
+2020-06-04 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * opcode/cgen.h: Get an `endian' argument in both
+ cgen_get_insn_value and cgen_put_insn_value.
+
2020-06-04 Jose E. Marchesi <jemarch@gnu.org>
* opcode/cgen.h (enum cgen_cpu_open_arg): New value
/* Cover fns to bfd_get/set. */
extern CGEN_INSN_INT cgen_get_insn_value
- (CGEN_CPU_DESC, unsigned char *, int);
+ (CGEN_CPU_DESC, unsigned char *, int, int);
extern void cgen_put_insn_value
- (CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT);
+ (CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT, int);
extern CGEN_INSN_INT cgen_get_base_insn_value
(CGEN_CPU_DESC, unsigned char *, int);
+2020-06-03 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * cgen-opc.c (cgen_get_insn_value): Get an `endian' argument.
+ (cgen_put_insn_value): Likewise.
+ (cgen_lookup_insn): Pass endianness to cgen_{get,put}_insn_value.
+ * cgen-dis.in (print_insn): Likewise.
+ * cgen-ibld.in (insert_1): Likewise.
+ (insert_1): Likewise.
+ (insert_insn_normal): Likewise.
+ (extract_1): Likewise.
+ * bpf-dis.c: Regenerate.
+ * bpf-ibld.c: Likewise.
+ * bpf-ibld.c: Likewise.
+ * cgen-dis.in: Likewise.
+ * cgen-ibld.in: Likewise.
+ * cgen-opc.c: Likewise.
+ * epiphany-dis.c: Likewise.
+ * epiphany-ibld.c: Likewise.
+ * fr30-dis.c: Likewise.
+ * fr30-ibld.c: Likewise.
+ * frv-dis.c: Likewise.
+ * frv-ibld.c: Likewise.
+ * ip2k-dis.c: Likewise.
+ * ip2k-ibld.c: Likewise.
+ * iq2000-dis.c: Likewise.
+ * iq2000-ibld.c: Likewise.
+ * lm32-dis.c: Likewise.
+ * lm32-ibld.c: Likewise.
+ * m32c-dis.c: Likewise.
+ * m32c-ibld.c: Likewise.
+ * m32r-dis.c: Likewise.
+ * m32r-ibld.c: Likewise.
+ * mep-dis.c: Likewise.
+ * mep-ibld.c: Likewise.
+ * mt-dis.c: Likewise.
+ * mt-ibld.c: Likewise.
+ * or1k-dis.c: Likewise.
+ * or1k-ibld.c: Likewise.
+ * xc16x-dis.c: Likewise.
+ * xc16x-ibld.c: Likewise.
+ * xstormy16-dis.c: Likewise.
+ * xstormy16-ibld.c: Likewise.
+
2020-06-04 Jose E. Marchesi <jemarch@gnu.org>
* cgen-dis.in (cpu_desc_list): New field `insn_endian'.
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Cover function to read and properly byteswap an insn value. */
CGEN_INSN_INT
-cgen_get_insn_value (CGEN_CPU_DESC cd, unsigned char *buf, int length)
+cgen_get_insn_value (CGEN_CPU_DESC cd, unsigned char *buf, int length,
+ int endian)
{
- int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
+ int big_p = (endian == CGEN_ENDIAN_BIG);
int insn_chunk_bitsize = cd->insn_chunk_bitsize;
CGEN_INSN_INT value = 0;
}
else
{
- value = bfd_get_bits (buf, length, cd->insn_endian == CGEN_ENDIAN_BIG);
+ value = bfd_get_bits (buf, length, endian == CGEN_ENDIAN_BIG);
}
return value;
cgen_put_insn_value (CGEN_CPU_DESC cd,
unsigned char *buf,
int length,
- CGEN_INSN_INT value)
+ CGEN_INSN_INT value,
+ int endian)
{
- int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
+ int big_p = (endian == CGEN_ENDIAN_BIG);
int insn_chunk_bitsize = cd->insn_chunk_bitsize;
if (insn_chunk_bitsize != 0 && insn_chunk_bitsize < length)
{
info = NULL;
insn_bytes_value = (unsigned char *) xmalloc (cd->max_insn_bitsize / 8);
- cgen_put_insn_value (cd, insn_bytes_value, length, insn_int_value);
+ cgen_put_insn_value (cd, insn_bytes_value, length, insn_int_value,
+ cd->insn_endian);
}
else
{
ex_info.dis_info = NULL;
ex_info.insn_bytes = insn_bytes_value;
ex_info.valid = -1;
- insn_int_value = cgen_get_insn_value (cd, insn_bytes_value, length);
+ insn_int_value = cgen_get_insn_value (cd, insn_bytes_value, length,
+ cd->insn_endian);
}
if (!insn)
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
CGEN_INSN_INT insn_value;
CGEN_EXTRACT_INFO ex_info;
- insn_value = cgen_get_insn_value (cd, buf, 32);
+ insn_value = cgen_get_insn_value (cd, buf, 32, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
read_insn, since the incoming buffer is already read (and possibly
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
/* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
basesize = cd->base_insn_bitsize < buflen * 8 ?
cd->base_insn_bitsize : buflen * 8;
- insn_value = cgen_get_insn_value (cd, buf, basesize);
+ insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
/* Fill in ex_info fields like read_insn would. Don't actually call
unsigned long x,mask;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
mask = (((1L << (length - 1)) - 1) << 1) | 1;
shift = (word_length - (start + length));
x = (x & ~(mask << shift)) | ((value & mask) << shift);
- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian);
}
#endif /* ! CGEN_INT_INSN_P */
#else
cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
- (unsigned) CGEN_FIELDS_BITSIZE (fields)),
- value);
+ (unsigned) CGEN_FIELDS_BITSIZE (fields)),
+ value, cd->insn_endian);
#endif /* ! CGEN_INT_INSN_P */
unsigned long x;
int shift;
- x = cgen_get_insn_value (cd, bufp, word_length);
+ x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;