3 static inline void fast_memcpy32_x86(void *v_to
, void *v_from
, int words
) {
4 uint32_t *to
= (uint32_t*)(v_to
);
5 uint32_t *from
= (uint32_t*)(v_from
);
6 while(words
--) { *to
++ = *from
++; }
9 static inline void fast_memcpy64(void *v_to
, void *v_from
, int words
) {
10 uint64_t *to
= (uint64_t*)(v_to
);
11 uint64_t *from
= (uint64_t*)(v_from
);
12 while(words
--) { *to
++ = *from
++; }
15 /* Found this tip floating around the internet. PPC has a
16 preincrement and store opcode, but not post. */
17 static inline void fast_memcpy32_ppc(void *v_to
, void *v_from
, int words
) {
18 uint32_t *to
= (uint32_t*)(v_to
);
19 uint32_t *from
= (uint32_t*)(v_from
);
23 while(words
--) { *++to
= *++from
; }
26 static inline void fast_memfill32_x86(void *v_to
, uint32_t val
, int words
) {
27 uint32_t *to
= (uint32_t*)(v_to
);
28 while(words
--) { *to
++ = val
; }
31 static inline void fast_memfill64(void *v_to
, uint64_t val
, int words
) {
32 uint64_t *to
= (uint64_t*)(v_to
);
33 while(words
--) { *to
++ = val
; }
36 static inline void fast_memfill32_ppc(void *v_to
, uint32_t val
, int words
) {
37 uint32_t *to
= (uint32_t*)(v_to
);
39 while(words
--) { *++to
= val
; }
42 static inline void fast_memfill32_s20(void *v_to
, uint32_t val
) {
43 uint32_t *to
= (uint32_t*)v_to
;
51 static inline void fast_memfill64_s20(void *v_to
, uint64_t val
) {
52 uint64_t *to
= (uint64_t*)v_to
;
61 #define fast_memcpy32(a,b,c) fast_memcpy32_ppc(a,b,c)
62 #define fast_memfill32(a,b,c) fast_memfill32_ppc(a,b,c)
64 #define fast_memcpy32(a,b,c) fast_memcpy32_x86(a,b,c)
65 #define fast_memfill32(a,b,c) fast_memfill32_x86(a,b,c)
69 #define fast_memcpy(a,b,c) fast_memcpy64(a,b,c)
70 #define fast_memfill(a,b,c) fast_memfill64(a,b,c)
71 #define fast_memfill_s20(a,b) fast_memfill64_s20(a,b)
73 #define fast_memcpy(a,b,c) fast_memcpy32(a,b,c)
74 #define fast_memfill(a,b,c) fast_memfill32(a,b,c)
75 #define fast_memfill_s20(a,b) fast_memfill32_s20(a,b)