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

Again about Zicif #190

Open
haosun86 opened this issue Oct 8, 2024 · 4 comments
Open

Again about Zicif #190

haosun86 opened this issue Oct 8, 2024 · 4 comments

Comments

@haosun86
Copy link

haosun86 commented Oct 8, 2024

Hi,

In last issue link: #186, it seems to explain that:
The 2 16-bit part of one 32-bit instruction need to keep atomicity in the machine: ILEN = 32, XLEN =32, supporting 16-bit instruction.

I want to make sure that this requirement would constrain the following scenario?
Store A (low 16-bit part of 32-bit instruction)
Fence
Store B (high 16-bit part of 32-bit instruction)

If one hart can fetch B, it needs to fetch A? Especially, A and B are located in different cachelines.

Thanks so much
Wish for your reply.

@aswaterman
Copy link
Member

aswaterman commented Oct 8, 2024

No, that is not the requirement. Since those stores are not atomic with respect to each other, it is incorrect to assume their overall effect is atomic. Whether they are on the same cache line is not relevant.

If you want to atomically patch a 32-bit instruction, you need to meet three requirements:

  • Zicif is implemented
  • the instruction is 32-bit-aligned
  • you use a 32-bit store (e.g. sw) to perform the patching

(None of this affects the profiles discussion; it's just a usage scenario for Zicif.)

@haosun86
Copy link
Author

haosun86 commented Oct 8, 2024

Thanks so much for your reply.

Could you please explain more about the usage cases of Zicif?
I am still confused about this extension use cases.

@aswaterman
Copy link
Member

The goal is to support atomic patching of 32-bit-wide instructions, e.g., replacing an expensive instruction with a NOP in some cases, or replacing a JAL with a JAL to a different location. Sorry, I don't have time to elaborate.

@haosun86
Copy link
Author

haosun86 commented Oct 8, 2024

thanks so much

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