diff options
author | Torbjørn Viem Ness <tovine@users.noreply.github.com> | 2020-01-31 20:35:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-31 11:35:19 -0800 |
commit | 3a98ec2e306938cce07ab15e3678d670611aa66d (patch) | |
tree | ac64207a6c95ee959a3ad76008e6c12811078113 | |
parent | 32274e0ce949d9c97647d86e82146c46e3515e90 (diff) | |
download | riscv-tests-3a98ec2e306938cce07ab15e3678d670611aa66d.zip riscv-tests-3a98ec2e306938cce07ab15e3678d670611aa66d.tar.gz riscv-tests-3a98ec2e306938cce07ab15e3678d670611aa66d.tar.bz2 |
Added CSR test cases on whether writing 0 to CSR works, as that might get overlooked by implementors because some CSR operations should ignore writes if source is x0 (#236)
-rw-r--r-- | isa/rv64si/csr.S | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/isa/rv64si/csr.S b/isa/rv64si/csr.S index dbe1c05..d586d11 100644 --- a/isa/rv64si/csr.S +++ b/isa/rv64si/csr.S @@ -55,6 +55,8 @@ RVTEST_CODE_BEGIN TEST_CASE( 7, a0, 0xbad1dea, li a0, 0x0001dea; csrrc a0, sscratch, a0); TEST_CASE( 8, a0, 0xbad0000, li a0, 0x000beef; csrrs a0, sscratch, a0); TEST_CASE( 9, a0, 0xbadbeef, csrr a0, sscratch); + TEST_CASE(15, a0, 0, csrrwi a0, sscratch, 0; csrrwi a0, sscratch, 0xF); + TEST_CASE(16, a0, 0, csrw sscratch, zero; csrr a0, sscratch); #ifdef __MACHINE_MODE # Is F extension present? |