1 /* $Id: md.h,v 1.3 1999/05/25 16:53:28 jj Exp $
2 * md.h: High speed xor_block operation for RAID4/5
3 * utilizing the UltraSparc Visual Instruction Set.
5 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
14 #undef HAVE_ARCH_XORBLOCK
16 #define MD_XORBLOCK_ALIGNMENT 64
18 /* void __xor_block (char *dest, char *src, long len)
20 * while (len--) *dest++ ^= *src++;
24 * !(((long)dest | (long)src) & (MD_XORBLOCK_ALIGNMENT - 1)) &&
25 * !(len & 127) && len >= 256
28 static inline void __xor_block (char *dest
, char *src
, long len
)
30 __asm__
__volatile__ ("
33 membar #LoadStore|#StoreLoad|#StoreStore
37 1: ldda [%0 + 64] %%asi, %%f32
38 fxor %%f0, %%f16, %%f16
39 fxor %%f2, %%f18, %%f18
40 fxor %%f4, %%f20, %%f20
41 fxor %%f6, %%f22, %%f22
42 fxor %%f8, %%f24, %%f24
43 fxor %%f10, %%f26, %%f26
44 fxor %%f12, %%f28, %%f28
45 fxor %%f14, %%f30, %%f30
47 ldda [%1 + 64] %%asi, %%f48
48 ldda [%0 + 128] %%asi, %%f0
49 fxor %%f32, %%f48, %%f48
50 fxor %%f34, %%f50, %%f50
52 fxor %%f36, %%f52, %%f52
54 fxor %%f38, %%f54, %%f54
56 fxor %%f40, %%f56, %%f56
57 fxor %%f42, %%f58, %%f58
58 fxor %%f44, %%f60, %%f60
59 fxor %%f46, %%f62, %%f62
60 stda %%f48, [%0 - 64] %%asi
63 ldda [%0 + 64] %%asi, %%f32
64 fxor %%f0, %%f16, %%f16
65 fxor %%f2, %%f18, %%f18
66 fxor %%f4, %%f20, %%f20
67 fxor %%f6, %%f22, %%f22
68 fxor %%f8, %%f24, %%f24
69 fxor %%f10, %%f26, %%f26
70 fxor %%f12, %%f28, %%f28
71 fxor %%f14, %%f30, %%f30
73 ldda [%1 + 64] %%asi, %%f48
75 fxor %%f32, %%f48, %%f48
76 fxor %%f34, %%f50, %%f50
77 fxor %%f36, %%f52, %%f52
78 fxor %%f38, %%f54, %%f54
79 fxor %%f40, %%f56, %%f56
80 fxor %%f42, %%f58, %%f58
81 fxor %%f44, %%f60, %%f60
82 fxor %%f46, %%f62, %%f62
83 stda %%f48, [%0 + 64] %%asi
84 membar #Sync|#StoreStore|#StoreLoad
87 "r" (dest
), "r" (src
), "r" (len
), "i" (FPRS_FEF
), "i" (ASI_BLK_P
) :
91 #endif /* __ASM_MD_H */