[decoder] fixed botched j immediate decoding
This commit is contained in:
parent
6351f1e84d
commit
9278235e44
@ -55,12 +55,11 @@ def imm_u(ins: int):
|
||||
|
||||
|
||||
def imm_j(ins: int):
|
||||
imm = ins >> 12
|
||||
return sign_extend(
|
||||
((imm >> 8) & 0b1111111111) +
|
||||
((imm & 1) << 10) +
|
||||
((imm & 0b11111111) << 11) +
|
||||
(imm & 0b10000000000000000000), 20
|
||||
(((ins >> 21) & 0b1111111111) << 1) +
|
||||
(((ins >> 20) & 1) << 11) +
|
||||
(((ins >> 12) & 0b11111111) << 12) +
|
||||
(((ins >> 31) & 1) << 20), 21
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user