Changeset 14021 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Nov 10, 2008 4:31:22 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39077
- Location:
- trunk/src/VBox/Runtime/common/string
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/memchr.asm
r8256 r14021 37 37 ; @param ch gcc: esi msc: edx x86:[esp+8] 38 38 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch] 39 BEGINPROC RT_NOCRT(memchr) 39 RT_NOCRT_BEGINPROC memchr 40 40 cld 41 41 %ifdef RT_ARCH_AMD64 -
trunk/src/VBox/Runtime/common/string/memcmp.asm
r8256 r14021 37 37 ; @param pv2 gcc: rsi msc: rdx x86:[esp+8] 38 38 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch] 39 BEGINPROC RT_NOCRT(memcmp) 39 RT_NOCRT_BEGINPROC memcmp 40 40 cld 41 41 xor eax, eax -
trunk/src/VBox/Runtime/common/string/memcpy.asm
r8256 r14021 37 37 ; @param pvSrc gcc: rsi msc: rdx x86:[esp+8] 38 38 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch] 39 BEGINPROC RT_NOCRT(memcpy) 39 RT_NOCRT_BEGINPROC memcpy 40 40 cld 41 41 -
trunk/src/VBox/Runtime/common/string/memmove.asm
r8256 r14021 37 37 ; @param pvSrc gcc: rsi msc: rdx x86:[esp+8] 38 38 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch] 39 BEGINPROC RT_NOCRT(memmove) 39 RT_NOCRT_BEGINPROC memmove 40 40 ; Prolog. 41 41 %ifdef RT_ARCH_AMD64 -
trunk/src/VBox/Runtime/common/string/mempcpy.asm
r8256 r14021 37 37 ; @param pvSrc gcc: rsi msc: rdx x86:[esp+8] 38 38 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch] 39 BEGINPROC RT_NOCRT(mempcpy) 39 RT_NOCRT_BEGINPROC mempcpy 40 40 cld ; paranoia 41 41 -
trunk/src/VBox/Runtime/common/string/memset.asm
r8256 r14021 37 37 ; @param ch gcc: esi msc: edx x86:[esp+8] 38 38 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch] 39 BEGINPROC RT_NOCRT(memset) 39 RT_NOCRT_BEGINPROC memset 40 40 cld 41 41 %ifdef RT_ARCH_AMD64 -
trunk/src/VBox/Runtime/common/string/strchr.asm
r8256 r14021 36 36 ; @param psz gcc: rdi msc: rcx x86:[esp+4] 37 37 ; @param ch gcc: esi msc: edx x86:[esp+8] 38 BEGINPROC RT_NOCRT(strchr) 38 RT_NOCRT_BEGINPROC strchr 39 39 cld 40 40 -
trunk/src/VBox/Runtime/common/string/strcmp.asm
r14017 r14021 36 36 ; @param psz1 gcc: rdi msc: rcx x86:[esp+4] 37 37 ; @param psz2 gcc: rsi msc: rdx x86:[esp+8] 38 BEGINPROC RT_NOCRT(strcmp) 38 RT_NOCRT_BEGINPROC strcmp 39 39 ; input 40 40 %ifdef RT_ARCH_AMD64 -
trunk/src/VBox/Runtime/common/string/strcpy.asm
r13991 r14021 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT strc mp- AMD64 & X86.3 ; IPRT - No-CRT strcpy - AMD64 & X86. 4 4 ; 5 5 … … 36 36 ; @param psz1 gcc: rdi msc: rcx x86:[esp+4] 37 37 ; @param psz2 gcc: rsi msc: rdx x86:[esp+8] 38 BEGINPROC RT_NOCRT(strcmp) 38 RT_NOCRT_BEGINPROC strcpy 39 39 ; input 40 40 %ifdef RT_ARCH_AMD64 … … 46 46 %define psz2 rsi 47 47 %endif 48 mov r8, psz1 48 49 %else 49 50 mov ecx, [esp + 4] … … 51 52 %define psz1 ecx 52 53 %define psz2 edx 54 push psz1 53 55 %endif 54 56 … … 58 60 .next: 59 61 mov al, [psz1] 60 mov ah, [psz2] 61 cmp al, ah 62 jne .not_equal 62 mov [psz2], al 63 63 test al, al 64 jz . equal64 jz .done 65 65 66 66 mov al, [psz1 + 1] 67 mov ah, [psz2 + 1] 68 cmp al, ah 69 jne .not_equal 67 mov [psz2 + 1], al 70 68 test al, al 71 jz .equal 72 inc psz1 73 inc psz2 69 jz .done 74 70 75 71 mov al, [psz1 + 2] 76 mov ah, [psz2 + 2] 77 cmp al, ah 78 jne .not_equal 72 mov [psz2 + 2], al 79 73 test al, al 80 jz .equal 81 inc psz1 82 inc psz2 74 jz .done 83 75 84 76 mov al, [psz1 + 3] 85 mov ah, [psz2 + 3] 86 cmp al, ah 87 jne .not_equal 77 mov [psz2 + 3], al 88 78 test al, al 89 jz . equal79 jz .done 90 80 91 81 add psz1, 4 … … 93 83 jmp .next 94 84 95 .equal: 96 xor eax, eax 85 .done: 86 %ifdef RT_ARCH_AMD64 87 mov rax, r8 88 %else 89 pop eax 90 %endif 97 91 ret 92 ENDPROC RT_NOCRT(strcpy) 98 93 99 .not_equal:100 movzx ecx, ah101 and eax, 0ffh102 sub eax, ecx103 ret104 ENDPROC RT_NOCRT(strcmp)105 -
trunk/src/VBox/Runtime/common/string/strcpy_alias.c
r13991 r14021 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - No-CRT strc mp() alias for gcc.3 * IPRT - No-CRT strcpy() alias for gcc. 4 4 */ 5 5 … … 34 34 *******************************************************************************/ 35 35 #include <iprt/nocrt/string.h> 36 #undef strc mp36 #undef strcpy 37 37 38 38 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 39 39 # ifndef __MINGW32__ 40 # pragma weak strc mp40 # pragma weak strcpy 41 41 # endif 42 42 43 43 /* No alias support here (yet in the ming case). */ 44 extern int (strcmp)(constchar *psz1, const char *psz2)44 extern char * (strcpy)(char *psz1, const char *psz2) 45 45 { 46 return RT_NOCRT(strc mp)(psz1, psz2);46 return RT_NOCRT(strcpy)(psz1, psz2); 47 47 } 48 48 49 49 #elif __GNUC__ >= 4 50 50 /* create a weak alias. */ 51 __asm__(".weak strcmp\t\n" 52 " .set strcmp," RT_NOCRT_STR(strcmp) "\t\n"); 51 __asm__(".weak strcpy\t\n" 52 " .set strcpy," RT_NOCRT_STR(strcpy) "\t\n" 53 ".global strcpy\t\n" 54 ); 53 55 #else 54 56 /* create a weak alias. */ 55 extern __typeof(RT_NOCRT(strc mp)) strcmp __attribute__((weak, alias(RT_NOCRT_STR(strcmp))));57 extern __typeof(RT_NOCRT(strcpy)) strcpy __attribute__((weak, alias(RT_NOCRT_STR(strcpy)))); 56 58 #endif 57 59 -
trunk/src/VBox/Runtime/common/string/strlen.asm
r9502 r14021 35 35 ;; 36 36 ; @param psz gcc: rdi msc: rcx x86: [esp+4] 37 BEGINPROC RT_NOCRT(strlen) 37 RT_NOCRT_BEGINPROC strlen 38 38 cld 39 39 %ifdef RT_ARCH_AMD64
Note:
See TracChangeset
for help on using the changeset viewer.