Skip to content

Commit

Permalink
Mark unlikely code paths for vm_pc, vm_insn_count changes
Browse files Browse the repository at this point in the history
  • Loading branch information
onnokort committed Aug 28, 2023
1 parent 60151e4 commit 6013cb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,13 @@ void vm_step(vm_t *vm)

uint8_t* pcl = (uint8_t*)(&_zp_vm_pc);
*pcl+=4;
if (!*pcl) _zp_vm_pc+=256;
if (unlikely(!*pcl)) _zp_vm_pc+=256;

//_zp_vm_pc += 4;
//
uint8_t* icl = (uint8_t*)(&_zp_vm_insn_count);
(*icl)++;
if(!*icl) {
if (unlikely(!*icl)) {
_zp_vm_insn_count+=256;
if (!_zp_vm_insn_count)
_zp_vm_insn_count_hi++;
Expand Down

0 comments on commit 6013cb6

Please sign in to comment.