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