summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/lib/reg.S
blob: 0dc44f0da065191b71fd886a25c15c574fbbeed8 (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
/*
 * test helper assembly functions
 *
 * Copyright (C) 2016 Simon Guo, IBM Corporation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */
#include <ppc-asm.h>
#include "reg.h"


/* Non volatile GPR - unsigned long buf[18] */
FUNC_START(load_gpr)
	ld	14, 0*8(3)
	ld	15, 1*8(3)
	ld	16, 2*8(3)
	ld	17, 3*8(3)
	ld	18, 4*8(3)
	ld	19, 5*8(3)
	ld	20, 6*8(3)
	ld	21, 7*8(3)
	ld	22, 8*8(3)
	ld	23, 9*8(3)
	ld	24, 10*8(3)
	ld	25, 11*8(3)
	ld	26, 12*8(3)
	ld	27, 13*8(3)
	ld	28, 14*8(3)
	ld	29, 15*8(3)
	ld	30, 16*8(3)
	ld	31, 17*8(3)
	blr
FUNC_END(load_gpr)

FUNC_START(store_gpr)
	std	14, 0*8(3)
	std	15, 1*8(3)
	std	16, 2*8(3)
	std	17, 3*8(3)
	std	18, 4*8(3)
	std	19, 5*8(3)
	std	20, 6*8(3)
	std	21, 7*8(3)
	std	22, 8*8(3)
	std	23, 9*8(3)
	std	24, 10*8(3)
	std	25, 11*8(3)
	std	26, 12*8(3)
	std	27, 13*8(3)
	std	28, 14*8(3)
	std	29, 15*8(3)
	std	30, 16*8(3)
	std	31, 17*8(3)
	blr
FUNC_END(store_gpr)

/* Single Precision Float - float buf[32] */
FUNC_START(load_fpr_single_precision)
	lfs 0, 0*4(3)
	lfs 1, 1*4(3)
	lfs 2, 2*4(3)
	lfs 3, 3*4(3)
	lfs 4, 4*4(3)
	lfs 5, 5*4(3)
	lfs 6, 6*4(3)
	lfs 7, 7*4(3)
	lfs 8, 8*4(3)
	lfs 9, 9*4(3)
	lfs 10, 10*4(3)
	lfs 11, 11*4(3)
	lfs 12, 12*4(3)
	lfs 13, 13*4(3)
	lfs 14, 14*4(3)
	lfs 15, 15*4(3)
	lfs 16, 16*4(3)
	lfs 17, 17*4(3)
	lfs 18, 18*4(3)
	lfs 19, 19*4(3)
	lfs 20, 20*4(3)
	lfs 21, 21*4(3)
	lfs 22, 22*4(3)
	lfs 23, 23*4(3)
	lfs 24, 24*4(3)
	lfs 25, 25*4(3)
	lfs 26, 26*4(3)
	lfs 27, 27*4(3)
	lfs 28, 28*4(3)
	lfs 29, 29*4(3)
	lfs 30, 30*4(3)
	lfs 31, 31*4(3)
	blr
FUNC_END(load_fpr_single_precision)

/* Single Precision Float - float buf[32] */
FUNC_START(store_fpr_single_precision)
	stfs 0, 0*4(3)
	stfs 1, 1*4(3)
	stfs 2, 2*4(3)
	stfs 3, 3*4(3)
	stfs 4, 4*4(3)
	stfs 5, 5*4(3)
	stfs 6, 6*4(3)
	stfs 7, 7*4(3)
	stfs 8, 8*4(3)
	stfs 9, 9*4(3)
	stfs 10, 10*4(3)
	stfs 11, 11*4(3)
	stfs 12, 12*4(3)
	stfs 13, 13*4(3)
	stfs 14, 14*4(3)
	stfs 15, 15*4(3)
	stfs 16, 16*4(3)
	stfs 17, 17*4(3)
	stfs 18, 18*4(3)
	stfs 19, 19*4(3)
	stfs 20, 20*4(3)
	stfs 21, 21*4(3)
	stfs 22, 22*4(3)
	stfs 23, 23*4(3)
	stfs 24, 24*4(3)
	stfs 25, 25*4(3)
	stfs 26, 26*4(3)
	stfs 27, 27*4(3)
	stfs 28, 28*4(3)
	stfs 29, 29*4(3)
	stfs 30, 30*4(3)
	stfs 31, 31*4(3)
	blr
FUNC_END(store_fpr_single_precision)

/* VMX/VSX registers - unsigned long buf[128] */
FUNC_START(loadvsx)
	lis	4, 0
	LXVD2X	(0,(4),(3))
	addi	4, 4, 16
	LXVD2X	(1,(4),(3))
	addi	4, 4, 16
	LXVD2X	(2,(4),(3))
	addi	4, 4, 16
	LXVD2X	(3,(4),(3))
	addi	4, 4, 16
	LXVD2X	(4,(4),(3))
	addi	4, 4, 16
	LXVD2X	(5,(4),(3))
	addi	4, 4, 16
	LXVD2X	(6,(4),(3))
	addi	4, 4, 16
	LXVD2X	(7,(4),(3))
	addi	4, 4, 16
	LXVD2X	(8,(4),(3))
	addi	4, 4, 16
	LXVD2X	(9,(4),(3))
	addi	4, 4, 16
	LXVD2X	(10,(4),(3))
	addi	4, 4, 16
	LXVD2X	(11,(4),(3))
	addi	4, 4, 16
	LXVD2X	(12,(4),(3))
	addi	4, 4, 16
	LXVD2X	(13,(4),(3))
	addi	4, 4, 16
	LXVD2X	(14,(4),(3))
	addi	4, 4, 16
	LXVD2X	(15,(4),(3))
	addi	4, 4, 16
	LXVD2X	(16,(4),(3))
	addi	4, 4, 16
	LXVD2X	(17,(4),(3))
	addi	4, 4, 16
	LXVD2X	(18,(4),(3))
	addi	4, 4, 16
	LXVD2X	(19,(4),(3))
	addi	4, 4, 16
	LXVD2X	(20,(4),(3))
	addi	4, 4, 16
	LXVD2X	(21,(4),(3))
	addi	4, 4, 16
	LXVD2X	(22,(4),(3))
	addi	4, 4, 16
	LXVD2X	(23,(4),(3))
	addi	4, 4, 16
	LXVD2X	(24,(4),(3))
	addi	4, 4, 16
	LXVD2X	(25,(4),(3))
	addi	4, 4, 16
	LXVD2X	(26,(4),(3))
	addi	4, 4, 16
	LXVD2X	(27,(4),(3))
	addi	4, 4, 16
	LXVD2X	(28,(4),(3))
	addi	4, 4, 16
	LXVD2X	(29,(4),(3))
	addi	4, 4, 16
	LXVD2X	(30,(4),(3))
	addi	4, 4, 16
	LXVD2X	(31,(4),(3))
	addi	4, 4, 16
	LXVD2X	(32,(4),(3))
	addi	4, 4, 16
	LXVD2X	(33,(4),(3))
	addi	4, 4, 16
	LXVD2X	(34,(4),(3))
	addi	4, 4, 16
	LXVD2X	(35,(4),(3))
	addi	4, 4, 16
	LXVD2X	(36,(4),(3))
	addi	4, 4, 16
	LXVD2X	(37,(4),(3))
	addi	4, 4, 16
	LXVD2X	(38,(4),(3))
	addi	4, 4, 16
	LXVD2X	(39,(4),(3))
	addi	4, 4, 16
	LXVD2X	(40,(4),(3))
	addi	4, 4, 16
	LXVD2X	(41,(4),(3))
	addi	4, 4, 16
	LXVD2X	(42,(4),(3))
	addi	4, 4, 16
	LXVD2X	(43,(4),(3))
	addi	4, 4, 16
	LXVD2X	(44,(4),(3))
	addi	4, 4, 16
	LXVD2X	(45,(4),(3))
	addi	4, 4, 16
	LXVD2X	(46,(4),(3))
	addi	4, 4, 16
	LXVD2X	(47,(4),(3))
	addi	4, 4, 16
	LXVD2X	(48,(4),(3))
	addi	4, 4, 16
	LXVD2X	(49,(4),(3))
	addi	4, 4, 16
	LXVD2X	(50,(4),(3))
	addi	4, 4, 16
	LXVD2X	(51,(4),(3))
	addi	4, 4, 16
	LXVD2X	(52,(4),(3))
	addi	4, 4, 16
	LXVD2X	(53,(4),(3))
	addi	4, 4, 16
	LXVD2X	(54,(4),(3))
	addi	4, 4, 16
	LXVD2X	(55,(4),(3))
	addi	4, 4, 16
	LXVD2X	(56,(4),(3))
	addi	4, 4, 16
	LXVD2X	(57,(4),(3))
	addi	4, 4, 16
	LXVD2X	(58,(4),(3))
	addi	4, 4, 16
	LXVD2X	(59,(4),(3))
	addi	4, 4, 16
	LXVD2X	(60,(4),(3))
	addi	4, 4, 16
	LXVD2X	(61,(4),(3))
	addi	4, 4, 16
	LXVD2X	(62,(4),(3))
	addi	4, 4, 16
	LXVD2X	(63,(4),(3))
	blr
FUNC_END(loadvsx)

FUNC_START(storevsx)
	lis	4, 0
	STXVD2X	(0,(4),(3))
	addi	4, 4, 16
	STXVD2X	(1,(4),(3))
	addi	4, 4, 16
	STXVD2X	(2,(4),(3))
	addi	4, 4, 16
	STXVD2X	(3,(4),(3))
	addi	4, 4, 16
	STXVD2X	(4,(4),(3))
	addi	4, 4, 16
	STXVD2X	(5,(4),(3))
	addi	4, 4, 16
	STXVD2X	(6,(4),(3))
	addi	4, 4, 16
	STXVD2X	(7,(4),(3))
	addi	4, 4, 16
	STXVD2X	(8,(4),(3))
	addi	4, 4, 16
	STXVD2X	(9,(4),(3))
	addi	4, 4, 16
	STXVD2X	(10,(4),(3))
	addi	4, 4, 16
	STXVD2X	(11,(4),(3))
	addi	4, 4, 16
	STXVD2X	(12,(4),(3))
	addi	4, 4, 16
	STXVD2X	(13,(4),(3))
	addi	4, 4, 16
	STXVD2X	(14,(4),(3))
	addi	4, 4, 16
	STXVD2X	(15,(4),(3))
	addi	4, 4, 16
	STXVD2X	(16,(4),(3))
	addi	4, 4, 16
	STXVD2X	(17,(4),(3))
	addi	4, 4, 16
	STXVD2X	(18,(4),(3))
	addi	4, 4, 16
	STXVD2X	(19,(4),(3))
	addi	4, 4, 16
	STXVD2X	(20,(4),(3))
	addi	4, 4, 16
	STXVD2X	(21,(4),(3))
	addi	4, 4, 16
	STXVD2X	(22,(4),(3))
	addi	4, 4, 16
	STXVD2X	(23,(4),(3))
	addi	4, 4, 16
	STXVD2X	(24,(4),(3))
	addi	4, 4, 16
	STXVD2X	(25,(4),(3))
	addi	4, 4, 16
	STXVD2X	(26,(4),(3))
	addi	4, 4, 16
	STXVD2X	(27,(4),(3))
	addi	4, 4, 16
	STXVD2X	(28,(4),(3))
	addi	4, 4, 16
	STXVD2X	(29,(4),(3))
	addi	4, 4, 16
	STXVD2X	(30,(4),(3))
	addi	4, 4, 16
	STXVD2X	(31,(4),(3))
	addi	4, 4, 16
	STXVD2X	(32,(4),(3))
	addi	4, 4, 16
	STXVD2X	(33,(4),(3))
	addi	4, 4, 16
	STXVD2X	(34,(4),(3))
	addi	4, 4, 16
	STXVD2X	(35,(4),(3))
	addi	4, 4, 16
	STXVD2X	(36,(4),(3))
	addi	4, 4, 16
	STXVD2X	(37,(4),(3))
	addi	4, 4, 16
	STXVD2X	(38,(4),(3))
	addi	4, 4, 16
	STXVD2X	(39,(4),(3))
	addi	4, 4, 16
	STXVD2X	(40,(4),(3))
	addi	4, 4, 16
	STXVD2X	(41,(4),(3))
	addi	4, 4, 16
	STXVD2X	(42,(4),(3))
	addi	4, 4, 16
	STXVD2X	(43,(4),(3))
	addi	4, 4, 16
	STXVD2X	(44,(4),(3))
	addi	4, 4, 16
	STXVD2X	(45,(4),(3))
	addi	4, 4, 16
	STXVD2X	(46,(4),(3))
	addi	4, 4, 16
	STXVD2X	(47,(4),(3))
	addi	4, 4, 16
	STXVD2X	(48,(4),(3))
	addi	4, 4, 16
	STXVD2X	(49,(4),(3))
	addi	4, 4, 16
	STXVD2X	(50,(4),(3))
	addi	4, 4, 16
	STXVD2X	(51,(4),(3))
	addi	4, 4, 16
	STXVD2X	(52,(4),(3))
	addi	4, 4, 16
	STXVD2X	(53,(4),(3))
	addi	4, 4, 16
	STXVD2X	(54,(4),(3))
	addi	4, 4, 16
	STXVD2X	(55,(4),(3))
	addi	4, 4, 16
	STXVD2X	(56,(4),(3))
	addi	4, 4, 16
	STXVD2X	(57,(4),(3))
	addi	4, 4, 16
	STXVD2X	(58,(4),(3))
	addi	4, 4, 16
	STXVD2X	(59,(4),(3))
	addi	4, 4, 16
	STXVD2X	(60,(4),(3))
	addi	4, 4, 16
	STXVD2X	(61,(4),(3))
	addi	4, 4, 16
	STXVD2X	(62,(4),(3))
	addi	4, 4, 16
	STXVD2X	(63,(4),(3))
	blr
FUNC_END(storevsx)
OpenPOWER on IntegriCloud