aboutsummaryrefslogtreecommitdiff
path: root/isa/macros
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-06-02 11:06:03 -0700
committerTim Newsome <tim@sifive.com>2022-06-07 10:12:59 -0700
commitafef86516d1ec7289bae24e3ad247cca57e3fb3b (patch)
treef3511f723e1ddf524f193a4ca67d7c809d14d1ed /isa/macros
parent27dbc399e23d5f9668363706accc76911d6d31fc (diff)
downloadriscv-tests-afef86516d1ec7289bae24e3ad247cca57e3fb3b.zip
riscv-tests-afef86516d1ec7289bae24e3ad247cca57e3fb3b.tar.gz
riscv-tests-afef86516d1ec7289bae24e3ad247cca57e3fb3b.tar.bz2
Set TESTNUM before executing code.
Tests that might cause a trap during their code need TESTNUM (gp) set so the trap handler can correctly identify which test is running, and also report that to the user in case the test fails. Fix up shamt.S and csr.S to handle the new behavior.
Diffstat (limited to 'isa/macros')
-rw-r--r--isa/macros/scalar/test_macros.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/isa/macros/scalar/test_macros.h b/isa/macros/scalar/test_macros.h
index a8a78a7..ee352e4 100644
--- a/isa/macros/scalar/test_macros.h
+++ b/isa/macros/scalar/test_macros.h
@@ -12,9 +12,9 @@
#define TEST_CASE( testnum, testreg, correctval, code... ) \
test_ ## testnum: \
+ li TESTNUM, testnum; \
code; \
li x7, MASK_XLEN(correctval); \
- li TESTNUM, testnum; \
bne testreg, x7, fail;
# We use a macro hack to simpify code generation for various numbers