summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/fr30/stm0.cgs
blob: 5cc162c1a31701a92bf99e40850959c20d3bcd5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# fr30 testcase for stm0 ($reglist_low)
# mach(): fr30

	.include "testutils.inc"

	START

	.text
	.global stm0
stm0:
	; Test stm0 ($reglist_low)
	mvr_h_gr	sp,r8		; save stack pointer temporarily
	mvr_h_gr	sp,r9		; save stack pointer permanently
	mvi_h_gr   	0,r0
	mvi_h_gr   	1,r1
	mvi_h_gr   	2,r2
	mvi_h_gr   	3,r3
	mvi_h_gr   	4,r4
	mvi_h_gr   	5,r5
	mvi_h_gr   	6,r6
	mvi_h_gr   	7,r7
	set_cc          0x0f		; Condition codes should not change
	stm0      	(r0,r2,r4,r6)
	test_cc		1 1 1 1
	inci_h_gr	-4,r8
	test_h_mem	6,r8
	inci_h_gr	-4,r8
	test_h_mem	4,r8
	inci_h_gr	-4,r8
	test_h_mem	2,r8
	inci_h_gr	-4,r8
	test_h_mem	0,r8

	mvr_h_gr	r9,sp		; restore stack pointer
	mvr_h_gr	r9,r8		; save stack pointer temporarily
	mvi_h_gr   	0,r0
	mvi_h_gr   	1,r1
	mvi_h_gr   	2,r2
	mvi_h_gr   	3,r3
	mvi_h_gr   	4,r4
	mvi_h_gr   	5,r5
	mvi_h_gr   	6,r6
	mvi_h_gr   	7,r7
	set_cc          0x0f		; Condition codes should not change
	stm0      	(r1,r3,r5,r7)
	test_cc		1 1 1 1
	inci_h_gr	-4,r8
	test_h_mem	7,r8
	inci_h_gr	-4,r8
	test_h_mem	5,r8
	inci_h_gr	-4,r8
	test_h_mem	3,r8
	inci_h_gr	-4,r8
	test_h_mem	1,r8

	mvr_h_gr	r9,sp		; restore stack pointer
	mvr_h_gr	r9,r8		; save stack pointer temporarily
	mvi_h_gr   	0,r0
	mvi_h_gr   	1,r1
	mvi_h_gr   	2,r2
	mvi_h_gr   	3,r3
	mvi_h_gr   	4,r4
	mvi_h_gr   	5,r5
	mvi_h_gr   	6,r6
	mvi_h_gr   	7,r7
	set_cc          0x0f		; Condition codes should not change
	stm0      	(r1,r5,r7,r3)	; Order specified should not matter
	test_cc		1 1 1 1
	inci_h_gr	-4,r8
	test_h_mem	7,r8
	inci_h_gr	-4,r8
	test_h_mem	5,r8
	inci_h_gr	-4,r8
	test_h_mem	3,r8
	inci_h_gr	-4,r8
	test_h_mem	1,r8

	mvr_h_gr	r9,sp		; restore stack pointer
	mvr_h_gr	r9,r8		; save stack pointer temporarily
	mvi_h_gr   	9,r0
	mvi_h_gr   	9,r1
	mvi_h_gr   	9,r2
	mvi_h_gr   	9,r3
	mvi_h_gr   	9,r4
	mvi_h_gr   	9,r5
	mvi_h_gr   	9,r6
	mvi_h_gr   	9,r7
	set_cc          0x0f		; Condition codes should not change
	stm0      	()		; should do nothing
	test_cc		1 1 1 1
	testr_h_gr	r9,sp
	inci_h_gr	-4,r8
	test_h_mem	7,r8
	inci_h_gr	-4,r8
	test_h_mem	5,r8
	inci_h_gr	-4,r8
	test_h_mem	3,r8
	inci_h_gr	-4,r8
	test_h_mem	1,r8

	pass