Skip to content

Commit 9225e3b

Browse files
committed
wip
1 parent ee072a9 commit 9225e3b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/decode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ static inline bool op_mvx(rv_insn_t *ir, const uint32_t insn) {}
19591959
static inline bool op_v(rv_insn_t *ir, const uint32_t insn)
19601960
{
19611961
uint32_t funct3_mask = 0x7000;
1962-
switch (insn & funct3_mask) {
1962+
switch ((insn & funct3_mask) >> 7) {
19631963
case 0:
19641964
return op_ivv(ir, insn);
19651965
case 1:

src/riscv.h

+4
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ typedef struct {
550550
*/
551551
uint32_t args_offset_size;
552552

553+
/* The max bits that RVV a single instruction can process
554+
*/
555+
uint16_t vlen;
556+
553557
/* arguments of emulation program */
554558
int argc;
555559
char **argv;

src/riscv_private.h

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ struct riscv_internal {
135135
uint32_t csr_fcsr;
136136
#endif
137137

138+
#if RV32_HAS(EXT_RVV)
139+
uint8_t vl; /* current vl size */
140+
#endif
141+
138142
/* csr registers */
139143
uint64_t csr_cycle; /* Machine cycle counter */
140144
uint32_t csr_time[2]; /* Performance counter */

0 commit comments

Comments
 (0)