1
votes

I am following the gem5 to add the custom instruction. My question is how to the interpret operands mentioned in "const struct riscv_opcode riscv_opcodes[]" in riscv-opc.h. For an example : {"mod", "I", "d,s,t", MATCH_MOD, MASK_MOD, match_opcode, 0 } .how "d,s,t" are interpret here? Can anyone explain the this whole statement

refLink :https://nitish2112.github.io/post/adding-instruction-riscv/

1

1 Answers

1
votes

According to the comment at the top of the array describing the instructions : /* name, isa, operands, match, mask, match_func, pinfo. */

The line says that {"mod", "I", "d,s,t",

mod belongs to the Integer ISA and that it is a triadic instruction, meaning that it takes 3 registers whose symbolic names are d,s,t. d being the destination register, s and t being source registers.