[PATCH V2 0/3] Improve insn endianness support in CGEN ports

Jose E. Marchesi jose.marchesi@oracle.com
Tue Jun 2 14:23:13 GMT 2020


[Changes from V1:
- Rebased to latest master.
- Typo fixed in ChangeLog entry.
- Use the latest cgen to regenerate files.
- Use insn_endian in both gas/cgen.c and gas/config/tc-mep.c]

Hi people!

This patch series improves the support for CGEN-based architectures
having different data endianness and instruction endianness.  This is
the case of the BPF port.

The first patch adds support for a new argument for cgen_cpu_open,
that ports can use in order to specify an instruction endianness.  If
the argument is not provided then the instruction endianness is
assumed to be the general endian.  This patch depends on a CGEN patch
that should be applied simultaneously, and that has been pre-approved
upstream already.  See the patch description for more information.

The second patch adapts the opcodes CGEN support code in order to use
the right endianness parameter (instruction or data) depending on
whether it is reading/writing instruction opcodes or the contents of
instruction operands.  See the patch description for more information.

The third patch is specific to the BPF port, and removes some
workarounds that are no longer necessary, because the underlying
problem has been solved by this series.

The series has been regression-tested in the following targets, which
cover both cgen and non-cgen ports:

  i386-darwin i386-lynxos i586-linux i686-nacl i686-pc-beos
  i686-pc-elf i686-pe i686-vxworks x86_64-linux x86_64-w64-mingw32
  x86_64-nacl sparc-aout sparc-linux sparc-vxworks sparc64-linux
  sparc-sun-solaris2.12 mips-linux mips-vxworks mips64-linux
  mipsel-linux-gnu mipsisa32el-linux mips64-openbsd mipstx39-elf
  aarch64-linux arm-linuxeabi arm-nacl arm-netbsdelf arm-nto arm-pe
  arm-symbianelf arm-vxworks arm-wince-pe bpf-unknown-none
  alpha-dec-vms alpha-linux alpha-linuxecoff alpha-netbsd
  alpha-unknown-freebsd4.7 am33_2.0-linux arc-linux-uclibc avr-elf
  bfin-elf cr16-elf cris-elf crisv32-linux crx-elf d10v-elf d30v-elf
  dlx-elf epiphany-elf fr30-elf frv-elf frv-linux ft32-elf h8300-elf
  hppa-linux hppa-hp-hpux10 hppa64-hp-hpux11.23 hppa64-linux
  $MIPS_TARGETS ia64-elf ia64-freebsd5 ia64-hpux ia64-linux
  ia64-netbsd ia64-vms ip2k-elf iq2000-elf lm32-elf m32c-elf m32r-elf
  m68hc11-elf m68hc12-elf m68k-elf m68k-linux m68k-netbsd mcore-elf
  mcore-pe mep-elf metag-linux microblaze-elf $MIPS_TARGETS mmix
  mn10200-elf mn10300-elf moxie-elf ms1-elf msp430-elf mt-elf
  nds32le-elf nios2-linux or1k-elf pdp11-dec-aout pj-elf
  powerpc-eabisim powerpc-eabivle powerpc-linux powerpc-nto
  powerpc-wrs-vxworks powerpc64-linux powerpcle-cygwin powerpcle-elf
  powerpc64le-linux ppc-lynxos pru-elf riscv32-elf riscv64-elf
  rl78-elf rs6000-aix4.3.3 rs6000-aix5.1 rx-elf s390-linux s390x-linux
  score-elf sh-linux sh-nto sh-pe sh-rtems sh-vxworks
  shl-unknown-netbsdelf $SPARC_TARGETS spu-elf tic30-unknown-aout
  tic30-unknown-coff tic4x-coff tic54x-coff tic6x-elf tilegx-linux
  tilepro-linux v850-elf vax-netbsdelf visium-elf $X86_TARGETS
  xgate-elf xstormy16-elf xtensa-elf z8k-coff z80-coff

No regressions observed.
This has also been tested with --enable-targets=all.

Salud!

Jose E. Marchesi (3):
  opcodes: support insn endianness in cgen_cpu_open
  opcodes: discriminate endianness and insn-endianness in CGEN ports
  cpu,gas,opcodes: remove no longer needed workaround from the BPF port

 binutils/ChangeLog       |  6 +++
 binutils/objdump.c       |  2 +
 cpu/ChangeLog            | 10 +++++
 cpu/bpf.cpu              | 10 ++---
 cpu/bpf.opc              |  1 -
 cpu/mep.opc              |  2 +-
 gas/ChangeLog            | 17 ++++++++
 gas/cgen.c               |  9 +++--
 gas/config/tc-bpf.c      |  9 ++---
 gas/config/tc-mep.c      |  2 +-
 include/ChangeLog        | 10 +++++
 include/opcode/cgen.h    | 11 +++++-
 opcodes/ChangeLog        | 84 ++++++++++++++++++++++++++++++++++++++++
 opcodes/bpf-desc.c       | 16 ++++----
 opcodes/bpf-dis.c        | 10 ++++-
 opcodes/bpf-ibld.c       | 10 ++---
 opcodes/bpf-opc.c        | 48 +++++++++++------------
 opcodes/cgen-dis.in      |  9 ++++-
 opcodes/cgen-ibld.in     | 10 ++---
 opcodes/cgen-opc.c       | 18 +++++----
 opcodes/disassemble.c    |  1 +
 opcodes/epiphany-desc.c  | 12 +++---
 opcodes/epiphany-dis.c   |  9 ++++-
 opcodes/epiphany-ibld.c  | 10 ++---
 opcodes/fr30-desc.c      | 12 +++---
 opcodes/fr30-dis.c       |  9 ++++-
 opcodes/fr30-ibld.c      | 10 ++---
 opcodes/frv-desc.c       | 12 +++---
 opcodes/frv-dis.c        |  9 ++++-
 opcodes/frv-ibld.c       | 10 ++---
 opcodes/ip2k-desc.c      | 12 +++---
 opcodes/ip2k-dis.c       |  9 ++++-
 opcodes/ip2k-ibld.c      | 10 ++---
 opcodes/iq2000-desc.c    | 12 +++---
 opcodes/iq2000-dis.c     |  9 ++++-
 opcodes/iq2000-ibld.c    | 10 ++---
 opcodes/lm32-desc.c      | 12 +++---
 opcodes/lm32-dis.c       |  9 ++++-
 opcodes/lm32-ibld.c      | 10 ++---
 opcodes/m32c-desc.c      | 12 +++---
 opcodes/m32c-dis.c       |  9 ++++-
 opcodes/m32c-ibld.c      | 10 ++---
 opcodes/m32r-desc.c      | 12 +++---
 opcodes/m32r-dis.c       |  9 ++++-
 opcodes/m32r-ibld.c      | 10 ++---
 opcodes/mep-desc.c       | 12 +++---
 opcodes/mep-dis.c        | 11 +++++-
 opcodes/mep-ibld.c       | 10 ++---
 opcodes/mt-desc.c        | 12 +++---
 opcodes/mt-dis.c         |  9 ++++-
 opcodes/mt-ibld.c        | 10 ++---
 opcodes/or1k-desc.c      | 12 +++---
 opcodes/or1k-dis.c       |  9 ++++-
 opcodes/or1k-ibld.c      | 10 ++---
 opcodes/xc16x-desc.c     | 12 +++---
 opcodes/xc16x-dis.c      |  9 ++++-
 opcodes/xc16x-ibld.c     | 10 ++---
 opcodes/xstormy16-desc.c | 12 +++---
 opcodes/xstormy16-dis.c  |  9 ++++-
 opcodes/xstormy16-ibld.c | 10 ++---
 60 files changed, 485 insertions(+), 215 deletions(-)

-- 
2.25.0.2.g232378479e



More information about the Binutils mailing list