Changeset 75129 in vbox for trunk/src/VBox/Runtime/common/string/watcom/memcmp.asm
- Timestamp:
- Oct 28, 2018 5:00:27 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126206
- Location:
- trunk/src/VBox/Runtime/common/string/watcom
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/watcom/memcmp.asm
r75123 r75129 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT memcmp - AMD64 & X86.3 ; IPRT - No-CRT memcmp - Watcom register calling convention. 4 4 ; 5 5 … … 27 27 %include "iprt/asmdefs.mac" 28 28 29 BEGINCODE 29 %define ASM_CALL32_WATCOM 30 %define NAME(name) name %+ _ 31 %include "common/string/memcmp.asm" 30 32 31 ;;32 ; @param pv1 gcc: rdi msc: rcx x86:[esp+4]33 ; @param pv2 gcc: rsi msc: rdx x86:[esp+8]34 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch]35 RT_NOCRT_BEGINPROC memcmp36 cld37 xor eax, eax38 39 ; Do the bulk of the work.40 %ifdef RT_ARCH_AMD6441 %ifdef ASM_CALL64_MSC42 mov r10, rdi ; save43 mov r11, rsi ; save44 mov rdi, rcx45 mov rsi, rdx46 mov rcx, r847 mov rdx, r848 %else49 mov rcx, rdx50 %endif51 shr rcx, 352 repe cmpsq53 jne .not_equal_qword54 %else55 push edi56 push esi57 58 mov ecx, [esp + 0ch + 8]59 mov edi, [esp + 04h + 8]60 mov esi, [esp + 08h + 8]61 mov edx, ecx62 jecxz .done63 shr ecx, 264 repe cmpsd65 jne .not_equal_dword66 %endif67 68 ; The remaining bytes.69 %ifdef RT_ARCH_AMD6470 test dl, 471 jz .dont_cmp_dword72 cmpsd73 jne .not_equal_dword74 %endif75 .dont_cmp_dword:76 test dl, 277 jz .dont_cmp_word78 cmpsw79 jne .not_equal_word80 .dont_cmp_word:81 test dl, 182 jz .dont_cmp_byte83 cmpsb84 jne .not_equal_byte85 .dont_cmp_byte:86 87 .done:88 %ifdef RT_ARCH_AMD6489 %ifdef ASM_CALL64_MSC90 mov rdi, r1091 mov rsi, r1192 %endif93 %else94 pop esi95 pop edi96 %endif97 ret98 99 ;100 ; Mismatches.101 ;102 %ifdef RT_ARCH_AMD64103 .not_equal_qword:104 mov ecx, 8105 sub rsi, 8106 sub rdi, 8107 repe cmpsb108 .not_equal_byte:109 mov al, [xDI-1]110 movzx ecx, byte [xSI-1]111 sub eax, ecx112 jmp .done113 %endif114 115 .not_equal_dword:116 mov ecx, 4117 sub xSI, 4118 sub xDI, 4119 repe cmpsb120 %ifdef RT_ARCH_AMD64121 jmp .not_equal_byte122 %else123 .not_equal_byte:124 mov al, [xDI-1]125 movzx ecx, byte [xSI-1]126 sub eax, ecx127 jmp .done128 %endif129 130 .not_equal_word:131 mov ecx, 2132 sub xSI, 2133 sub xDI, 2134 repe cmpsb135 jmp .not_equal_byte136 ENDPROC RT_NOCRT(memcmp)137
Note:
See TracChangeset
for help on using the changeset viewer.