Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New G4MH core #37

Open
ikuyas opened this issue Jul 30, 2024 · 3 comments
Open

New G4MH core #37

ikuyas opened this issue Jul 30, 2024 · 3 comments

Comments

@ikuyas
Copy link

ikuyas commented Jul 30, 2024

I'm using "Ghidra processor module for Renesas v850" on RH850/U2A code.
It couldn't disassemble the following binary codes.
0019e018 e9 77 20 10 ldsr param_4,Sr142,2
I made a patch for v850e3.sinc, then it could dissassemble as the above.
But "Sr142" is a temporary name, it should be "PLMR".
According to the "RH850/U2A-EVA Group User’s Manual: Hardware", many system registers were extended in U2A.
Could you please fix them?

@ikuyas ikuyas changed the title New system register in RH850/U2A New G4MH core Jul 30, 2024
@ikuyas
Copy link
Author

ikuyas commented Jul 30, 2024

In G4MH, the following instructions were extended from G3KH, at least
LD.B,LD.BU,LD.H,LD.HU,LD.W,ST.B,ST.H,ST.W
I am using a heuristic way to find the differences, as I cannot find the official documentation where the differences are listed.

@esaulenka
Copy link
Owner

esaulenka commented Jul 30, 2024

Hi!

many system registers were extended

did you find the full list?
In the 'RH850/U2A-EVA Group User’s Manual: Hardware' I see only a few mentions of PLMR, and it's easy to miss some other registers.

I am using a heuristic way

For the RH850 I looked into gcc sources (in particular, objdump). It's much harder to read than official spec (and it has no any explanations what is the purpose of the instruction), but if you will find such gcc branch, it will help a lot.

@ikuyas
Copy link
Author

ikuyas commented Jul 30, 2024

The added system register I found is as follows

selID = 2
Sr14   PLMR
Sr18   RBIP

selID = 5
Sr12   MCI
Sr16   MPIDX
Sr24   MPID0
Sr25   MPID1
Sr26   MPID2
Sr27   MPID3
Sr28   MPID4
Sr29   MPID5
Sr30   MPID6
Sr31   MPID7

selID = 11, 14, 15
P317 in RH850/U2A-EVA Group User’s Manual: Hardware Rev.1.40 Aug. 2023
3.2.3.8 Count Function Registers

The added instructions are:

(3) LD.B [reg1]+, reg3 
(4) LD.B [reg1]−, reg3

(3) LD.BU [reg1]+, reg3 
(4) LD.BU [reg1]−, reg3 

(3) LD.H [reg1]+, reg3 
(4) LD.H [reg1]−, reg3 

(3) LD.HU [reg1]+, reg3
(4) LD.HU [reg1]−, reg3

(3) LD.W [reg1]+ , reg3 
(4) LD.W [reg1]– , reg3

(3) ST.B reg3, [reg1]+ 
(4) ST.B reg3, [reg1]−

(3) ST.H reg3, [reg1]+ 
(4) ST.H reg3, [reg1]−

(3) ST.W reg3, [reg1]+ 
(4) ST.W reg3, [reg1]−

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants