1# Source file used to test the doubleword memory access macros
2# (ld and friends).
3
4# By default test ld.
5	.set	r4, $4
6
7# If defined, test sd instead.
8	.ifdef	tsd
9	.macro	ld ops:vararg
10	sd	\ops
11	.endm
12	.endif
13# If defined, test l.d instead.
14	.ifdef	tl_d
15	.set	r4, $f4
16	.macro	ld ops:vararg
17	l.d	\ops
18	.endm
19	.endif
20# If defined, test s.d instead.
21	.ifdef	ts_d
22	.set	r4, $f4
23	.macro	ld ops:vararg
24	s.d	\ops
25	.endm
26	.endif
27# If defined, test ldc1 instead.
28	.ifdef	tldc1
29	.set	r4, $f4
30	.macro	ld ops:vararg
31	ldc1	\ops
32	.endm
33	.endif
34# If defined, test sdc1 instead.
35	.ifdef	tsdc1
36	.set	r4, $f4
37	.macro	ld ops:vararg
38	sdc1	\ops
39	.endm
40	.endif
41
42	.macro	data
43	.bss
44	.align	12
45	.sbss
46	.align	12
47	.data
48	.align	12
49data_label:
50	.extern big_external_data_label,1000
51	.extern small_external_data_label,1
52	.comm big_external_common,1000
53	.comm small_external_common,1
54	.lcomm big_local_common,1000
55	.lcomm small_local_common,1
56	.endm
57
58	.ifndef	forward
59	data
60	.endif
61
62	.text
63	.align	12
64text_label:
65	ld	r4,0
66	ld	r4,1
67	ld	r4,0x8000
68	ld	r4,-0x8000
69	ld	r4,0x10000
70	ld	r4,0x1a5a5
71	ld	r4,0($5)
72	ld	r4,1($5)
73	ld	r4,0x8000($5)
74	ld	r4,-0x8000($5)
75	ld	r4,0x10000($5)
76	ld	r4,0x1a5a5($5)
77	ld	r4,data_label
78	ld	r4,big_external_data_label
79	ld	r4,small_external_data_label
80	ld	r4,big_external_common
81	ld	r4,small_external_common
82	ld	r4,big_local_common
83	ld	r4,small_local_common
84	ld	r4,data_label+1
85	ld	r4,big_external_data_label+1
86	ld	r4,small_external_data_label+1
87	ld	r4,big_external_common+1
88	ld	r4,small_external_common+1
89	ld	r4,big_local_common+1
90	ld	r4,small_local_common+1
91	ld	r4,data_label+0x8000
92	ld	r4,big_external_data_label+0x8000
93	ld	r4,small_external_data_label+0x8000
94	ld	r4,big_external_common+0x8000
95	ld	r4,small_external_common+0x8000
96	ld	r4,big_local_common+0x8000
97	ld	r4,small_local_common+0x8000
98	ld	r4,data_label-0x8000
99	ld	r4,big_external_data_label-0x8000
100	ld	r4,small_external_data_label-0x8000
101	ld	r4,big_external_common-0x8000
102	ld	r4,small_external_common-0x8000
103	ld	r4,big_local_common-0x8000
104	ld	r4,small_local_common-0x8000
105	ld	r4,data_label+0x10000
106	ld	r4,big_external_data_label+0x10000
107	ld	r4,small_external_data_label+0x10000
108	ld	r4,big_external_common+0x10000
109	ld	r4,small_external_common+0x10000
110	ld	r4,big_local_common+0x10000
111	ld	r4,small_local_common+0x10000
112	ld	r4,data_label+0x1a5a5
113	ld	r4,big_external_data_label+0x1a5a5
114	ld	r4,small_external_data_label+0x1a5a5
115	ld	r4,big_external_common+0x1a5a5
116	ld	r4,small_external_common+0x1a5a5
117	ld	r4,big_local_common+0x1a5a5
118	ld	r4,small_local_common+0x1a5a5
119	ld	r4,data_label($5)
120	ld	r4,big_external_data_label($5)
121	ld	r4,small_external_data_label($5)
122	ld	r4,big_external_common($5)
123	ld	r4,small_external_common($5)
124	ld	r4,big_local_common($5)
125	ld	r4,small_local_common($5)
126	ld	r4,data_label+1($5)
127	ld	r4,big_external_data_label+1($5)
128	ld	r4,small_external_data_label+1($5)
129	ld	r4,big_external_common+1($5)
130	ld	r4,small_external_common+1($5)
131	ld	r4,big_local_common+1($5)
132	ld	r4,small_local_common+1($5)
133	ld	r4,data_label+0x8000($5)
134	ld	r4,big_external_data_label+0x8000($5)
135	ld	r4,small_external_data_label+0x8000($5)
136	ld	r4,big_external_common+0x8000($5)
137	ld	r4,small_external_common+0x8000($5)
138	ld	r4,big_local_common+0x8000($5)
139	ld	r4,small_local_common+0x8000($5)
140	ld	r4,data_label-0x8000($5)
141	ld	r4,big_external_data_label-0x8000($5)
142	ld	r4,small_external_data_label-0x8000($5)
143	ld	r4,big_external_common-0x8000($5)
144	ld	r4,small_external_common-0x8000($5)
145	ld	r4,big_local_common-0x8000($5)
146	ld	r4,small_local_common-0x8000($5)
147	ld	r4,data_label+0x10000($5)
148	ld	r4,big_external_data_label+0x10000($5)
149	ld	r4,small_external_data_label+0x10000($5)
150	ld	r4,big_external_common+0x10000($5)
151	ld	r4,small_external_common+0x10000($5)
152	ld	r4,big_local_common+0x10000($5)
153	ld	r4,small_local_common+0x10000($5)
154	ld	r4,data_label+0x1a5a5($5)
155	ld	r4,big_external_data_label+0x1a5a5($5)
156	ld	r4,small_external_data_label+0x1a5a5($5)
157	ld	r4,big_external_common+0x1a5a5($5)
158	ld	r4,small_external_common+0x1a5a5($5)
159	ld	r4,big_local_common+0x1a5a5($5)
160	ld	r4,small_local_common+0x1a5a5($5)
161
162# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
163	.align	2
164	.space	8
165
166	.ifdef	forward
167	data
168	.endif
169