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

End the indirect jump when potential hotspot is detected #371

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

qwe661234
Copy link
Collaborator

Currently, the indirect jump does not switch to T1C when potential hotspot is detected, it would make execution stuck in interpreter mode. This modification make execution end when potential hotspot is detected.

@jserv
Copy link
Contributor

jserv commented Mar 4, 2024

The following code snip appears several times in src/emulate.c and src/rv32_template.c, and can you unify by jumping the label in RVOP?

        rv->csr_cycle = cycle;
        rv->PC = PC;
        return true;

@qwe661234
Copy link
Collaborator Author

The following code snip appears several times in src/emulate.c and src/rv32_template.c, and can you unify by jumping the label in RVOP?

        rv->csr_cycle = cycle;
        rv->PC = PC;
        return true;

However, since this label is within the scope of a function, I can replace them with a MACRO.

@jserv
Copy link
Contributor

jserv commented Mar 4, 2024

However, since this label is within the scope of a function, I can replace them with a MACRO.

That sounds good. The label will be named end_op. The term "op" (operation) is preferred over "insn" (instruction) to clearly differentiate between RISC-V instructions and the IR operations derived from them. Our interpreter specifically manipulates these IR operations, rather than the direct RISC-V instructions.

src/rv32_template.c Outdated Show resolved Hide resolved
src/emulate.c Outdated Show resolved Hide resolved
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrase "This modification make execution end when potential hotspot is detected" to

This revision ensures the execution halts upon identifying a potential hotspot. It aims to make the execution process more efficient by stopping when a significant area of code usage is detected, allowing for targeted optimization.

Currently, the indirect jump does not switch to T1C when potential
hotspot is detected, it would make execution stuck in interpreter mode.
This revision ensures the execution halts upon identifying a potential
hotspot. It aims to make the execution process more efficient by
stopping when a significant area of code usage is detected, allowing
for targeted optimization.
@qwe661234 qwe661234 requested a review from jserv March 7, 2024 08:06
@jserv jserv merged commit b11be60 into sysprog21:master Mar 7, 2024
7 checks passed
@qwe661234 qwe661234 deleted the improve_idj branch March 9, 2024 09:36
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

Successfully merging this pull request may close these issues.

2 participants