Skip to content

Commit

Permalink
fix: hintstore and hintbuffer details
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-sun committed Jan 26, 2025
1 parent 27cee79 commit ed8603d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/specs/ISA.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ with user input-output. We use the same notation for `r32{c}(b) := i32([b:4]_1)

| Name | Operands | Description |
| ---------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| HINT_STOREW_RV32 | `_,b,c,1,2` | `[r32{c}(b):4]_2 = next 4 bytes from hint stream`. Only valid if next 4 values in hint stream are bytes. |
| HINT_STOREW_RV32 | `_,b,_,1,2` | `[r32{0}(b):4]_2 = next 4 bytes from hint stream`. Only valid if next 4 values in hint stream are bytes. |
| HINT_BUFFER_RV32 | `a,b,_,1,2` | `[r32{0}(b):4 * l]_2 = next 4 * l bytes from hint stream` where `l = r32{0}(a)`. Only valid if next `4 * l` values in hint stream are bytes. Very important: `l` should not be 0. |
| REVEAL_RV32 | `a,b,c,1,3` | Pseudo-instruction for `STOREW_RV32 a,b,c,1,3` writing to the user IO address space `3`. Only valid when continuations are enabled. |

Expand Down
4 changes: 2 additions & 2 deletions docs/specs/RISCV.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ In addition to the standard RV32IM opcodes, we support the following additional

| RISC-V Inst | FMT | opcode[6:0] | funct3 | imm[0:11] | RISC-V description and notes |
| ----------- | --- | ----------- | ------ | --------- | --------------------------------------------------------------------------------------------------------------------------- |
| hintstorew | I | 0001011 | 001 | 0x0 | Stores next 4-byte word from hint stream in user memory at `[rd]_2`. |
| hintbuffer | I | 0001011 | 001 | 0x1 | Stores next `4 * rs1` bytes from hint stream in user memory at `[rd:4 * rs1]_2`. Here `rs1` must be non-zero to be a valid instruction. |
| hintstorew | I | 0001011 | 001 | 0x0 | Stores next 4-byte word from hint stream in user memory at `[rd]_2`. Only valid if next 4 values in hint stream are bytes. |
| hintbuffer | I | 0001011 | 001 | 0x1 | Stores next `4 * rs1` bytes from hint stream in user memory at `[rd..rd +4 * rs1]_2`. Only valid if next `4 * rs1` values in hint stream are bytes and `rs1` is non-zero. |
| reveal | I | 0001011 | 010 | | Stores the 4-byte word `rs1` at address `rd + imm` in user IO space. |
| hintinput | I | 0001011 | 011 | 0x0 | Pop next vector from input stream and reset hint stream to the vector. |
| printstr | I | 0001011 | 011 | 0x1 | Tries to convert `[rd..rd + rs1]_2` to UTF-8 string and print to host stdout. Will print error message if conversion fails. |
Expand Down

0 comments on commit ed8603d

Please sign in to comment.