1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * include/asm-alpha/xor.h
5 * Optimized RAID-5 checksumming functions for alpha EV5 and EV6
8 extern void xor_alpha_2(unsigned long, unsigned long *, unsigned long *);
9 extern void xor_alpha_3(unsigned long, unsigned long *, unsigned long *,
11 extern void xor_alpha_4(unsigned long, unsigned long *, unsigned long *,
12 unsigned long *, unsigned long *);
13 extern void xor_alpha_5(unsigned long, unsigned long *, unsigned long *,
14 unsigned long *, unsigned long *, unsigned long *);
16 extern void xor_alpha_prefetch_2(unsigned long, unsigned long *,
18 extern void xor_alpha_prefetch_3(unsigned long, unsigned long *,
19 unsigned long *, unsigned long *);
20 extern void xor_alpha_prefetch_4(unsigned long, unsigned long *,
21 unsigned long *, unsigned long *,
23 extern void xor_alpha_prefetch_5(unsigned long, unsigned long *,
24 unsigned long *, unsigned long *,
25 unsigned long *, unsigned long *);
54 xor $0,$1,$0 # 7 cycles from $1 load \n\
111 xor $0,$1,$1 # 8 cycles from $0 load \n\
112 xor $3,$4,$4 # 6 cycles from $4 load \n\
113 xor $6,$7,$7 # 6 cycles from $7 load \n\
114 xor $21,$22,$22 # 5 cycles from $22 load \n\
116 xor $1,$2,$2 # 9 cycles from $2 load \n\
117 xor $24,$25,$25 # 5 cycles from $25 load \n\
119 xor $4,$5,$5 # 6 cycles from $5 load \n\
122 xor $7,$20,$20 # 7 cycles from $20 load \n\
124 xor $22,$23,$23 # 7 cycles from $23 load \n\
127 xor $25,$27,$27 # 7 cycles from $27 load \n\
142 xor $0,$1,$1 # 4 cycles from $1 load \n\
143 xor $3,$4,$4 # 5 cycles from $4 load \n\
144 xor $6,$7,$7 # 5 cycles from $7 load \n\
146 xor $1,$2,$2 # 4 cycles from $2 load \n\
147 xor $4,$5,$5 # 5 cycles from $5 load \n\
149 xor $7,$20,$20 # 4 cycles from $20 load \n\
185 xor $0,$1,$1 # 6 cycles from $1 load \n\
187 xor $2,$3,$3 # 6 cycles from $3 load \n\
192 xor $4,$5,$5 # 7 cycles from $5 load \n\
196 xor $21,$22,$22 # 7 cycles from $22 load \n\
200 xor $23,$24,$24 # 7 cycles from $24 load \n\
207 xor $25,$27,$27 # 8 cycles from $27 load \n\
215 xor $0,$1,$1 # 9 cycles from $1 load \n\
216 xor $2,$3,$3 # 5 cycles from $3 load \n\
220 xor $4,$5,$5 # 5 cycles from $5 load \n\
231 xor $6,$7,$7 # 8 cycles from $6 load \n\
235 xor $21,$22,$22 # 8 cycles from $22 load \n\
237 xor $23,$24,$24 # 5 cycles from $24 load \n\
240 xor $25,$27,$27 # 5 cycles from $27 load \n\
242 xor $0,$1,$1 # 5 cycles from $1 load \n\
245 xor $2,$3,$3 # 4 cycles from $3 load \n\
282 xor $0,$1,$1 # 6 cycles from $1 load \n\
284 xor $2,$3,$3 # 6 cycles from $3 load \n\
289 xor $3,$4,$4 # 7 cycles from $4 load \n\
292 xor $5,$6,$6 # 7 cycles from $6 load \n\
293 xor $7,$22,$22 # 7 cycles from $22 load \n\
294 xor $6,$23,$23 # 7 cycles from $23 load \n\
299 xor $24,$25,$25 # 8 cycles from $25 load \n\
302 xor $25,$27,$27 # 8 cycles from $27 load \n\
304 xor $28,$0,$0 # 7 cycles from $0 load \n\
312 xor $1,$2,$2 # 6 cycles from $2 load \n\
314 xor $3,$4,$4 # 4 cycles from $4 load \n\
324 xor $4,$5,$5 # 7 cycles from $5 load \n\
327 xor $6,$7,$7 # 7 cycles from $7 load \n\
332 xor $7,$22,$22 # 7 cycles from $22 load \n\
334 xor $23,$24,$24 # 6 cycles from $24 load \n\
339 xor $25,$27,$27 # 7 cycles from $27 load \n\
342 xor $27,$28,$28 # 8 cycles from $28 load \n\
344 xor $0,$1,$1 # 6 cycles from $1 load \n\
352 xor $2,$3,$3 # 9 cycles from $3 load \n\
353 xor $3,$4,$4 # 9 cycles from $4 load \n\
354 xor $5,$6,$6 # 8 cycles from $6 load \n\
358 xor $7,$22,$22 # 7 cycles from $22 load \n\
359 xor $23,$24,$24 # 6 cycles from $24 load \n\
364 xor $24,$25,$25 # 8 cycles from $25 load \n\
378 .ent xor_alpha_prefetch_2 \n\
379 xor_alpha_prefetch_2: \n\
389 ldq $31, 128($17) \n\
390 ldq $31, 128($18) \n\
392 ldq $31, 192($17) \n\
393 ldq $31, 192($18) \n\
417 xor $0,$1,$0 # 8 cycles from $1 load \n\
444 .end xor_alpha_prefetch_2 \n\
447 .ent xor_alpha_prefetch_3 \n\
448 xor_alpha_prefetch_3: \n\
460 ldq $31, 128($17) \n\
461 ldq $31, 128($18) \n\
462 ldq $31, 128($19) \n\
464 ldq $31, 192($17) \n\
465 ldq $31, 192($18) \n\
466 ldq $31, 192($19) \n\
489 xor $0,$1,$1 # 8 cycles from $0 load \n\
490 xor $3,$4,$4 # 7 cycles from $4 load \n\
491 xor $6,$7,$7 # 6 cycles from $7 load \n\
492 xor $21,$22,$22 # 5 cycles from $22 load \n\
494 xor $1,$2,$2 # 9 cycles from $2 load \n\
495 xor $24,$25,$25 # 5 cycles from $25 load \n\
497 xor $4,$5,$5 # 6 cycles from $5 load \n\
500 xor $7,$20,$20 # 7 cycles from $20 load \n\
502 xor $22,$23,$23 # 7 cycles from $23 load \n\
505 xor $25,$27,$27 # 7 cycles from $27 load \n\
524 xor $0,$1,$1 # 6 cycles from $1 load \n\
525 xor $3,$4,$4 # 5 cycles from $4 load \n\
526 xor $6,$7,$7 # 5 cycles from $7 load \n\
527 xor $1,$2,$2 # 4 cycles from $2 load \n\
529 xor $4,$5,$5 # 5 cycles from $5 load \n\
530 xor $7,$20,$20 # 4 cycles from $20 load \n\
542 .end xor_alpha_prefetch_3 \n\
545 .ent xor_alpha_prefetch_4 \n\
546 xor_alpha_prefetch_4: \n\
560 ldq $31, 128($17) \n\
561 ldq $31, 128($18) \n\
562 ldq $31, 128($19) \n\
563 ldq $31, 128($20) \n\
565 ldq $31, 192($17) \n\
566 ldq $31, 192($18) \n\
567 ldq $31, 192($19) \n\
568 ldq $31, 192($20) \n\
587 xor $0,$1,$1 # 6 cycles from $1 load \n\
589 xor $2,$3,$3 # 6 cycles from $3 load \n\
594 xor $4,$5,$5 # 7 cycles from $5 load \n\
598 xor $21,$22,$22 # 7 cycles from $22 load \n\
602 xor $23,$24,$24 # 7 cycles from $24 load \n\
609 xor $25,$27,$27 # 8 cycles from $27 load \n\
617 xor $0,$1,$1 # 9 cycles from $1 load \n\
618 xor $2,$3,$3 # 5 cycles from $3 load \n\
622 xor $4,$5,$5 # 5 cycles from $5 load \n\
634 xor $6,$7,$7 # 8 cycles from $6 load \n\
637 xor $21,$22,$22 # 8 cycles from $22 load \n\
642 xor $23,$24,$24 # 6 cycles from $24 load \n\
644 xor $25,$27,$27 # 6 cycles from $27 load \n\
648 xor $0,$1,$1 # 7 cycles from $1 load \n\
649 xor $2,$3,$3 # 6 cycles from $3 load \n\
664 .end xor_alpha_prefetch_4 \n\
667 .ent xor_alpha_prefetch_5 \n\
668 xor_alpha_prefetch_5: \n\
684 ldq $31, 128($17) \n\
685 ldq $31, 128($18) \n\
686 ldq $31, 128($19) \n\
687 ldq $31, 128($20) \n\
688 ldq $31, 128($21) \n\
690 ldq $31, 192($17) \n\
691 ldq $31, 192($18) \n\
692 ldq $31, 192($19) \n\
693 ldq $31, 192($20) \n\
694 ldq $31, 192($21) \n\
713 xor $0,$1,$1 # 6 cycles from $1 load \n\
715 xor $2,$3,$3 # 6 cycles from $3 load \n\
720 xor $3,$4,$4 # 7 cycles from $4 load \n\
723 xor $5,$6,$6 # 7 cycles from $6 load \n\
724 xor $7,$22,$22 # 7 cycles from $22 load \n\
725 xor $6,$23,$23 # 7 cycles from $23 load \n\
730 xor $24,$25,$25 # 8 cycles from $25 load \n\
733 xor $25,$27,$27 # 8 cycles from $27 load \n\
735 xor $28,$0,$0 # 7 cycles from $0 load \n\
743 xor $1,$2,$2 # 6 cycles from $2 load \n\
745 xor $3,$4,$4 # 4 cycles from $4 load \n\
755 xor $4,$5,$5 # 7 cycles from $5 load \n\
758 xor $6,$7,$7 # 7 cycles from $7 load \n\
763 xor $7,$22,$22 # 7 cycles from $22 load \n\
765 xor $23,$24,$24 # 6 cycles from $24 load \n\
770 xor $25,$27,$27 # 7 cycles from $27 load \n\
773 xor $27,$28,$28 # 8 cycles from $28 load \n\
775 xor $0,$1,$1 # 6 cycles from $1 load \n\
785 xor $2,$3,$3 # 9 cycles from $3 load \n\
788 xor $3,$4,$4 # 9 cycles from $4 load \n\
790 xor $5,$6,$6 # 8 cycles from $6 load \n\
794 xor $7,$22,$22 # 7 cycles from $22 load \n\
795 xor $23,$24,$24 # 6 cycles from $24 load \n\
800 xor $24,$25,$25 # 8 cycles from $25 load \n\
813 .end xor_alpha_prefetch_5 \n\
816 static struct xor_block_template xor_block_alpha
= {
824 static struct xor_block_template xor_block_alpha_prefetch
= {
825 .name
= "alpha prefetch",
826 .do_2
= xor_alpha_prefetch_2
,
827 .do_3
= xor_alpha_prefetch_3
,
828 .do_4
= xor_alpha_prefetch_4
,
829 .do_5
= xor_alpha_prefetch_5
,
832 /* For grins, also test the generic routines. */
833 #include <asm-generic/xor.h>
835 #undef XOR_TRY_TEMPLATES
836 #define XOR_TRY_TEMPLATES \
838 xor_speed(&xor_block_8regs); \
839 xor_speed(&xor_block_32regs); \
840 xor_speed(&xor_block_alpha); \
841 xor_speed(&xor_block_alpha_prefetch); \
844 /* Force the use of alpha_prefetch if EV6, as it is significantly
845 faster in the cold cache case. */
846 #define XOR_SELECT_TEMPLATE(FASTEST) \
847 (implver() == IMPLVER_EV6 ? &xor_block_alpha_prefetch : FASTEST)