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

What is the meaning of this opcode? #80

Open
nikita890-art opened this issue Aug 24, 2021 · 4 comments
Open

What is the meaning of this opcode? #80

nikita890-art opened this issue Aug 24, 2021 · 4 comments

Comments

@nikita890-art
Copy link

mod rd rs1 rs2 31..25=1 14..12=0 6..2=0x1A 1..0=3

I am trying to understand what exactly this sentence means.
I found this line here,
https://nitish2112.github.io/post/adding-instruction-riscv/

what is the purpose of this line?
What is "14..12=0" , "6..2=0x1A" and "1..0=3" ?
What do they do?

@furuame
Copy link
Contributor

furuame commented Aug 24, 2021

They described values of these bitfields.

@nikita890-art
Copy link
Author

why is that they have values 0,0x1A and 3?
And how does that line depict mod operation?
@2henwei

@furuame
Copy link
Contributor

furuame commented Aug 24, 2021

@nikita890-art
This line just describes the encoding of mod instruction, not the functionality.

@nikita890-art
Copy link
Author

nikita890-art commented Aug 24, 2021

oh, then suppose I want to develop an instruction that combines these 3 operations:
srli a5,s7,22
sili a5,a5,2
add s0,s0,a5
where do i describe the functionality?
and also, can I put any random values instead of 0,0x1A and 3?

@2henwei

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