[decoder] fixed botched j immediate decoding

kernel-mode
Anton Lydike 3 years ago
parent 6351f1e84d
commit 9278235e44

@ -55,12 +55,11 @@ def imm_u(ins: int):
def imm_j(ins: int): def imm_j(ins: int):
imm = ins >> 12
return sign_extend( return sign_extend(
((imm >> 8) & 0b1111111111) + (((ins >> 21) & 0b1111111111) << 1) +
((imm & 1) << 10) + (((ins >> 20) & 1) << 11) +
((imm & 0b11111111) << 11) + (((ins >> 12) & 0b11111111) << 12) +
(imm & 0b10000000000000000000), 20 (((ins >> 31) & 1) << 20), 21
) )

Loading…
Cancel
Save