summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/cris/asm/movmp.ms
blob: 7080d71f713638475c4efc40aca4277d563aeb26 (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
109
110
111
112
113
114
115
116
# mach: crisv3 crisv8 crisv10 crisv32
# output: ffffff00\nffff0000\n0\nffffff00\nffff0000\n0\nffffff00\nffff0000\n0\nbb113344\n664433aa\ncc557788\nabcde012\nabcde000\n77880000\n0\n

# Test generic "move Ps,[]" and "move [],Pd" insns; the ones with
# functionality common to all models.

 .include "testutils.inc"
 start

 .data
filler:
 .byte 0xaa
 .word 0x4433
 .dword 0x55778866
 .byte 0xcc

 .text
; Test that writing to zero-registers is a nop
 move 0xaa,p0
 move 0x4433,p4
 move 0x55774433,p8
 moveq -1,r3
 setf zcvn
 clear.b r3
 test_cc 1 1 1 1
 dumpr3

 moveq -1,r3
 clearf zcvn
 clear.w r3
 test_cc 0 0 0 0
 dumpr3

 moveq -1,r3
 clear.d r3
 dumpr3

; "Write" using ordinary memory references too.
 move.d filler,r6
 move [r6],p0
 move [r6],p4
 move [r6],p8
 moveq -1,r3
 clear.b r3
 dumpr3

 moveq -1,r3
 clear.w r3
 dumpr3

 moveq -1,r3
 clear.d r3
 dumpr3

; And postincremented.
 move [r6+],p0
 move [r6+],p4
 move [r6+],p8
 moveq -1,r3
 clear.b r3
 dumpr3

 moveq -1,r3
 clear.w r3
 dumpr3

 moveq -1,r3
 clear.d r3
 dumpr3

; Now see that we can write to the registers too.

; [PC+]
 move.d filler,r9
 move 0xbb113344,srp
 move srp,r3
 dumpr3

; [R+]
 move [r9+],srp
 move srp,r3
 dumpr3

; [R]
 move [r9],srp
 move srp,r3
 dumpr3

; And check writing to memory, clear and srp.

 move.d filler,r9
 move 0xabcde012,srp
 setf zcvn
 move srp,[r9+]
 test_cc 1 1 1 1
 subq 4,r9
 move.d [r9],r3
 dumpr3

 clearf zcvn
 clear.b [r9]
 test_cc 0 0 0 0
 move.d [r9],r3
 dumpr3

 addq 2,r9
 clear.w [r9+]
 subq 2,r9
 move.d [r9],r3
 dumpr3 

 clear.d [r9]
 move.d [r9],r3
 dumpr3

 quit