summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/fr30/stm1.cgs
blob: 2ac373d3544e5a857e55dd540e44f6dfe1aa9bb5 (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
# fr30 testcase for stm1 ($reglist_low)
# mach(): fr30

	.include "testutils.inc"

	START

	.text
	.global stm1
stm1:
	; Test stm1 ($reglist_low)
	mvr_h_gr	sp,r1		; save stack pointer temporarily
	mvr_h_gr	sp,r2		; save stack pointer permanently
	mvi_h_gr   	8,r8
	mvi_h_gr   	9,r9
	mvi_h_gr   	10,r10
	mvi_h_gr   	11,r11
	mvi_h_gr   	12,r12
	mvi_h_gr   	13,r13
	mvi_h_gr   	14,r14
	set_cc          0x0f		; Condition codes should not change
	stm1      	(r8,r10,r12,r14)
	test_cc		1 1 1 1
	inci_h_gr	-4,r1
	test_h_mem	14,r1
	inci_h_gr	-4,r1
	test_h_mem	12,r1
	inci_h_gr	-4,r1
	test_h_mem	10,r1
	inci_h_gr	-4,r1
	testr_h_mem	8,r1

	mvr_h_gr	r2,sp		; restore stack pointer
	mvr_h_gr	r2,r1		; save stack pointer temporarily
	mvi_h_gr   	8,r8
	mvi_h_gr   	9,r9
	mvi_h_gr   	10,r10
	mvi_h_gr   	11,r11
	mvi_h_gr   	12,r12
	mvi_h_gr   	13,r13
	mvi_h_gr   	14,r14
	set_cc          0x0f		; Condition codes should not change
	stm1      	(r9,r11,r13,r15)
	test_cc		1 1 1 1
	inci_h_gr	-4,r1
	testr_h_mem	r2,r1
	inci_h_gr	-4,r1
	test_h_mem	13,r1
	inci_h_gr	-4,r1
	test_h_mem	11,r1
	inci_h_gr	-4,r1
	test_h_mem	9,r1		; saved r15 is from before stm1

	mvr_h_gr	r2,sp		; restore stack pointer
	mvr_h_gr	r2,r1		; save stack pointer temporarily
	mvi_h_gr   	8,r8
	mvi_h_gr   	9,r9
	mvi_h_gr   	10,r10
	mvi_h_gr   	11,r11
	mvi_h_gr   	12,r12
	mvi_h_gr   	13,r13
	mvi_h_gr   	14,r14
	set_cc          0x0f		; Condition codes should not change
	stm1      	(r9,r13,r15,r11); Order specified should not matter
	test_cc		1 1 1 1
	inci_h_gr	-4,r1
	testr_h_mem	r2,r1
	inci_h_gr	-4,r1
	test_h_mem	13,r1
	inci_h_gr	-4,r1
	test_h_mem	11,r1
	inci_h_gr	-4,r1
	test_h_mem	9,r1		; saved r15 is from before stm1

	mvr_h_gr	r2,sp		; restore stack pointer
	mvr_h_gr	r2,r1		; save stack pointer temporarily
	mvi_h_gr   	9,r8
	mvi_h_gr   	9,r9
	mvi_h_gr   	9,r10
	mvi_h_gr   	9,r11
	mvi_h_gr   	9,r12
	mvi_h_gr   	9,r13
	mvi_h_gr   	9,r14
	set_cc          0x0f		; Condition codes should not change
	stm1      	()		; should do nothing
	test_cc		1 1 1 1
	testr_h_gr	r2,sp
	inci_h_gr	-4,r1
	testr_h_mem	r2,r1
	inci_h_gr	-4,r1
	test_h_mem	13,r1
	inci_h_gr	-4,r1
	test_h_mem	11,r1
	inci_h_gr	-4,r1
	test_h_mem	9,r1

	pass