master
s 51 lines 732 Bytes
Raw
1 #include "macros.inc"
2
3 test_suite s32c1i
4
5 #if XCHAL_HAVE_S32C1I
6
7 test s32c1i_nowrite
8 #if XCHAL_HW_VERSION >= 230000
9 movi a2, 0x29
10 wsr a2, atomctl
11 #endif
12 movi a2, 1f
13 movi a3, 1
14 wsr a3, scompare1
15 movi a1, 2
16 s32c1i a1, a2, 0
17 assert ne, a1, a3
18 l32i a1, a2, 0
19 assert eqi, a1, 3
20
21 .data
22 .align 4
23 1:
24 .word 3
25 .text
26 test_end
27
28 test s32c1i_write
29 #if XCHAL_HW_VERSION >= 230000
30 movi a2, 0x29
31 wsr a2, atomctl
32 #endif
33 movi a2, 1f
34 movi a3, 3
35 wsr a3, scompare1
36 movi a1, 2
37 s32c1i a1, a2, 0
38 assert eq, a1, a3
39 l32i a1, a2, 0
40 assert eqi, a1, 2
41
42 .data
43 .align 4
44 1:
45 .word 3
46 .text
47 test_end
48
49 #endif
50
51 test_suite_end