Skip to content

Commit ac9c00c

Browse files
authored
Remove "goto quit" (#17)
Since "goto quit" will simply return, removing it avoids jump twice.
1 parent 0c0bc80 commit ac9c00c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

riscv.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ void rv_step(struct riscv_t *rv, int32_t cycles)
13381338
#define DISPATCH() \
13391339
{ \
13401340
if (rv->csr_cycle >= cycles_target || rv->halt) \
1341-
goto quit; \
1341+
return; \
13421342
/* fetch the next instruction */ \
13431343
inst = rv->io.mem_ifetch(rv, rv->PC); \
13441344
/* standard uncompressed instruction */ \
@@ -1356,7 +1356,7 @@ void rv_step(struct riscv_t *rv, int32_t cycles)
13561356
{ \
13571357
/* dispatch this opcode */ \
13581358
if (!op_##instr(rv, inst)) \
1359-
goto quit; \
1359+
return; \
13601360
/* increment the cycles csr */ \
13611361
rv->csr_cycle++; \
13621362
}
@@ -1403,9 +1403,6 @@ void rv_step(struct riscv_t *rv, int32_t cycles)
14031403
#endif
14041404
TARGET(unimp)
14051405

1406-
quit:
1407-
return;
1408-
14091406
#undef DISPATCH_RV32C
14101407
#undef DISPATCH
14111408
#undef EXEC

0 commit comments

Comments
 (0)