Changeset 75129 in vbox for trunk/src/VBox/Runtime/common/string/watcom/memset.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/memset.asm
r75123 r75129 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT memset - AMD64 & X86.3 ; IPRT - No-CRT memset - 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/memset.asm" 30 32 31 ;;32 ; @param pvDst gcc: rdi msc: ecx x86:[esp+4]33 ; @param ch gcc: esi msc: edx x86:[esp+8]34 ; @param cb gcc: rdx msc: r8 x86:[esp+0ch]35 RT_NOCRT_BEGINPROC memset36 cld37 %ifdef RT_ARCH_AMD6438 %ifdef ASM_CALL64_MSC39 mov r9, rdi ; save rdi in r940 mov rdi, rcx41 mov r10, rcx ; the return value.42 movzx eax, dl43 cmp r8, 3244 jb .dobytes45 46 ; eax = (al << 24) | (al << 16) | (al << 8) | al;47 ; rdx = (eax << 32) | eax48 movzx edx, dl49 mov rax, qword 0101010101010101h50 imul rax, rdx51 52 ; todo: alignment.53 mov rcx, r854 shr rcx, 355 rep stosq56 57 and r8, 758 .dobytes:59 mov rcx, r860 rep stosb61 62 mov rdi, r9 ; restore rdi63 mov rax, r1064 65 %else ; GCC66 mov r10, rdi ; the return value.67 movzx eax, sil68 cmp rdx, 3269 jb .dobytes70 71 ; eax = (al << 24) | (al << 16) | (al << 8) | al;72 ; rdx = (eax << 32) | eax73 movzx esi, sil74 mov rax, qword 0101010101010101h75 imul rax, rsi76 77 ; todo: alignment.78 mov rcx, rdx79 shr rcx, 380 rep stosq81 82 and rdx, 783 .dobytes:84 mov rcx, rdx85 rep stosb86 87 mov rax, r1088 %endif ; GCC89 90 %else ; X8691 push edi92 93 mov ecx, [esp + 0ch + 4]94 movzx eax, byte [esp + 08h + 4]95 mov edi, [esp + 04h + 4]96 cmp ecx, 1297 jb .dobytes98 99 ; eax = (al << 24) | (al << 16) | (al << 8) | al;100 mov ah, al101 mov edx, eax102 shl edx, 16103 or eax, edx104 105 mov edx, ecx106 shr ecx, 2107 rep stosd108 109 and edx, 3110 mov ecx, edx111 .dobytes:112 rep stosb113 114 pop edi115 mov eax, [esp + 4]116 %endif ; X86117 ret118 ENDPROC RT_NOCRT(memset)119
Note:
See TracChangeset
for help on using the changeset viewer.