summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/fr30/mov.cgs
blob: bf99252f06196ad72c0d02e583159e0bda39f31c (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
102
103
104
105
106
107
108
# fr30 testcase for mov $Rj,$Ri
# mach(): fr30

	.include "testutils.inc"

	START

	.text
	.global mov
mov:
	; Test mov $Rj,$Ri
	mvi_h_gr   	1,r7
	mvi_h_dr   	0xa,tbr
	mvi_h_dr   	0xb,rp
	mvi_h_dr   	0xc,mdh
	mvi_h_dr   	0xd,mdl
	mvr_h_gr        sp,ssp
	mvr_h_gr	sp,usp

	mov		r7,r7
	set_cc          0x0f		; Condition codes should not change
	test_cc		1 1 1 1
	test_h_gr  	1,r7

	mov		r7,r8
	set_cc          0x0e		; Condition codes should not change
	test_cc		1 1 1 0
	test_h_gr  	1,r7
	test_h_gr  	1,r8

	; Test mov $Rs,$Ri
	set_cc          0x0d		; Condition codes should not change
	mov		tbr,r7
	test_cc		1 1 0 1
	test_h_gr  	0xa,r7

	set_cc          0x0c		; Condition codes should not change
	mov		rp,r7
	test_cc		1 1 0 0
	test_h_gr  	0xb,r7

	set_cc          0x0b		; Condition codes should not change
	mov		mdh,r7
	test_cc		1 0 1 1
	test_h_gr  	0xc,r7

	set_cc          0x0a		; Condition codes should not change
	mov		mdl,r7
	test_cc		1 0 1 0
	test_h_gr  	0xd,r7

	set_cc          0x09		; Condition codes should not change
	mov		usp,r7
	test_cc		1 0 0 1
	testr_h_gr  	sp,r7

	set_cc          0x08		; Condition codes should not change
	mov		ssp,r7
	test_cc		1 0 0 0
	testr_h_gr  	sp,r7

	; Test mov $Ri,$Rs
	set_cc          0x07		; Condition codes should not change
	mov		r8,tbr
	test_cc		0 1 1 1
	test_h_dr  	0x1,tbr

	set_cc          0x06		; Condition codes should not change
	mov		r8,rp
	test_cc		0 1 1 0
	test_h_dr  	0x1,rp

	set_cc          0x05		; Condition codes should not change
	mov		r8,mdh
	test_cc		0 1 0 1
	test_h_dr  	0x1,mdh

	set_cc          0x04		; Condition codes should not change
	mov		r8,mdl
	test_cc		0 1 0 0
	test_h_dr  	0x1,mdl

	set_cc          0x03		; Condition codes should not change
	mov		r8,ssp
	test_cc		0 0 1 1
	test_h_dr  	0x1,ssp

	set_cc          0x02		; Condition codes should not change
	mov		r8,usp
	test_cc		0 0 1 0
	test_h_dr  	0x1,usp

	; Test mov $PS,$Ri
	set_cc          0x01		; Condition codes affect result
	set_dbits	0x3
	mov		ps,r7
	test_cc		0 0 0 1
	test_h_gr  	0x00000601,r7

	; Test mov $Ri,PS
	set_cc          0x01		; Set opposite of expected
	set_dbits	0x1		; Set opposite of expected
	mvi_h_gr	0x0000040e,r7
	mov		r7,PS
	test_cc		1 1 1 0
	test_dbits	0x2

	pass