Skip to content

target-mips: add mips16 support

Nathan Froyd qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 1 replyIn review
  2. v111 patches 6 repliesSuperseded

Changes in v2 from the cover letter

Fixed bug preventing Linux boot
Fixed usermode compilation error
Fixed confusion of delay slot size vs. branch size
Fixed bugs in PC-relative loads and adds
Moved mode bit from ISAMode field to hflags
Implemented extended I64 opcodes
Implemented LDPC instruction
Implemented DADDIUPC
64-bit MIPS16 instructions cause RI exceptions when not running in 64-bit mode

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11target-mips: add new HFLAGs for JALX and 16/32-bit delay slotstarget-mips/cpu.h+28 -190 replies
2/11target-mips: change interrupt bits to be mips16-awaretarget-mips/helper.c target-mips/op_helper.c+44 -240 replies
3/11target-mips: move ROTR and ROTRV inside gen_shift_{imm, }target-mips/translate.c+148 -1390 replies
4/11target-mips: make gen_compute_branch 16/32-bit-awaretarget-mips/translate.c+8 -70 replies
5/11target-mips: add gen_base_offset_addrtarget-mips/translate.c+16 -241 reply
6/11target-mips: split out delay slot handlingtarget-mips/translate.c+79 -550 replies
7/11target-mips: add enums for MIPS16 opcodestarget-mips/translate.c+112 -00 replies
8/11target-mips: add mips16 instruction decodingtarget-mips/translate.c+1063 -90 replies
9/11gdbstub: add MIPS16 supportgdbstub.c+15 -30 replies
10/11target-mips: add copyright notice for mips16 worktarget-mips/TODO target-mips/translate.c+1 -10 replies
11/11target-mips: set Config1.CA for MIPS16-aware CPUstarget-mips/translate_init.c+18 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/11] target-mips: add mips16 support

This patchset adds MIPS16 support to the MIPS backend. MIPS16 is a compact encoding of a subset of the MIPS integer instructions, similar to ARM's Thumb mode. Mode switching occurs when either a special instruction (JALX) is executed, or when a jump-to-register instruction is executed; the instruction mode for the target PC is indicated by the low bit of the register.

The patches have been tested with GCC's testsuite and GDB's testsuite.

Changes from v1:
Fixed bug preventing Linux boot
Fixed usermode compilation error
Fixed confusion of delay slot size vs. branch size
Fixed bugs in PC-relative loads and adds
Moved mode bit from ISAMode field to hflags
Implemented extended I64 opcodes
Implemented LDPC instruction
Implemented DADDIUPC
64-bit MIPS16 instructions cause RI exceptions when not running in 64-bit mode

    (This is required; see section 1.5 of MIPS16e 64-bit spec: MD00077.)

Deleted MIPS16 ASE from TODO
Flipped Config1.CA bit for appropriate CPUs

-Nathan