Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
#include "sparc_arch.h"

#ifdef	__arch64__
.register       %g2,#scratch
.register       %g3,#scratch
#endif

.text
.align	32
.globl	des_t4_key_expand
.type	des_t4_key_expand,#function
des_t4_key_expand:
	andcc		%o0, 0x7, %g0
	.word	0x91b20300 !alignaddr	%o0,%g0,%o0
	bz,pt		%icc, 1f
	ldd		[%o0 + 0x00], %f0
	ldd		[%o0 + 0x08], %f2
	.word	0x81b00902 !faligndata	%f0,%f2,%f0
1:	.word	0x81b026c0 !des_kexpand	%f0,0,%f0,
	.word	0x85b026c1 !des_kexpand	%f0,1,%f2,
	std		%f0, [%o1 + 0x00]
	.word	0x8db0a6c3 !des_kexpand	%f2,3,%f6,
	std		%f2, [%o1 + 0x08]
	.word	0x89b0a6c2 !des_kexpand	%f2,2,%f4,
	.word	0x95b1a6c3 !des_kexpand	%f6,3,%f10,
	std		%f6, [%o1 + 0x18]
	.word	0x91b1a6c2 !des_kexpand	%f6,2,%f8,
	std		%f4, [%o1 + 0x10]
	.word	0x9db2a6c3 !des_kexpand	%f10,3,%f14,
	std		%f10, [%o1 + 0x28]
	.word	0x99b2a6c2 !des_kexpand	%f10,2,%f12,
	std		%f8, [%o1 + 0x20]
	.word	0xa1b3a6c1 !des_kexpand	%f14,1,%f16,
	std		%f14, [%o1 + 0x38]
	.word	0xa9b426c3 !des_kexpand	%f16,3,%f20,
	std		%f12, [%o1 + 0x30]
	.word	0xa5b426c2 !des_kexpand	%f16,2,%f18,
	std		%f16, [%o1 + 0x40]
	.word	0xb1b526c3 !des_kexpand	%f20,3,%f24,
	std		%f20, [%o1 + 0x50]
	.word	0xadb526c2 !des_kexpand	%f20,2,%f22,
	std		%f18, [%o1 + 0x48]
	.word	0xb9b626c3 !des_kexpand	%f24,3,%f28,
	std		%f24, [%o1 + 0x60]
	.word	0xb5b626c2 !des_kexpand	%f24,2,%f26,
	std		%f22, [%o1 + 0x58]
	.word	0xbdb726c1 !des_kexpand	%f28,1,%f30,
	std		%f28, [%o1 + 0x70]
	std		%f26, [%o1 + 0x68]
	retl
	std		%f30, [%o1 + 0x78]
.size	des_t4_key_expand,.-des_t4_key_expand
.globl	des_t4_cbc_encrypt
.align	32
des_t4_cbc_encrypt:
	cmp		%o2, 0
	be,pn		SIZE_T_CC, .Lcbc_abort
	srln		%o2, 0, %o2		! needed on v8+, "nop" on v9
	ld		[%o4 + 0], %f0	! load ivec
	ld		[%o4 + 4], %f1

	and		%o0, 7, %g1
	andn		%o0, 7, %o0
	sll		%g1, 3, %g1
	mov		0xff, %g3
	prefetch	[%o0], 20
	prefetch	[%o0 + 63], 20
	sub		%g0, %g1, %g2
	and		%o1, 7, %g4
	.word	0x93b24340 !alignaddrl	%o1,%g0,%o1
	srl		%g3, %g4, %g3
	srlx		%o2, 3, %o2
	movrz		%g4, 0, %g3
	prefetch	[%o1], 22

	ldd		[%o3 + 0x00], %f4	! load key schedule
	ldd		[%o3 + 0x08], %f6
	ldd		[%o3 + 0x10], %f8
	ldd		[%o3 + 0x18], %f10
	ldd		[%o3 + 0x20], %f12
	ldd		[%o3 + 0x28], %f14
	ldd		[%o3 + 0x30], %f16
	ldd		[%o3 + 0x38], %f18
	ldd		[%o3 + 0x40], %f20
	ldd		[%o3 + 0x48], %f22
	ldd		[%o3 + 0x50], %f24
	ldd		[%o3 + 0x58], %f26
	ldd		[%o3 + 0x60], %f28
	ldd		[%o3 + 0x68], %f30
	ldd		[%o3 + 0x70], %f32
	ldd		[%o3 + 0x78], %f34

.Ldes_cbc_enc_loop:
	ldx		[%o0 + 0], %g4
	brz,pt		%g1, 4f
	nop

	ldx		[%o0 + 8], %g5
	sllx		%g4, %g1, %g4
	srlx		%g5, %g2, %g5
	or		%g5, %g4, %g4
4:
	.word	0x85b02304 !movxtod	%g4,%f2
	prefetch	[%o0 + 8+63], 20
	add		%o0, 8, %o0
	.word	0x81b08d80 !fxor	%f2,%f0,%f0		! ^= ivec
	prefetch	[%o1 + 63], 22

	.word	0x81b02680 !des_ip	%f0,%f0,,
	.word	0x80c90126 !des_round	%f4,%f6,%f0,%f0
	.word	0x80ca012a !des_round	%f8,%f10,%f0,%f0
	.word	0x80cb012e !des_round	%f12,%f14,%f0,%f0
	.word	0x80cc0132 !des_round	%f16,%f18,%f0,%f0
	.word	0x80cd0136 !des_round	%f20,%f22,%f0,%f0
	.word	0x80ce013a !des_round	%f24,%f26,%f0,%f0
	.word	0x80cf013e !des_round	%f28,%f30,%f0,%f0
	.word	0x80c84123 !des_round	%f32,%f34,%f0,%f0
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	brnz,pn		%g3, 2f
	sub		%o2, 1, %o2

	std		%f0, [%o1 + 0]
	brnz,pt		%o2, .Ldes_cbc_enc_loop
	add		%o1, 8, %o1

	st		%f0, [%o4 + 0]	! write out ivec
	retl
	st		%f1, [%o4 + 4]
.Lcbc_abort:
	retl
	nop

.align	16
2:	ldxa		[%o0]0x82, %g4		! avoid read-after-write hazard
						! and ~4x deterioration
						! in inp==out case
	.word	0x85b00900 !faligndata	%f0,%f0,%f2		! handle unaligned output

	stda		%f2, [%o1 + %g3]0xc0	! partial store
	add		%o1, 8, %o1
	orn		%g0, %g3, %g3
	stda		%f2, [%o1 + %g3]0xc0	! partial store

	brnz,pt		%o2, .Ldes_cbc_enc_loop+4
	orn		%g0, %g3, %g3

	st		%f0, [%o4 + 0]	! write out ivec
	retl
	st		%f1, [%o4 + 4]
.type	des_t4_cbc_encrypt,#function
.size	des_t4_cbc_encrypt,.-des_t4_cbc_encrypt

.globl	des_t4_cbc_decrypt
.align	32
des_t4_cbc_decrypt:
	cmp		%o2, 0
	be,pn		SIZE_T_CC, .Lcbc_abort
	srln		%o2, 0, %o2		! needed on v8+, "nop" on v9
	ld		[%o4 + 0], %f2	! load ivec
	ld		[%o4 + 4], %f3

	and		%o0, 7, %g1
	andn		%o0, 7, %o0
	sll		%g1, 3, %g1
	mov		0xff, %g3
	prefetch	[%o0], 20
	prefetch	[%o0 + 63], 20
	sub		%g0, %g1, %g2
	and		%o1, 7, %g4
	.word	0x93b24340 !alignaddrl	%o1,%g0,%o1
	srl		%g3, %g4, %g3
	srlx		%o2, 3, %o2
	movrz		%g4, 0, %g3
	prefetch	[%o1], 22

	ldd		[%o3 + 0x78], %f4	! load key schedule
	ldd		[%o3 + 0x70], %f6
	ldd		[%o3 + 0x68], %f8
	ldd		[%o3 + 0x60], %f10
	ldd		[%o3 + 0x58], %f12
	ldd		[%o3 + 0x50], %f14
	ldd		[%o3 + 0x48], %f16
	ldd		[%o3 + 0x40], %f18
	ldd		[%o3 + 0x38], %f20
	ldd		[%o3 + 0x30], %f22
	ldd		[%o3 + 0x28], %f24
	ldd		[%o3 + 0x20], %f26
	ldd		[%o3 + 0x18], %f28
	ldd		[%o3 + 0x10], %f30
	ldd		[%o3 + 0x08], %f32
	ldd		[%o3 + 0x00], %f34

.Ldes_cbc_dec_loop:
	ldx		[%o0 + 0], %g4
	brz,pt		%g1, 4f
	nop

	ldx		[%o0 + 8], %g5
	sllx		%g4, %g1, %g4
	srlx		%g5, %g2, %g5
	or		%g5, %g4, %g4
4:
	.word	0x81b02304 !movxtod	%g4,%f0
	prefetch	[%o0 + 8+63], 20
	add		%o0, 8, %o0
	prefetch	[%o1 + 63], 22

	.word	0x81b02680 !des_ip	%f0,%f0,,
	.word	0x80c90126 !des_round	%f4,%f6,%f0,%f0
	.word	0x80ca012a !des_round	%f8,%f10,%f0,%f0
	.word	0x80cb012e !des_round	%f12,%f14,%f0,%f0
	.word	0x80cc0132 !des_round	%f16,%f18,%f0,%f0
	.word	0x80cd0136 !des_round	%f20,%f22,%f0,%f0
	.word	0x80ce013a !des_round	%f24,%f26,%f0,%f0
	.word	0x80cf013e !des_round	%f28,%f30,%f0,%f0
	.word	0x80c84123 !des_round	%f32,%f34,%f0,%f0
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	.word	0x81b08d80 !fxor	%f2,%f0,%f0		! ^= ivec
	.word	0x85b02304 !movxtod	%g4,%f2

	brnz,pn		%g3, 2f
	sub		%o2, 1, %o2

	std		%f0, [%o1 + 0]
	brnz,pt		%o2, .Ldes_cbc_dec_loop
	add		%o1, 8, %o1

	st		%f2, [%o4 + 0]	! write out ivec
	retl
	st		%f3, [%o4 + 4]

.align	16
2:	ldxa		[%o0]0x82, %g4		! avoid read-after-write hazard
						! and ~4x deterioration
						! in inp==out case
	.word	0x81b00900 !faligndata	%f0,%f0,%f0		! handle unaligned output

	stda		%f0, [%o1 + %g3]0xc0	! partial store
	add		%o1, 8, %o1
	orn		%g0, %g3, %g3
	stda		%f0, [%o1 + %g3]0xc0	! partial store

	brnz,pt		%o2, .Ldes_cbc_dec_loop+4
	orn		%g0, %g3, %g3

	st		%f2, [%o4 + 0]	! write out ivec
	retl
	st		%f3, [%o4 + 4]
.type	des_t4_cbc_decrypt,#function
.size	des_t4_cbc_decrypt,.-des_t4_cbc_decrypt
.globl	des_t4_ede3_cbc_encrypt
.align	32
des_t4_ede3_cbc_encrypt:
	cmp		%o2, 0
	be,pn		SIZE_T_CC, .Lcbc_abort
	srln		%o2, 0, %o2		! needed on v8+, "nop" on v9
	ld		[%o4 + 0], %f0	! load ivec
	ld		[%o4 + 4], %f1

	and		%o0, 7, %g1
	andn		%o0, 7, %o0
	sll		%g1, 3, %g1
	mov		0xff, %g3
	prefetch	[%o0], 20
	prefetch	[%o0 + 63], 20
	sub		%g0, %g1, %g2
	and		%o1, 7, %g4
	.word	0x93b24340 !alignaddrl	%o1,%g0,%o1
	srl		%g3, %g4, %g3
	srlx		%o2, 3, %o2
	movrz		%g4, 0, %g3
	prefetch	[%o1], 22

	ldd		[%o3 + 0x00], %f4	! load key schedule
	ldd		[%o3 + 0x08], %f6
	ldd		[%o3 + 0x10], %f8
	ldd		[%o3 + 0x18], %f10
	ldd		[%o3 + 0x20], %f12
	ldd		[%o3 + 0x28], %f14
	ldd		[%o3 + 0x30], %f16
	ldd		[%o3 + 0x38], %f18
	ldd		[%o3 + 0x40], %f20
	ldd		[%o3 + 0x48], %f22
	ldd		[%o3 + 0x50], %f24
	ldd		[%o3 + 0x58], %f26
	ldd		[%o3 + 0x60], %f28
	ldd		[%o3 + 0x68], %f30
	ldd		[%o3 + 0x70], %f32
	ldd		[%o3 + 0x78], %f34

.Ldes_ede3_cbc_enc_loop:
	ldx		[%o0 + 0], %g4
	brz,pt		%g1, 4f
	nop

	ldx		[%o0 + 8], %g5
	sllx		%g4, %g1, %g4
	srlx		%g5, %g2, %g5
	or		%g5, %g4, %g4
4:
	.word	0x85b02304 !movxtod	%g4,%f2
	prefetch	[%o0 + 8+63], 20
	add		%o0, 8, %o0
	.word	0x81b08d80 !fxor	%f2,%f0,%f0		! ^= ivec
	prefetch	[%o1 + 63], 22

	.word	0x81b02680 !des_ip	%f0,%f0,,
	.word	0x80c90126 !des_round	%f4,%f6,%f0,%f0
	.word	0x80ca012a !des_round	%f8,%f10,%f0,%f0
	.word	0x80cb012e !des_round	%f12,%f14,%f0,%f0
	.word	0x80cc0132 !des_round	%f16,%f18,%f0,%f0
	ldd		[%o3 + 0x100-0x08], %f36
	ldd		[%o3 + 0x100-0x10], %f38
	.word	0x80cd0136 !des_round	%f20,%f22,%f0,%f0
	ldd		[%o3 + 0x100-0x18], %f40
	ldd		[%o3 + 0x100-0x20], %f42
	.word	0x80ce013a !des_round	%f24,%f26,%f0,%f0
	ldd		[%o3 + 0x100-0x28], %f44
	ldd		[%o3 + 0x100-0x30], %f46
	.word	0x80cf013e !des_round	%f28,%f30,%f0,%f0
	ldd		[%o3 + 0x100-0x38], %f48
	ldd		[%o3 + 0x100-0x40], %f50
	.word	0x80c84123 !des_round	%f32,%f34,%f0,%f0
	ldd		[%o3 + 0x100-0x48], %f52
	ldd		[%o3 + 0x100-0x50], %f54
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	ldd		[%o3 + 0x100-0x58], %f56
	ldd		[%o3 + 0x100-0x60], %f58
	.word	0x81b02680 !des_ip	%f0,%f0,,
	ldd		[%o3 + 0x100-0x68], %f60
	ldd		[%o3 + 0x100-0x70], %f62
	.word	0x80c94127 !des_round	%f36,%f38,%f0,%f0
	ldd		[%o3 + 0x100-0x78], %f36
	ldd		[%o3 + 0x100-0x80], %f38
	.word	0x80ca412b !des_round	%f40,%f42,%f0,%f0
	.word	0x80cb412f !des_round	%f44,%f46,%f0,%f0
	.word	0x80cc4133 !des_round	%f48,%f50,%f0,%f0
	ldd		[%o3 + 0x100+0x00], %f40
	ldd		[%o3 + 0x100+0x08], %f42
	.word	0x80cd4137 !des_round	%f52,%f54,%f0,%f0
	ldd		[%o3 + 0x100+0x10], %f44
	ldd		[%o3 + 0x100+0x18], %f46
	.word	0x80ce413b !des_round	%f56,%f58,%f0,%f0
	ldd		[%o3 + 0x100+0x20], %f48
	ldd		[%o3 + 0x100+0x28], %f50
	.word	0x80cf413f !des_round	%f60,%f62,%f0,%f0
	ldd		[%o3 + 0x100+0x30], %f52
	ldd		[%o3 + 0x100+0x38], %f54
	.word	0x80c94127 !des_round	%f36,%f38,%f0,%f0
	ldd		[%o3 + 0x100+0x40], %f56
	ldd		[%o3 + 0x100+0x48], %f58
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	ldd		[%o3 + 0x100+0x50], %f60
	ldd		[%o3 + 0x100+0x58], %f62
	.word	0x81b02680 !des_ip	%f0,%f0,,
	ldd		[%o3 + 0x100+0x60], %f36
	ldd		[%o3 + 0x100+0x68], %f38
	.word	0x80ca412b !des_round	%f40,%f42,%f0,%f0
	ldd		[%o3 + 0x100+0x70], %f40
	ldd		[%o3 + 0x100+0x78], %f42
	.word	0x80cb412f !des_round	%f44,%f46,%f0,%f0
	.word	0x80cc4133 !des_round	%f48,%f50,%f0,%f0
	.word	0x80cd4137 !des_round	%f52,%f54,%f0,%f0
	.word	0x80ce413b !des_round	%f56,%f58,%f0,%f0
	.word	0x80cf413f !des_round	%f60,%f62,%f0,%f0
	.word	0x80c94127 !des_round	%f36,%f38,%f0,%f0
	.word	0x80ca412b !des_round	%f40,%f42,%f0,%f0
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	brnz,pn		%g3, 2f
	sub		%o2, 1, %o2

	std		%f0, [%o1 + 0]
	brnz,pt		%o2, .Ldes_ede3_cbc_enc_loop
	add		%o1, 8, %o1

	st		%f0, [%o4 + 0]	! write out ivec
	retl
	st		%f1, [%o4 + 4]

.align	16
2:	ldxa		[%o0]0x82, %g4		! avoid read-after-write hazard
						! and ~2x deterioration
						! in inp==out case
	.word	0x85b00900 !faligndata	%f0,%f0,%f2		! handle unaligned output

	stda		%f2, [%o1 + %g3]0xc0	! partial store
	add		%o1, 8, %o1
	orn		%g0, %g3, %g3
	stda		%f2, [%o1 + %g3]0xc0	! partial store

	brnz,pt		%o2, .Ldes_ede3_cbc_enc_loop+4
	orn		%g0, %g3, %g3

	st		%f0, [%o4 + 0]	! write out ivec
	retl
	st		%f1, [%o4 + 4]
.type	des_t4_ede3_cbc_encrypt,#function
.size	des_t4_ede3_cbc_encrypt,.-des_t4_ede3_cbc_encrypt

.globl	des_t4_ede3_cbc_decrypt
.align	32
des_t4_ede3_cbc_decrypt:
	cmp		%o2, 0
	be,pn		SIZE_T_CC, .Lcbc_abort
	srln		%o2, 0, %o2		! needed on v8+, "nop" on v9
	ld		[%o4 + 0], %f2	! load ivec
	ld		[%o4 + 4], %f3

	and		%o0, 7, %g1
	andn		%o0, 7, %o0
	sll		%g1, 3, %g1
	mov		0xff, %g3
	prefetch	[%o0], 20
	prefetch	[%o0 + 63], 20
	sub		%g0, %g1, %g2
	and		%o1, 7, %g4
	.word	0x93b24340 !alignaddrl	%o1,%g0,%o1
	srl		%g3, %g4, %g3
	srlx		%o2, 3, %o2
	movrz		%g4, 0, %g3
	prefetch	[%o1], 22

	ldd		[%o3 + 0x100+0x78], %f4	! load key schedule
	ldd		[%o3 + 0x100+0x70], %f6
	ldd		[%o3 + 0x100+0x68], %f8
	ldd		[%o3 + 0x100+0x60], %f10
	ldd		[%o3 + 0x100+0x58], %f12
	ldd		[%o3 + 0x100+0x50], %f14
	ldd		[%o3 + 0x100+0x48], %f16
	ldd		[%o3 + 0x100+0x40], %f18
	ldd		[%o3 + 0x100+0x38], %f20
	ldd		[%o3 + 0x100+0x30], %f22
	ldd		[%o3 + 0x100+0x28], %f24
	ldd		[%o3 + 0x100+0x20], %f26
	ldd		[%o3 + 0x100+0x18], %f28
	ldd		[%o3 + 0x100+0x10], %f30
	ldd		[%o3 + 0x100+0x08], %f32
	ldd		[%o3 + 0x100+0x00], %f34

.Ldes_ede3_cbc_dec_loop:
	ldx		[%o0 + 0], %g4
	brz,pt		%g1, 4f
	nop

	ldx		[%o0 + 8], %g5
	sllx		%g4, %g1, %g4
	srlx		%g5, %g2, %g5
	or		%g5, %g4, %g4
4:
	.word	0x81b02304 !movxtod	%g4,%f0
	prefetch	[%o0 + 8+63], 20
	add		%o0, 8, %o0
	prefetch	[%o1 + 63], 22

	.word	0x81b02680 !des_ip	%f0,%f0,,
	.word	0x80c90126 !des_round	%f4,%f6,%f0,%f0
	.word	0x80ca012a !des_round	%f8,%f10,%f0,%f0
	.word	0x80cb012e !des_round	%f12,%f14,%f0,%f0
	.word	0x80cc0132 !des_round	%f16,%f18,%f0,%f0
	ldd		[%o3 + 0x80+0x00], %f36
	ldd		[%o3 + 0x80+0x08], %f38
	.word	0x80cd0136 !des_round	%f20,%f22,%f0,%f0
	ldd		[%o3 + 0x80+0x10], %f40
	ldd		[%o3 + 0x80+0x18], %f42
	.word	0x80ce013a !des_round	%f24,%f26,%f0,%f0
	ldd		[%o3 + 0x80+0x20], %f44
	ldd		[%o3 + 0x80+0x28], %f46
	.word	0x80cf013e !des_round	%f28,%f30,%f0,%f0
	ldd		[%o3 + 0x80+0x30], %f48
	ldd		[%o3 + 0x80+0x38], %f50
	.word	0x80c84123 !des_round	%f32,%f34,%f0,%f0
	ldd		[%o3 + 0x80+0x40], %f52
	ldd		[%o3 + 0x80+0x48], %f54
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	ldd		[%o3 + 0x80+0x50], %f56
	ldd		[%o3 + 0x80+0x58], %f58
	.word	0x81b02680 !des_ip	%f0,%f0,,
	ldd		[%o3 + 0x80+0x60], %f60
	ldd		[%o3 + 0x80+0x68], %f62
	.word	0x80c94127 !des_round	%f36,%f38,%f0,%f0
	ldd		[%o3 + 0x80+0x70], %f36
	ldd		[%o3 + 0x80+0x78], %f38
	.word	0x80ca412b !des_round	%f40,%f42,%f0,%f0
	.word	0x80cb412f !des_round	%f44,%f46,%f0,%f0
	.word	0x80cc4133 !des_round	%f48,%f50,%f0,%f0
	ldd		[%o3 + 0x80-0x08], %f40
	ldd		[%o3 + 0x80-0x10], %f42
	.word	0x80cd4137 !des_round	%f52,%f54,%f0,%f0
	ldd		[%o3 + 0x80-0x18], %f44
	ldd		[%o3 + 0x80-0x20], %f46
	.word	0x80ce413b !des_round	%f56,%f58,%f0,%f0
	ldd		[%o3 + 0x80-0x28], %f48
	ldd		[%o3 + 0x80-0x30], %f50
	.word	0x80cf413f !des_round	%f60,%f62,%f0,%f0
	ldd		[%o3 + 0x80-0x38], %f52
	ldd		[%o3 + 0x80-0x40], %f54
	.word	0x80c94127 !des_round	%f36,%f38,%f0,%f0
	ldd		[%o3 + 0x80-0x48], %f56
	ldd		[%o3 + 0x80-0x50], %f58
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	ldd		[%o3 + 0x80-0x58], %f60
	ldd		[%o3 + 0x80-0x60], %f62
	.word	0x81b02680 !des_ip	%f0,%f0,,
	ldd		[%o3 + 0x80-0x68], %f36
	ldd		[%o3 + 0x80-0x70], %f38
	.word	0x80ca412b !des_round	%f40,%f42,%f0,%f0
	ldd		[%o3 + 0x80-0x78], %f40
	ldd		[%o3 + 0x80-0x80], %f42
	.word	0x80cb412f !des_round	%f44,%f46,%f0,%f0
	.word	0x80cc4133 !des_round	%f48,%f50,%f0,%f0
	.word	0x80cd4137 !des_round	%f52,%f54,%f0,%f0
	.word	0x80ce413b !des_round	%f56,%f58,%f0,%f0
	.word	0x80cf413f !des_round	%f60,%f62,%f0,%f0
	.word	0x80c94127 !des_round	%f36,%f38,%f0,%f0
	.word	0x80ca412b !des_round	%f40,%f42,%f0,%f0
	.word	0x81b026a0 !des_iip	%f0,%f0,,

	.word	0x81b08d80 !fxor	%f2,%f0,%f0		! ^= ivec
	.word	0x85b02304 !movxtod	%g4,%f2

	brnz,pn		%g3, 2f
	sub		%o2, 1, %o2

	std		%f0, [%o1 + 0]
	brnz,pt		%o2, .Ldes_ede3_cbc_dec_loop
	add		%o1, 8, %o1

	st		%f2, [%o4 + 0]	! write out ivec
	retl
	st		%f3, [%o4 + 4]

.align	16
2:	ldxa		[%o0]0x82, %g4		! avoid read-after-write hazard
						! and ~3x deterioration
						! in inp==out case
	.word	0x81b00900 !faligndata	%f0,%f0,%f0		! handle unaligned output

	stda		%f0, [%o1 + %g3]0xc0	! partial store
	add		%o1, 8, %o1
	orn		%g0, %g3, %g3
	stda		%f0, [%o1 + %g3]0xc0	! partial store

	brnz,pt		%o2, .Ldes_ede3_cbc_dec_loop+4
	orn		%g0, %g3, %g3

	st		%f2, [%o4 + 0]	! write out ivec
	retl
	st		%f3, [%o4 + 4]
.type	des_t4_ede3_cbc_decrypt,#function
.size	des_t4_ede3_cbc_decrypt,.-des_t4_ede3_cbc_decrypt
.asciz  "DES for SPARC T4, David S. Miller, Andy Polyakov"
.align  4