|
@@ -43,21 +43,15 @@ void * __memcpy ( void *dest, const void *src, size_t len ) {
|
43
|
43
|
* moves. Using movsl rather than movsb speeds these up by
|
44
|
44
|
* around 32%.
|
45
|
45
|
*/
|
46
|
|
- if ( len >> 2 ) {
|
47
|
|
- __asm__ __volatile__ ( "rep movsl"
|
48
|
|
- : "=&D" ( edi ), "=&S" ( esi ),
|
49
|
|
- "=&c" ( discard_ecx )
|
50
|
|
- : "0" ( edi ), "1" ( esi ),
|
51
|
|
- "2" ( len >> 2 )
|
52
|
|
- : "memory" );
|
53
|
|
- }
|
54
|
|
- if ( len & 0x02 ) {
|
55
|
|
- __asm__ __volatile__ ( "movsw" : "=&D" ( edi ), "=&S" ( esi )
|
56
|
|
- : "0" ( edi ), "1" ( esi ) : "memory" );
|
57
|
|
- }
|
58
|
|
- if ( len & 0x01 ) {
|
59
|
|
- __asm__ __volatile__ ( "movsb" : "=&D" ( edi ), "=&S" ( esi )
|
60
|
|
- : "0" ( edi ), "1" ( esi ) : "memory" );
|
61
|
|
- }
|
|
46
|
+ __asm__ __volatile__ ( "rep movsl"
|
|
47
|
+ : "=&D" ( edi ), "=&S" ( esi ),
|
|
48
|
+ "=&c" ( discard_ecx )
|
|
49
|
+ : "0" ( edi ), "1" ( esi ), "2" ( len >> 2 )
|
|
50
|
+ : "memory" );
|
|
51
|
+ __asm__ __volatile__ ( "rep movsb"
|
|
52
|
+ : "=&D" ( edi ), "=&S" ( esi ),
|
|
53
|
+ "=&c" ( discard_ecx )
|
|
54
|
+ : "0" ( edi ), "1" ( esi ), "2" ( len & 3 )
|
|
55
|
+ : "memory" );
|
62
|
56
|
return dest;
|
63
|
57
|
}
|