Fix J decode wrong immediate

TODO recheck maybe
master
vhaudiquet 1 year ago
parent 5b020b0444
commit c466d7d175
  1. 2
      src/cpu/rv32cpu.c

@ -68,7 +68,7 @@ static void cpu_decode(raw_instruction_t raw_instruction, instruction_t* output)
// Then following 10 bits (30-21) are immediate bits 10-1 // Then following 10 bits (30-21) are immediate bits 10-1
output->immediate |= (raw_instruction.data & 0x7FE00000) >> 20; output->immediate |= (raw_instruction.data & 0x7FE00000) >> 20;
// Following bit (20) is immediate bit 11 // Following bit (20) is immediate bit 11
output->immediate |= (raw_instruction.data & 0x200000) >> 10; output->immediate |= (raw_instruction.data & 0x200000) >> 9;
// Last bits (19-12) are immediate bits 19-12 // Last bits (19-12) are immediate bits 19-12
output->immediate |= (raw_instruction.data & 0xFF000); output->immediate |= (raw_instruction.data & 0xFF000);
break; break;

Loading…
Cancel
Save