sysprog21 / semu

A minimalist RISC-V system emulator capable of running Linux kernel
MIT License
253 stars 47 forks source link

Fix RV32A instructions #6

Closed gagachang closed 2 years ago

gagachang commented 2 years ago

Refer to RISC-V specification: "The RISC-V Instruction Set Manual Volume I: Unprivileged ISA", Section 8.4:

For RV64, 32-bit AMOs always sign-extend the value placed in rd.

And the recent test result of riscv-tests becomes:

Pass: rv64ua_p_amoadd_w
Pass: rv64ua_p_amoswap_w

=======================
Test result: 55/71
=======================
jserv commented 2 years ago

Thank @gagachang for contributing!