riscv-opcodes icon indicating copy to clipboard operation
riscv-opcodes copied to clipboard

What is the meaning of this opcode?

Open nikita890-art opened this issue 4 years ago • 4 comments
trafficstars

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?

nikita890-art avatar Aug 24 '21 08:08 nikita890-art

They described values of these bitfields.

furuame avatar Aug 24 '21 08:08 furuame

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

nikita890-art avatar Aug 24 '21 09:08 nikita890-art

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

furuame avatar Aug 24 '21 09:08 furuame

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

nikita890-art avatar Aug 24 '21 09:08 nikita890-art