Changeset 7203 in vbox
- Timestamp:
- Feb 28, 2008 4:00:30 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28513
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/memmove.asm
r7185 r7203 60 60 ; Decide which direction to perform the copy in. 61 61 ; 62 %if 1 ; keep it simpe for now. 62 63 cmp xDI, xSI 63 j b .forward64 jnb .backward 64 65 65 66 ; 66 ; Copy forward.67 ; Slow/simple forward copy. 67 68 ; 68 .forward: 69 cld 70 rep movsb 71 jmp .epilog 72 73 %else ; disabled - it seems to work, but play safe for now. 74 ;sub xAX, xSI 75 ;jnb .backward 76 cmp xDI, xSI 77 jnb .backward 78 79 ; 80 ; Fast forward copy. 81 ; 82 .fast_forward: 69 83 cld 70 84 %ifdef RT_ARCH_AMD64 … … 92 106 .forward_dont_move_byte: 93 107 108 %endif ; disabled 109 94 110 ; 95 111 ; The epilog. … … 107 123 ret 108 124 109 110 125 ; 111 ; Copy backward.126 ; Slow/simple backward copy. 112 127 ; 113 128 ALIGNCODE(16) 114 129 .backward: 130 ;; @todo check if they overlap. 131 lea xDI, [xDI + xCX - 1] 132 lea xSI, [xSI + xCX - 1] 115 133 std 116 add xDI, xCX 117 add xSI, xCX 118 %ifdef RT_ARCH_AMD64 119 shr rcx, 3 120 rep movsq 121 %else 122 shr ecx, 2 123 rep movsd 124 %endif 125 126 ; The remaining bytes. 127 %ifdef RT_ARCH_AMD64 128 test dl, 4 129 jz .backward_dont_move_dword 130 movsd 131 %endif 132 .backward_dont_move_dword: 133 test dl, 2 134 jz .backward_dont_move_word 135 movsw 136 .backward_dont_move_word: 137 test dl, 1 138 jz .backward_dont_move_byte 139 movsb 140 .backward_dont_move_byte: 141 134 rep movsb 142 135 cld 143 136 jmp .epilog
Note:
See TracChangeset
for help on using the changeset viewer.