mbox series

[RFC,0/3] MIPS decodetree conversion attempt

Message ID 20220921124105.3824962-1-jiaxun.yang@flygoat.com (mailing list archive)
Headers show
Series MIPS decodetree conversion attempt | expand

Message

Jiaxun Yang Sept. 21, 2022, 12:41 p.m. UTC
Hi,

This is my attempt of converting MIPS translation code into decodetree.

Currently only MIPS I to MIPS Release 5 arithmatic functions are converted.
Old decoding functions are perserved in codebase for now due to dependencies
from microMIPS/nanoMIPS translation code. Will remove them after dealing with
release 6.

Both instruction encoding and test cases are generated form MIPS's internal
architecture validation tools so they are gureented to be correct.

Thanks.

- Jiaxun

Jiaxun Yang (3):
  target/mips: Introduce register access helper functions
  target/mips: Convert legacy arithmatic instructions to decodetree
  tests/tcg/mips: Add mips32 arithmatic instruction test cases

 target/mips/tcg/insn_trans/trans_arith.c.inc  | 352 ++++++++++++++++++
 target/mips/tcg/legacy.decode                 |  62 +++
 target/mips/tcg/meson.build                   |   1 +
 target/mips/tcg/translate.c                   | 143 ++++++-
 target/mips/tcg/translate.h                   |  54 +++
 tests/tcg/mips/include/test_utils_32.h        |  75 ++++
 .../tcg/mips/user/isa/mips32/arithmatic/add.c |  99 +++++
 .../mips/user/isa/mips32/arithmatic/addi.c    |  70 ++++
 .../mips/user/isa/mips32/arithmatic/addiu.c   |  90 +++++
 .../mips/user/isa/mips32/arithmatic/addu.c    | 125 +++++++
 .../tcg/mips/user/isa/mips32/arithmatic/div.c |  81 ++++
 .../mips/user/isa/mips32/arithmatic/divu.c    |  78 ++++
 .../mips/user/isa/mips32/arithmatic/madd.c    |  79 ++++
 .../mips/user/isa/mips32/arithmatic/maddu.c   |  78 ++++
 .../mips/user/isa/mips32/arithmatic/msub.c    |  78 ++++
 .../mips/user/isa/mips32/arithmatic/msubu.c   |  78 ++++
 .../tcg/mips/user/isa/mips32/arithmatic/mul.c |  78 ++++
 .../mips/user/isa/mips32/arithmatic/mult.c    |  78 ++++
 .../mips/user/isa/mips32/arithmatic/multu.c   |  78 ++++
 .../tcg/mips/user/isa/mips32/arithmatic/slt.c |  61 +++
 .../mips/user/isa/mips32/arithmatic/slti.c    |  48 +++
 .../mips/user/isa/mips32/arithmatic/sltiu.c   |  48 +++
 .../mips/user/isa/mips32/arithmatic/sltu.c    |  61 +++
 .../tcg/mips/user/isa/mips32/arithmatic/sub.c | 104 ++++++
 .../mips/user/isa/mips32/arithmatic/subu.c    | 108 ++++++
 25 files changed, 2206 insertions(+), 1 deletion(-)
 create mode 100644 target/mips/tcg/insn_trans/trans_arith.c.inc
 create mode 100644 target/mips/tcg/legacy.decode
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/add.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/addi.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/addiu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/addu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/div.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/divu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/madd.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/maddu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/msub.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/msubu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/mul.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/mult.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/multu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/slt.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/slti.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/sltiu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/sltu.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/sub.c
 create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/subu.c

Comments

Jiaxun Yang Sept. 26, 2022, 2:44 p.m. UTC | #1
> 2022年9月21日 13:41,Jiaxun Yang <jiaxun.yang@flygoat.com> 写道:
> 
> Hi,
> 
> This is my attempt of converting MIPS translation code into decodetree.
> 
> Currently only MIPS I to MIPS Release 5 arithmatic functions are converted.
> Old decoding functions are perserved in codebase for now due to dependencies
> from microMIPS/nanoMIPS translation code. Will remove them after dealing with
> release 6.
> 
> Both instruction encoding and test cases are generated form MIPS's internal
> architecture validation tools so they are gureented to be correct.

A kindly ping :-)

Will send v1 tomorrow if no objection.

Thanks
- Jiaxun

> 
> Thanks.
> 
> - Jiaxun
> 
> Jiaxun Yang (3):
>  target/mips: Introduce register access helper functions
>  target/mips: Convert legacy arithmatic instructions to decodetree
>  tests/tcg/mips: Add mips32 arithmatic instruction test cases
> 
> target/mips/tcg/insn_trans/trans_arith.c.inc  | 352 ++++++++++++++++++
> target/mips/tcg/legacy.decode                 |  62 +++
> target/mips/tcg/meson.build                   |   1 +
> target/mips/tcg/translate.c                   | 143 ++++++-
> target/mips/tcg/translate.h                   |  54 +++
> tests/tcg/mips/include/test_utils_32.h        |  75 ++++
> .../tcg/mips/user/isa/mips32/arithmatic/add.c |  99 +++++
> .../mips/user/isa/mips32/arithmatic/addi.c    |  70 ++++
> .../mips/user/isa/mips32/arithmatic/addiu.c   |  90 +++++
> .../mips/user/isa/mips32/arithmatic/addu.c    | 125 +++++++
> .../tcg/mips/user/isa/mips32/arithmatic/div.c |  81 ++++
> .../mips/user/isa/mips32/arithmatic/divu.c    |  78 ++++
> .../mips/user/isa/mips32/arithmatic/madd.c    |  79 ++++
> .../mips/user/isa/mips32/arithmatic/maddu.c   |  78 ++++
> .../mips/user/isa/mips32/arithmatic/msub.c    |  78 ++++
> .../mips/user/isa/mips32/arithmatic/msubu.c   |  78 ++++
> .../tcg/mips/user/isa/mips32/arithmatic/mul.c |  78 ++++
> .../mips/user/isa/mips32/arithmatic/mult.c    |  78 ++++
> .../mips/user/isa/mips32/arithmatic/multu.c   |  78 ++++
> .../tcg/mips/user/isa/mips32/arithmatic/slt.c |  61 +++
> .../mips/user/isa/mips32/arithmatic/slti.c    |  48 +++
> .../mips/user/isa/mips32/arithmatic/sltiu.c   |  48 +++
> .../mips/user/isa/mips32/arithmatic/sltu.c    |  61 +++
> .../tcg/mips/user/isa/mips32/arithmatic/sub.c | 104 ++++++
> .../mips/user/isa/mips32/arithmatic/subu.c    | 108 ++++++
> 25 files changed, 2206 insertions(+), 1 deletion(-)
> create mode 100644 target/mips/tcg/insn_trans/trans_arith.c.inc
> create mode 100644 target/mips/tcg/legacy.decode
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/add.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/addi.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/addiu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/addu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/div.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/divu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/madd.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/maddu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/msub.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/msubu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/mul.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/mult.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/multu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/slt.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/slti.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/sltiu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/sltu.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/sub.c
> create mode 100644 tests/tcg/mips/user/isa/mips32/arithmatic/subu.c
> 
> -- 
> 2.34.1
> 

---
Jiaxun Yang
Philippe Mathieu-Daudé Sept. 26, 2022, 9:35 p.m. UTC | #2
Hi Jiaxun,

On Mon, Sep 26, 2022 at 4:44 PM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
> > 2022年9月21日 13:41,Jiaxun Yang <jiaxun.yang@flygoat.com> 写道:
> >
> > Hi,
> >
> > This is my attempt of converting MIPS translation code into decodetree.
> >
> > Currently only MIPS I to MIPS Release 5 arithmatic functions are converted.
> > Old decoding functions are perserved in codebase for now due to dependencies
> > from microMIPS/nanoMIPS translation code. Will remove them after dealing with
> > release 6.
> >
> > Both instruction encoding and test cases are generated form MIPS's internal
> > architecture validation tools so they are gureented to be correct.
>
> A kindly ping :-)
>
> Will send v1 tomorrow if no objection.

Thanks for this work! On a first pass it looks good, but I'd like to
spend more time reviewing in the next few days. What did you change
between RFC->v1?
Jiaxun Yang Sept. 27, 2022, 10:33 a.m. UTC | #3
> 2022年9月26日 22:35,Philippe Mathieu-Daudé <f4bug@amsat.org> 写道:
> 
> Hi Jiaxun,
> 
> On Mon, Sep 26, 2022 at 4:44 PM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>>> 2022年9月21日 13:41,Jiaxun Yang <jiaxun.yang@flygoat.com> 写道:
>>> 
>>> Hi,
>>> 
>>> This is my attempt of converting MIPS translation code into decodetree.
>>> 
>>> Currently only MIPS I to MIPS Release 5 arithmatic functions are converted.
>>> Old decoding functions are perserved in codebase for now due to dependencies
>>> from microMIPS/nanoMIPS translation code. Will remove them after dealing with
>>> release 6.
>>> 
>>> Both instruction encoding and test cases are generated form MIPS's internal
>>> architecture validation tools so they are gureented to be correct.
>> 
>> A kindly ping :-)
>> 
>> Will send v1 tomorrow if no objection.
> 
> Thanks for this work! On a first pass it looks good, but I'd like to
> spend more time reviewing in the next few days. What did you change
> between RFC->v1?

Nothing much, just tidy up test cases a little bit.

Thanks.
---
Jiaxun Yang
Jiaxun Yang Oct. 6, 2022, 1:37 p.m. UTC | #4
> 2022年9月27日 11:33,Jiaxun Yang <jiaxun.yang@flygoat.com> 写道:
> 
> 
> 
>> 2022年9月26日 22:35,Philippe Mathieu-Daudé <f4bug@amsat.org> 写道:
>> 
>> Hi Jiaxun,
>> 
>> On Mon, Sep 26, 2022 at 4:44 PM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>>>> 2022年9月21日 13:41,Jiaxun Yang <jiaxun.yang@flygoat.com> 写道:
>>>> 
>>>> Hi,
>>>> 
>>>> This is my attempt of converting MIPS translation code into decodetree.
>>>> 
>>>> Currently only MIPS I to MIPS Release 5 arithmatic functions are converted.
>>>> Old decoding functions are perserved in codebase for now due to dependencies
>>>> from microMIPS/nanoMIPS translation code. Will remove them after dealing with
>>>> release 6.
>>>> 
>>>> Both instruction encoding and test cases are generated form MIPS's internal
>>>> architecture validation tools so they are gureented to be correct.
>>> 
>>> A kindly ping :-)
>>> 
>>> Will send v1 tomorrow if no objection.
>> 
>> Thanks for this work! On a first pass it looks good, but I'd like to
>> spend more time reviewing in the next few days. What did you change
>> between RFC->v1?
> 
> Nothing much, just tidy up test cases a little bit.

Any inputs?

Thanks.

> 
> Thanks.
> ---
> Jiaxun Yang
> 
> 

---
Jiaxun Yang