minor mt updates
[riscv-tests.git] / isa / rv32si / shamt.S
1 #*****************************************************************************
2 # csr.S
3 #-----------------------------------------------------------------------------
4 #
5 # Test CSRRx and CSRRxI instructions.
6 #
7
8 #include "riscv_test.h"
9 #include "test_macros.h"
10
11 RVTEST_RV32S
12 RVTEST_CODE_BEGIN
13
14 la t0, evec
15 csrw evec, t0
16
17 # Make sure slli with shamt[4] set is legal.
18 TEST_CASE( 2, a0, 65536, li a0, 1; slli a0, a0, 16);
19
20 # Make sure slli with shamt[4] set is not legal.
21 TEST_CASE( 3, x0, 1, slli a0, a0, 32);
22
23 TEST_PASSFAIL
24
25 evec:
26 # Trapping on test 3 is good.
27 # Note that since the test didn't complete, TESTNUM is smaller by 1.
28 li t0, 2
29 bne TESTNUM, t0, fail
30
31 # Make sure CAUSE indicates an illegal instructino.
32 csrr t0, cause
33 li t1, CAUSE_ILLEGAL_INSTRUCTION
34 bne t0, t1, fail
35 j pass
36
37 RVTEST_CODE_END
38
39 .data
40 RVTEST_DATA_BEGIN
41
42 TEST_DATA
43
44 RVTEST_DATA_END